Don’t Be Ashamed of the Brute-Force or Naive Solution.
Brute-forcing a technical problem is nothing to be ashamed about, in fact, it’s one way of showing off your problem-solving skills.
One thing I still struggle with during technical challenges is opting to solve a problem with the brute force or naive solution first. I always feel inclined to think of the optimal solution right off the bat. This habit is tough to break, especially if you feel stressed to impress your potential employer.
So, here are some reasons why opting for the brute force or naive solution can do you more good than harm.
Show Off Your Problem Solving Skills.
A brute force or naive solution is an easy way to show off problem-solving skills.
Technical interviews assess one's problem-solving skills, not necessarily how fast or optimal a problem is solved. Problem-solving skills entail analysis, active reading or listening, communication, and decision making. Deciding to opt for a brute force or naive solution is a way of displaying problem-solving skills.
If the problem you’re solving is straightforward, it’s okay to jump into the optimal solution. But, I know from first-hand experience, solving any question on the spot during an interview is anxiety-inducing. It’s so easy to draw a blank in stressful situations. So don’t be ashamed if you need a moment to collect yourself and work through a brute force or naive solution, even if it’s an easy problem.
Quick Side Note
Just a quick derailment from the topic because I want to raise an important point about technical interviews.
Most technical interviews want to assess how well you collaborate. When you’re part of a team, you bring both your expertise and curiosity to the table. You might not be an expert in every area of the project you’re working on, but your curiosity should help you learn the unfamiliar areas of the project. The same holds for technical interviews.
You might get stuck in the middle of a solution or forget a particular method. Perhaps you missed an edge case. Whatever the situation might be, use your curiosity to engage your interviewer. Ask a question. Inquire about a method. Admit you need a little help. These are all ways of showing your interviewer that you can collaborate and communicate with other people. And as a bonus, you show off your problem-solving skills in the process.
Better Understanding of the Problem Description.
You can’t think of an optimal solution if you don’t know what solution you're optimizing.
Optimal solutions require cutting costs in time complexity, space complexity, or both. One might look into different types of methods or data structures to solve the problem efficiently. One might also analyze similarly-related problems to explore the set of possible optimizations that apply to the problem. Whatever the case, optimizing requires understanding the initial problem and comparing and contrasting different feasible solutions to that problem.
If you don’t have a base solution to analyze, how do you know you’re optimally solving the problem? Unfortunately, you don’t know. This means you increase the risk of getting the solution wrong because you didn’t understand the initial problem.
Opting for a brute force or naive solution allows you to focus on the problem first, which means thoroughly understanding the problem description. Problem descriptions can be wordy, long, confusing, and riddled with hidden gems that we overlook on the first and second read. As you work through the brute force or naive solution, you may generate questions regarding the problem description to ask the interviewer. Remember, communication is another problem-solving skill. Focus on understanding the problem first and optimizing second.
I’ve conducted interviews in the past. I would rather hear the interviewee discuss ways to improve a solution for the right problem than watch them struggle thinking of an optimal solution for the wrong problem.
Final Points
Technical interviews are challenging, and they test more than what meets the eye, but remember these critical points:
- Never feel ashamed for opting for a brute-force or naive solution because the solution is only a fraction of what the interviewer is assessing.
- Use the brute-force or naive solution as a catalyst to display your problem-solving skills.
- Focus on engaging your interviewer and creating an environment that’s friendly for communication.
- Focus on a feasible solution to the problem first and ensure you understand the initial problem.
Lastly, be kind and patient with yourself in stressful situations. You’ve prepared for this, so show them what you’ve got.