How to Ace Your Technical Interview

Tips and tricks to ace your next technical interview

Ace Technical Interview

It doesn’t matter if you are a fresh-out-of-school graduate or a mid-career engineer, preparing for a technical interview for your dream job can be time-consuming and nerve-racking. Imagine being expected to whip up a brilliant algorithm to solve a complex challenge on the spot, and turn that into bug-free code?

Well, worry no more. In this post, I will show you some tips and tricks to help you survive your technical interview and land your next dream job.

Before the interview

Know the scope

Let’s face it: years of study in computer science covers A LOT. If you plow through the materials without emphasis for interview preparation, you might run into the risk of spreading yourself too thin. The good news is: many companies are transparent enough to give you a broad idea of what topics will be covered in the interview. Just ask the recruiter.

Start preparation early

You owe it to yourself to give the interview preparation enough time. As a general guideline, start preparing for the interview at least two weeks in advance, especially when you have never been in a technical interview or it’s been a while since your last technical interview. Spend one to two hours per day on average. If you are working full time, be sure to set aside enough off-hours for the interview.

Why? Because it takes time to put you in the problem-solving mindset, and allow you to dust off computer science fundamentals you learned in school, which is critical to help you navigate through the interview. Once started, it might be amazing to you how much CS knowledge you need to brush up on, and you’d be thankful that you started early enough so that you don’t have to rush it through.

When I prepared for my interview at Microsoft, I started preparing for it two weeks ahead. In hindsight, I think it played an important role in my getting the offer from Microsoft. Not convinced? Here is another example: this guy literally spent 8 months preparing for a Google technical interview. This might sound a bit extreme and I wouldn’t suggest you to go that far, but you get the idea.

Key takeaway: start early enough to get well prepared.

List of books

Here is a list of must-read books for the upcoming technical interview.

Cracking the Code Interview, by Gayle Laakmann McDowell.

This book includes 150 programming interview questions and answers, as well as other advice, to give you the interview preparation you need to get the top software developer jobs.

Cracking the Code Interview

Programming Interviews Exposed, by John Mongan, et al.

From Amazon:

  • Looks at current job search and hiring processes, such as the rise of LinkedIn and other social networks as recruiting resources
  • Addresses the most important languages for a programmer to know and features examples in multiple languages
  • Includes new programming questions designed to sharpen your knowledge
  • Features all-new chapters on design patterns and sorting, including how to deal with memory constraints and mobility issues

What I personally like about this book is that in addition to advice to sharpen your technical skills, it also offers entire chapters on marketing yourself and how to start the job application process. This gives a bird’s-eye view of the whole process, which is especially valuable for those who are about to enter the market for the first time.

Programming Interviews Exposed

Elements of Programming Interviews, by Adnan Aziz, et al.

This book divides technical interview questions into separate chapters, with each chapter handling a fundamental concept of CS, like arrays, lists, etc.

From Amazon:

  • Since different candidates have different time constraints, EPI includes a study guide with several scenarios, ranging from weekend Hackathon to semester long preparation with a recommended a subset of problems for each scenario.

  • All problems are classified in terms of their difficulty level and include many variants to help you apply what you have learned more widely.

  • All problems includes hints for readers who get stuck. This simulates what you will face in the real interview.

Cracking the Code Interview

Practice, practice, practice

How do you get to Carnegie Hall? Practice, practice, practice.

Now you have taken some refresher training, and you are going to ace it in the next technical interview. Right?

Well, maybe not yet.

As many candidates can testify, being able to solve a complex technical challenge is only part of the game. During the interview, you have to be constantly talking, reasoning, and coding the solution at the same time, within the specified time frame. If you think this sounds like juggling multiple tasks, that’s because it is.

To be able to perform this mental juggling with adroitness, you need practice. Whenever possible, pick a reasonable interview question, think it through, start whiteboarding, jot down your thought process, and try to implement the solution as code. Do all this within 45 minutes to one hour.

Also, it’s preferable to pair up with one of your friends with a coding background, and have him act as the interviewer. The purpose of such a setup is to simulate the interview scene as closely as possible, so that you get a sense of what it feels like when you are in the bona fide interview. Many people have found that they take such a mock interview much more seriously than solving interview challenges alone. Also, such mock interviews help candidates reduce stress, better communicate their thoughts, and perform better overall in the real interviews.

From a Pramp user:

It’s one thing to solve technical challenges under self-directed time pressure. It’s quite another to solve it while another human being is present and waiting for you to come up with your solution.

Over the last few years, technology companies are shifting towards using online collaborative coding platforms for phone screens. Such tools allow companies to quickly assess candidates’ coding skills online, before flying them out for on-site interviews. Codidate is one such tool.

If the company you are going to interview with requires you to use such a tool for the first round, be sure to get yourself familiar with it beforehand. Also, make sure you have a reliable internet connection in a quiet place, so that the interview won’t be interrupted.

In addition, study up what’s on your resume, so that you can give detailed examples from your past projects, highlighting the change you drove, the impact you made and how it benefited the end users.

In the interview

The goal

Keep in mind that the goal of a technical interview is to have you, the candidate, demonstrate your problem-solving skills. At the end of the day, problem-solving skills play a critical role in your future job performance.

Specifically, you need to be able to analyze a problem, break it down, use a structured approach to solve it, implement the solution as code, adapt to requirement changes, make necessary trade-offs, and defend your choices with reasonable explanations. This is a problem-solving framework you can use in the interview.

Equally important is to make sure you maintain effective communication with the interviewer, throughout the entire interview. Think out loud when you are doing the analysis, working on the solution, testing the code, etc., so that the interviewer can follow your line of thinking and it keeps both of you on the same page.

Analyze the problem

The moment you are presented with the problem, it’s tempting to show your ambition and skills by diving right in. Resist that. Instead, make sure you fully understand the problem first, it’s constraints, edge cases, etc. Whenever in doubt or you need clarifications, ask the interviewer validate your assumptions. For example, “Do I have access to the C++ STL?”, or “Can I use recursion for this problem?”

You can also enumerate a few cases and have the interviewer confirm that your understanding is correct. For example, “I think there are 3 elements in the array after this step. They are a, b, and c. Correct?”

With a solid grasp of the problem at hand, you are ready to tackle it.

Break down the problem

Rarely can a problem be solved in one single step, especially real world problems. Many seemingly challenging problems become much more approachable once broken down into sub-problems. If you are able to do this, chances are you will be able to solve each of the sub-problems, and combine them into a final solution.

Coding the solution

Once you feel you have arrived at a solution in your mind, it’s time to piece it together as code. You can try to implement it using the programming language you are most comfortable with, many companies are ok with that. But again, ask the interview before moving on.

Some companies, like Facebook, expect candidates to write big-free code in the interview. If you happen to be in such a scenario, do pay close attention to edge cases. Make sure your algorithm works for all the edge cases, before you submit the solution.

If time/space constraints are imposed on the solution, make sure you meet such requirements too. If you are able to come up with a working solution without any optimization, you can implement it first, and revise it later to meet the time/space requirements.

Adapt to requirement changes

A common mistake made by many candidates is that they tend to assume that all they need is to crank out a working solution in the entire one hour interview, therefore they spend too much time working on the first problem presented by the interviewer. But that is often not true. Many times after the candidate completes the first challenge, the interviewer will present another more advanced question, possibly related to the previous one, to further test the candidate’s problem-solving skills.

For example, here is a series of coding challenges:

  • Interviewer: implement an algorithm to sort an array of objects.
  • Candidate: … done.
  • Interviewer: what if the array is 10GB in size, and the physical memory is only 4GB?
  • Candidate: … done.
  • Interviewer: what if the array grows beyond the hard drive’s capacity?
  • Candidate: … done.

Keep in mind that there might be more challenges coming after the one you are trying to solve, so once you are confident your solution is correct, get ready to move on. The more challenges you solve, the more impressed the interviewer will be.

Resources

Here is a list of online resources: