Five Quick Tips On How To Pass A Coding Interview
Coding interviews can be a challenge for even the most veteran developers. For new developers they can be a downright nightmare. Sitting in front of a whiteboard while six or seven people stare at you can be intimidating. Especially if you're stuck on a problem. Unfortunately software developers need to study for their interviews.
Even though coding interviews can be scary I have a few quick tips on how to get through them. There is a lot of material to cover in the world of coding interviews. Whole books have been written on how to get through them. Just keep in mind this is just a few quick tips.
A word of warning, I'm assuming that your interview will requires some sort of whiteboarding and or algorithm problem solving. As Joel Spolksy famously wrote, employers want employees who are 1. Smart and 2. get things done. And according to Spolsky one of the best way to find out if someone is smart is to test their knowledge by having the candidate complete whiteboarding and algorithm problems.
That being said, many employers, especially smaller organizations, reject this idea completely. Hiring practices at these places usually consist of a combination of take home or on-site tests and one-on-one question and answer with a technical interviewer. Occasionally they may even have the candidate participate in pair programming with members of their team. Most will skip the algorithm questions completely and shy away from whiteboard questions.
I'm not here to debate the merits of either approach. For the sake of this post I'll assume you'll be interviewing at a more traditional algorithm and whiteboarding interview job. These interviews are fairly typical at larger organizations, like Google or Amazon. They usually consist of multiple phone and on-site interviews. You'll meet with one or more teams of developers and the heart of the interview will be a coding challenge with one or more algorithm challenges.
Below are the five steps on passing a coding interview.
1. Study Every Day
This may seem obvious at first, however, you'd be surprised the amount of developers who don't do any studying before their interviews. Yes, their will always be people out there who can ace any interview they go on. Those people are the outliers. For the rest of us mere mortals, taking at least an hour a day to study is a good idea.
The key is to be consistent. Practice about the same time every day. Keep a notebook, or online journal, on what topics you covered and notes on how you solved each problems. That way you can look back through it before your interview so everything is fresh.
When studying problems and algorithms try to dig a little deeper. Try not to memorize the solution but how to come up with the solution. There are thousands of coding interview problems out there. The chances you'll get the exact same question that you studied will be slim. On the other hand, if you understand the deeper concepts behind the problem you'll have a much better chance of identifying what algorithm to use on a real interview question.
Give yourself at least a couple weeks to study. My suggestion would be 15-30 hours of studying depending on your experience. If you study about an hour a day that would be about two to four weeks.
2. Practice On a Whiteboard
Try to replicate the environment you'll be in when you do an interview. Practice interview problems on a whiteboard. It doesn't have to be a real whiteboard of course. Get out a piece of blank white paper, find a quiet place and start writing. Don't use a computer, don't use any help, just find a problem and start writing.
Begin by writing out some quick pseudo code. Employers love this and it will help you flesh out the real code. After you are satisfied with your pseudo code begin on the real code. Don't worry about syntax, you can go back later. Work through each step. Talk to yourself as if you're in a real interview.
Keep in mind, during a real interview, it's not always the best idea to talk out every little thing you write. It's best to summarize what your doing, and explain it AFTER you write it. Do the same during your practice whiteboarding. In a real interview most employers will give you hints a long the way if you get stuck.
This is certainly something I wouldn't do everyday. A few times before your interview should get you in the right mindset.
3. Practice Algorithms on Pramp.com, Interview Cake, Cracking the Coding Interview...
You're probably thinking right now what resources you'll need to start doing these interviews. Well luckily, via the power of the internet, you have at your disposal thousands of algorithm problems. LeetCode seems to be one of the more popular places. Career Cup is another.
If you're looking for a little more hand holding Pramp.com is an excellent resource. For free you'll be paired off with another developer. Each of you will be given an algorithm problem and you'll take turns interviewing each other. I've tried this a couple of times and it really worked out well.
Interview Cake offers many free algorithm problems and it offers an online course with more 1-on-1 feedback to help you get that job. It has a 30 day money back guarantee.
No blog post on coding interviews isn't complete without mentioning Cracking The Coding Interview. This book has been an Amazon best seller for years in the programming space. This a great book and is a good read if your looking for some more in depth knowledge on the type of problems you'll see in coding interviews.
4. Find a Coding Buddy
This might seem difficult at first- really all you need is to find someone who is willing to do a mock interview with you. They don't even have to be technical. Just have them sit their and nod their head while you try to explain some algorithm your doing on the whiteboard. If they don't completely understand that's fine. You never know, they might even have some valuable feedback you can use.
In an ideal world you could find someone who is either a senior developer or someone else looking for a job and you can quiz each other and do mock interviews. This just doesn't happen that often.
5. Expect and Accept Failure and Keep Trying
I wish I could tell you that by following these five quick tips that your guaranteed to land your dream developer job. The real world is a lot more complicated. You should expect and accept failure. As hard as it seems at the time you'll probably fail on your first interview. Their is just so many variables that you can't possibly predict. You may have nailed the algorithms but maybe you're not the right fit with the team. Maybe the employer already has a more qualified candidate in mind. Or maybe you did nothing wrong, and they just changed their mind.
The most important thing to keep in mind is that you're not a failure. The interview was a failure, that may or may not have been a result of your actions. The best thing to do is try to take a way a few things you learned, write them down and prepare for the next interview. It's a lot easier said then done, I know. Also, if you can, try to stay positive. It's easy to blame the interviewer, when you don't get a job. It's a lot harder to look at yourself and figure out why things didn't work out.
One of the best ways to prepare for an interview is to already have done a few interviews. Just keep trying, you'll get better, and you'll eventually get that job. Remember we've all been rejected at some point or another.
This post could have easily been another few thousand words. I didn't even mention any soft skills. From building a personal brand, to knowing someone at the company your applying for can also help. I'll save that for another day.
If you like the post subscribe below to get more information about programming, development and career advice!