Is there anything more intimidating than live Coding in front of someone during an interview? I think not.
I used to be so frightened of live coding interviews. So much so that, for a while, that’s what prevented me from finding a new job. I didn’t want to have to study complex algorithms and computer science "riddles" that nobody uses in their day-to-day job just to land a new role.
This just didn’t feel like an efficient use of my time when I could be grinding away at real-world projects instead.
Eventually, I bit the bullet and started applying for new roles, knowing very well that the Coding Interviews could not be avoided. Practicing SQL Leetcode problems each day definitely did help, but there’s so much more to them than knowing the language.
At the time, I didn’t quite realize what makes one candidate stand out from another in a coding interview. Now, I perform them at my current company and see a huge difference in the candidates I pass and those that don’t make it to the next round.
Here’s how you can pass your coding interviews:
1. Prepare ahead of time
This may seem so simple but you’d be surprised how many people don’t review the different types of Sql functions or proper Python syntax. It’s ok to not know everything (we have Google after all) but at least show you’ve tried to prepare.
The week before your interview, spend at least an hour each night working through practice problems and googling along the way. You may feel like you’re failing by searching for answers, but really you are just helping to teach yourself.
It’s a more efficient use of your time to find the solution you are looking for rather than racking your brain for something you won’t properly remember anyways.
In addition to practice problems, brush up on functions that are most popular in whatever language you are using. For SQL, be sure to know the differences between COUNT and SUM as well as have familiarity with window functions that could help you solve a problem more efficiently.
With Python, study key concepts such as arrays, lists, and dictionaries. These almost always show up in coding interviews so be sure you know their functionality well.
2. Clarify assumptions
Lots of times candidates will dig right into a problem, making certain assumptions, without clarifying them first. You don’t want to assume one thing and work out the entire solution only to find out that was the wrong assumption.
I’ve experienced someone coding through an entire problem, not talking through what they were doing, only to be totally off base from what I was looking for.
If you have to calculate retention or conversion rate, clarify the formula with the interviewer before coding the problem out. If you’re assuming certain edge cases don’t apply to your function, let the interviewer know. The more communication the better!
This will save you time, which can be valuable if the company is judging you on how many questions you can get through.
3. Talk through what you’re doing
To reiterate, talk talk talk! The more communicating you do, the more the interviewer understands your thought process. The more they understand your thought process, the more they understand where things went wrong.
If you’re getting the problem wrong but not communicating how you’re thinking about it, it’s easy for the interviewer to get lost and assume you simply don’t know what you’re doing.
When you’re communicating and something goes wrong, it’s easier to pinpoint where the mistake occurred and to easily fix it. In the end, this will save you time in working through difficult problems and prevent you from getting stuck.
Even if it seems obvious to you what you’re coding, talk about it! You can’t always assume your tactic to solve the problem is the most straightforward. There are always multiple ways to solve a problem and your way may not be someone else’s way.
4. Ask questions if you’re unsure
Don’t be afraid to ask questions! Whoever is testing you realizes that Google is an integral part of an engineer’s job. We can’t remember every syntax, function, and formula to every exist! If you know what function you are trying to use, but forget the exact name, ask.
For example, in one of my Python interviews, I needed to use the function that made a string all lowercase. I forgot whether it was is_lowercase() or lowercase(), so I asked the interviewer. He was also unsure and quickly searched for the right function for me to use.
If I hadn’t asked I could have been struggling for ten minutes trying out different names for something so simple. Interviewers aren’t testing you to see if you can remember every tiny detail of a language. They want to understand how you think about and work through difficult problems.
Don’t fret the small stuff like remembering the exact function name. If you aren’t 100% sure, just ask.
Conclusion
We put way more pressure on ourselves for coding interviews than we have to. Don’t fear them. Look at them as a challenge to stretch your way of thinking and learn something new. If you communicate clearly, then you have a good chance of passing even if you don’t get every problem right.
I’ve been shocked to hear that I’ve passed certain Python interviews when I couldn’t solve an entire problem in a way that was most efficient. However, I practiced all four of these tips and that in itself made a huge difference. Employers want to hire someone with good critical thinking skills and the ability to communicate the issues they are running into.
If you need help preparing for a SQL interview be sure to check out Top Skills to Ace Every SQL Interview Question and How to Use SQL Window Functions.