Framework for coding interviews
reference
Having a framework by which you approach every single technical interview greatly improves your chances of success. It can’t help you have a perfect session, but almost guarantees you will have at least a mediocre session. Think of it like military SOPs. It helps to:
- show signals that the interviewer is looking for
- reduce the probability of panicking and having a terrible interview session
- do proper time management during the interview
Very important companions to this note:
- Communication during the technical interview
- Typical coding interview corner cases for various data structures/problems
- Questions to ask before you start coding during a technical interview
- Common techniques for coding problems
As a disclaimer, this framework is what I used when preparing specifically for the Google interview process. So it is tailored for 45-min interviews, out of which the first 5 I assumed as lost for self-introductions1.
DON’T START CODING BEFORE YOU GET THE OK FROM YOUR INTERVIEWER.
00 - 05: Clarify
- Restate the problem in your own words.
- Ask clarifying questions.
- Work through input examples/test-cases. (critical: don’t start thinking about solution approaches yet)
05 - 10: Brute Force
- Figure out a brute force solution. Always make sure you get brute force correctly first 2. Discuss time and space complexity.
10 - 15: Optimize
- Optimize the solution. Discuss various approaches with trade-offs and complexities.
15 - 30: Code
Code the solution. A complete non-optimal solution is better than an incomplete optimal.
30 - 35: Test
- Test the code
- Try edge cases
- Fix bugs
35 - 40: End of interview questions
-
The amount of time you will loose on this part greatly varies with your interviewer, but 5 mins is a safe, conservative assumption. ↩
-
By no means do I mean to code the brute force (unless your interviewer asks you to). I mean to discuss a brute force solution and explain how it would work verbally. ↩
Links to this note
Before problem: Make 1 min chit-chat and make the interviewer smile. IF you’re asked, say one or two nice things about yourself, but keep it SHORT. During problem: Follow the...
LeetCode1 is the single place where one should be spending the vast majority of their time preparing for coding interviews. However, LeetCode is a vast labyrinth, and easy to get...
tl;dr; This applies to Big Tech and other companies who are applying similar interviewing strategies. - Spend 2 weeks reading “Cracking the Coding Interview” and familiarizing yourself with the process....