When I would sit on hiring loops at Facebook and Microsoft, my fellow interviewers and I were looking for certain “hireable signals” from the candidate. These signals are very concrete. They may vary from company to company, but in the coding interview, they look pretty much like this:
- Coding competency
- Problem-solving ability
- Ability to ask clarifying questions
- Ability to explain one’s thought process
In this sense, your job as a candidate is straightforward: how do I send enough hireable signals to my interviewers during the loop… and to do so as quickly as possible?
To help you prepare confidently, I want to share 5 steps to help you make the most of your limited time during the perfect coding interview:
1) You ask the right clarifying questions at the start of the loop
The goal here is simple: Understand the intent behind the interview question.
On a practical level, this is your opportunity to identify the pattern behind the question you are being asked, which will enable you to identify the correct solution more quickly.
Sometimes interviewers will deliberately leave out key details when explaining the problem. They do this because they actually want you to ask clarifying questions. If you fail to ask those clarifying questions at the top of the interview, you may run into issues or have to redo work later on.
2) You propose a few possible solutions
Every second counts in a coding interview. However, you can set yourself up for success beforehand with strategic preparation.
Once you understand what the problem is really asking, you can efficiently triage possible solutions. That is to say, if you understand the pattern underneath the problem, you can quickly zero in on a small set of possible solutions.
I call this “reducing your solution space.” This is actually a skill you can learn with the right practice.
3) You try a solution (and write the code)
Once you fully understand the problem and know how to structure your solution, writing the code is the easy part — as long as you are comfortable coding in the language of your choice.
Most solutions in a coding interview should be no more than 5-10 lines.
4) You test your code
A lot of people miss this step. Do not miss this step. Run through examples to validate your solution.
Taking the time to test your code is important for many reasons. It shows that:
You can code competently
- You have established the habit of testing your code
- You validate your basic inputs
- If you encounter a bug, you can fix it
- You can evaluate the merits of different solutions
5) You are able to talk through your thought process
We see candidates “copy and paste” solutions from memory all the time. I don’t recommend this approach. A calibrated interviewer will catch you every time.
Even more importantly, this “copy and paste” approach does not work at scale. It’s simply not possible to run through thousands of practice problems in order to memorize them all (and it’s definitely not how the most successful developers prepare).
So what’s the best way to prepare yourself for the big moment? I recommend a pattern-based approach to coding interview prep, which is exactly why we created our new Grokking Coding Interview Patterns course.
It was designed to help make pattern recognition automatic. Think of yourself as an Olympic table tennis player who decides in milliseconds what kind of shot they will use. It’s all about building the muscle memory you need to be successful in a lightning-fast coding interview loop.
I hope the “perfect” coding interview loop feels more in reach. I am confident that you will be sending hireable signals to your dream company in no time. It just takes strategic, structured prep.
Happy learning!