How to Do a Successful Coding Interview
The coding interview, be it over the phone or in person, is usually the easiest interview to fail. Inexperience with interviewing plays a key role in this failure, since the coding interview has a lot of parts, and algorithms are not the only part of the coding interview that matters. Here are some tips and tricks to help you succeed in the coding interview.
Listen to and understand the problem
It may seem obvious that listening to the problem is important, but, in addition to simply listening to the interviewer, you should note down all the key elements of the problem, and make sure your understanding is correct. If you do not understand the problem, you should ask for example input and output to get a better understanding.
You can also make sure the interviewer verifies your understanding by repeating the problem back to the interviewer, or writing down the criteria and new examples not provided by the interviewer. Extra points if these examples are edge cases, since this shows a good understanding of what can go wrong. Understanding what can go wrong is something interviewers look for since it show that you are able to adapt to real world situations.
It is important for you to note the intent of the problem from the interviewer’s point of view. If the first question appears simple, it is likely a smoke test, which is a question that should be accomplished in approximately 5 to 10 minutes. In those situations, you should note edge cases, but get to the solution quickly. As important as it is to clarify the question, it doesn’t mean you can use up a lot of time in the clarification. Being concise is important, and gathering too many requirements could prove detrimental as it may come off as ignorant. In general, you should point out problems that you see could occur, but make sure to only implement what is needed to solve the problem.
Clarity is Key
One of the most important things for you to should do is clarify. A number of candidates tend to make assumptions and jump right into coding, thinking that they know the answer to the problem immediately. Even if the answer seems obvious, walking through a solution and verifying the assumptions being made before coding indicates experience in problem solving, which is an important part of being a software engineer.
All assumptions made by you should be noted and clarified with the interviewer to make sure the assumption can be made. Behind most assumptions are design decisions, albeit obvious design decisions at times, and if you clarify the assumptions it shows that you have a better understanding of the trade-offs in a program, and the ability to design instead of just code. Design is a key software engineering role, and is something many companies interview for. For more information, see The Technical Design
Interview – A Guide To Success
After clarifying what to code, it is important for you to talk through your solution before putting it to code. This accomplishes multiple things:
- If the approach is wrong, the interviewers will often hint at better solutions before the coding begins.
- It shows the interviewer that you are able to think before they do, which gives the impression that you will do this if hired.