DEV Community

Chad R. Stewart
Chad R. Stewart

Posted on

Problem-Solving Framework for Technical Interview Questions Part 2: Brainstorm Solutions

*This is based off of Anthony D. Mays’s technical interview question framework located here. Did some work on my own based on this and felt what I came up with also adds value.

*This article also assumes prior knowledge of data structures and algorithms

Now that you understand the question to the best of your ability, now it’s time to come up with a solution.

Brainstorm solutions and select one (Navigate the solution space to find a solution)

It’s important to note that this is not the point where you start to write code of any form. What I’ve noted during my own practice is that code, once written, tends to have a rigidity that makes the exploration process significantly harder. To keep from having this problem, it’s best to start writing the solution down and thinking about it in plain English. Writing the solution in plain English will act like a guide for you to write code. Also remember to bounce ideas off your interviewer and get them involved in the decision-making process.

These are steps that I take to try and brainstorm a solution:

  1. Come up with at least one solution that satisfies all test cases - This/These will usually be of the brute force nature. Don’t worry about space/time complexity, just solve the problem. If time becomes constrained, you’ll end up having to write this solution so it’s important to have it ready.
  2. If multiple solutions are explored, determine the practicality of each solution, strengths and weaknesses or maybe even parts that can augment other solutions - Pretty self-explanatory here. This is just choosing the best of what was come up with.
  3. Brainstorm optimizations of solutions and choose one to continue with - In coding interviews, the interviewer tends to ask a famous question after analyzing your implementation, ‘can we do better?’. This is where we try to answer that question before they have time to ask it. For algorithmic problems, this is where your Computer Science fundamentals will begin to show themselves. Choose optimization techniques to make your solution more efficient.

In all of this, make sure to bounce ideas off of your interviewer and try to get their input as you work.

As with the test cases, physically write your solution down so that you can refer to it and the interviewer can see it. This gives the interviewer the ability to follow your thought process as you code your solution and will be able to interject if they find that you are straying away from either your intended solution or the solution they envision.

In the next article of this series, we will discuss some implementation strategies to show good coding ability.

Until then, have a good one!

Top comments (0)