The world of coding isn’t kind when it comes to interviews. While in many fields of employment you can rely on just flair and persuasion to sell your skills, as a programmer you will be expected to prove on the spot that you know what you’re doing. This is usually done through a coding challenge, which very often will take place in person, right in front of the interviewer(s).
It can be a daunting moment for many, but there are ways to be ready for it. In this, the first of a two-part series of articles on tech interviews, we will provide you with some general tips on how to approach and conduct a coding challenge. The next article will cover the question of how to break down the coding problem itself.
Acing an interview is a matter of preparation, experience and persistence, so practice your skills and never give up – you can do this!
#1 Keep calm
This is important for any interview, but never more so than when you’re facing a coding challenge. Our natural reaction to any situation in which we are being judged is to become nervous, hesitant and unfocused. There isn’t a one-size-fits-all solution for this problem, as different people will find that different things relax them best, but one routine that generally helps is to articulate your anxieties and then rationalize them.
When you’re feeling uncomfortable, quickly ask yourself why, or what it is that is making you feel that way. Don’t suppress your feelings, listen to them, and then try to express them in a sentence. If your gut is telling you, ‘this problem is unsolvable’, take a mental step back, and address the concern rationally: ‘If this problem were unsolvable, the recruiter wouldn’t use it’. If your gut is telling you, ‘you won’t get the job’, you can reply to yourself: ‘Even if I don’t get this job, I will simply apply for the next, with the extra experience I am picking up in this interview’. Nervousness often stems from thoughts of a worst-case-scenario echoing in your head, but most of these fears are baseless, and it becomes easier to dismiss them once you’ve worked them out in your mind.
You could be proving Euler’s theorem in your head, but believe me, nothing will make you look as clueless in an interview as just sitting there quietly. The whole point of a live coding challenge is for the interviewers to understand how you think and how you approach a problem, so for heaven’s sake speak up: if you’re going to add a supporting data structure, explain what makes it useful; if you’re opting for an iterative solution over a recursive one, tell them why; when you choose a particular approach to the coding challenge, tell the people in front of you why your option is better than the alternative(s). Even when you’re simply practicing for the interview, you should make it a habit of speaking out loud and explaining what you’re doing to an imaginary interlocutor – it will be a lot harder to do it on the spot otherwise!
As importantly, ask questions. Ask your interviewer what kind of solution they are looking for (quick, elegant, simple, exhaustive, creative?), and clarify anything that still feels ambivalent or obscure. This won’t help you alone – it will also make it easier for your interviewer to keep track, and drop hints if necessary.
#3 Practice the concepts
One question interviewers are likely to be especially interested in, is how you approach something you do not know. They will be looking for problem-solvers, not people who can reproduce material written by someone else in a textbook. Thus, expect their coding challenges to feature one or more elements of unpredictability, even if the field they belong to is one you know quite well.
There isn’t much you can do about this during the interview itself, but there is a lot you can do while preparing for it. When practicing coding problems, always put your focus on understanding the concepts that you are working with, not just on finding whatever solution works on the spot or on memorizing your way through a problem. In general, understanding the logic behind your code is one of the golden rules of good programming, and coding interviews will show you exactly why it’s so important!
#4 Have a problem-solving routine
Our next article will look in detail at how to systematically approach, break down and solve a coding problem. Even before that, however, it is important to recognize that a creative process like coding has a fundamentally individualistic element – how you work best will always come down to you. For this reason, long before you get to the interview stage, you should actively be testing out different problem-solving approaches until you find the one that suits you best.
If the method we are going to outline does not work for you, by all means consider other options as well (here’s one, for example). Even better, develop your own routine. Just make sure that by the time the interview comes round, you have a structured, tried-and-tested approach which you can fall back on when a problem appears unreasonably complicated, or simply when the interview jitters bite. Once again, you will find this a useful tool well beyond the interview process.