Problem-Solving Framework for Technical Interview Questions Part 1: Understanding the Problem
Tags: career
Published: 2020-05-25 18:28:57

<em>*This is based off of Anthony D. Mays’s technical interview question framework located [here]
(https://anthonydmays.com/blog/2017/01/04/interviewing-at-google-heres-6-things-you-absolutely-need-to-do/). Did some work on my own based on this and felt what I came up with also adds value.</em>

<em>*This article also assumes prior knowledge of data structures and algorithms</em>

Technical Interviewing can be quite intimidating. It calls upon skills that many Software Engineers may not have nurtured and is far removed from their day-to-day work. One of those major skills is the ability to answer technical interview questions. These are usually algorithmic-based (though this is not guaranteed) and tends to be of a very theoretical nature. When answering a Technical Interview Question, there are two attributes you are trying to put on display:

<ol>
<li>Display a trained, repeatable and systematic process of solving technique questions of any form.</li>

<li>Display a favorable understanding of Software Engineering skills and techniques during the course of solving the question.</li>
</ol>

A lot of the time, even as an experienced Engineer, answering these questions are non-trivial and improperly leveraging the given information can lead to a ‘failing grade’ for the interview and cost you that job opportunity.

This framework is an attempt to simplify the collecting and leveraging of that information.

The framework has 4 main parts:
<ol>
<li>Ensure you understand the problem (Define the solution space)</li>
<li>Brainstorm solutions and select one (Navigate the solution space to find a solution)</li>
<li>Implement solution</li>
<li>Test your implementation</li>
</ol>

<h4>Ensure you understand the problem (Define the solution space)</h4>

This is probably the easiest thing to get wrong and doing so costs precious time which you may not be able to recover from. The framework’s primary purpose is to standardize the collection of information from the question so that you can make the best decision. At the end of this process, what is produced is a list of tests that both you and your interviewer can agree on.

The test cases themselves serve two crucial purposes. It validates to your interviewer that you understand what the problem requires but most importantly it helps reduce the solution space. The tests act like a border that helps define the solution space and so in essence, the problem now becomes writing a solution that solves all the test cases. While technically not true, this makes the mental gymnastics of solving the problem significantly easier to manage. Please note that it is recommended that the tests be physically written out to be able to refer to them later and so that your interviewer can see them.

This is the process I use to accomplish this goal:

<ol>
<li>Repeat the question aloud in your own words - This helps ensure you understand what the question is asking of you and communicates your understanding or misunderstanding to your interviewer.</li>

<li>Ask clarifying questions and check assumptions - This is where the bulk of the data-gathering happens and helps show you know how to reduce ambiguity in a given assignment. Here is some basic information to start gathering:

<ul>
<li>Clarify intended input</li>
<li>Clarify intended output</li>
<li>Ask about edge cases</li>
<li>Ask about performance constraints</li>
</ul>

From these questions, other clarifying questions are likely to come up which will help flesh out your understanding of the problem. Please feel free to add other questions based on your own experience and knowledge.</li>

<li>Use real examples and validate your understanding - This is where the test cases are produced. For each clarification, you’ll likely be able to create a test case or integrate that case into another test case. The test cases do not need to be formal but need to be valid so they can effectively test your solution.</li>
</ol>

In the next article of this series, we will discuss using this information to brainstorm solutions.

Until then, have a good one!