Pass a Coding Interview
So you’ve been sending out applications for coding jobs and you finally landed an interview. Good job! This is a big accomplishment, but the next step is the coding interview. This is usually a series of problems that you’ll have to work out on a whiteboard in front of one or more interviewers to assess your problem-solving skills. If this sounds nerve-wracking, you’re not alone! Most coders find this interview tough, so good prep is key. Luckily, with the right preparation and interviewing steps, you can nail the interview and land the job.
Contents
[hide]Steps
Studying for the Interview
- Review some computer science fundamentals. It’s never a bad idea to start with the basics. Even if you’re an experienced coder, you can still forget some fundamental principles, and these basics could help you work out problems and avoid silly mistakes. Start by reviewing some of those basic principles to rebuild your foundational knowledge.
- If you took computer science in college or high school, try digging out the notes you took for a good refresher.
- You can also try checking out some computer science textbooks from the library to get a good grasp of the fundamentals.
- There are also many websites and videos dedicated to coding, and many are run by professional coders. These are great sources for basic and advanced information.
- Prepare to use the coding language that the company tells you to. There are many different languages used to write programs and make websites, like Python, C++, Java, JavaScript, HTML, and more. Some companies have a preference and will tell you that you have to use a particular language during the interview. If they tell you which language they prefer, then be ready to use that one.
- Some companies might give you a list of a few different choices for which language to use.
- Even if the company doesn’t tell you which language to use, try investigating the company to see if they usually work with a specific language. A quick internet search might give you this information if you type in the company name and "coding language." You can also look at the file extensions their website uses (.php, .asp, etc.) to figure out what they use. Using the company's preferred language could make a good impression during the interview.
- Work in the language you’re most comfortable with if you have a choice. Some companies don’t make you use a particular language. In this case, choose the language that you’re most comfortable with. This way, you’ll be ready to work quickly and under pressure without making silly mistakes.
- Remember that different coding languages have strengths and weaknesses. It’s best to be familiar with a few different ones so you can switch and use the right language for the right problem.
- Memorize common algorithms and data structures. At their core, most coding interview questions use a limited number of algorithms and data sets. A good way to prep is review the most common and popular algorithms and data structures so you’re comfortable using them during the interview. That way, you can easily identify the problem and start working out a solution.
- During coding interviews, you'll often have to discuss what the trade-offs are with the algorithm you chose, how fast it would work, and how you might improve it.
- Algorithms are like sets of rules or procedures for solving complex problems.
- Some common data structures include hash tables, trees, sorting, and graphing. It would also be helpful to review some basic math as well.
- Data structures are the building blocks of most programs.
- Practice writing out code on a whiteboard. This might sound obvious or silly, but you might be surprised how weird it feels to write on a whiteboard if you’ve never done it before. This is a common way that interviewers ask you to work out problems, and you could easily get tripped up during the interview if you’re not used to it. Getting a small whiteboard and practicing on it is a good investment and can help you stay calm during the interview.
- The company you’re interviewing with may give you a schedule or layout for the interview ahead of time. Even if the schedule doesn’t say that you’ll use a whiteboard, practicing on one is still helpful so you don’t get caught off guard.
- Do mock interviews with someone else. If you’re not used to speaking in front of other people, then the interview can be nerve-wracking. Get comfortable working out problems for people by having your friends or family do mock interviews with you. Work out problems on the whiteboard and let them ask you questions so you’re ready for anything.
- If the company gave you a list of concepts or problems to study, have your partner ask you to work these out. This gives you a good preparation for the actual interview.
- Also ask your partner to discuss with you the code you built. For more skilled positions, you might even want to discuss how your solutions could plug into a bigger system.
- Research the company you’re interviewing with ahead of time. It never hurts to know as much as possible about the company or companies you’re interviewing with. You can learn about their company culture, goals, coding styles, and expectations. This can all help you prepare and ace the interview.
- Try looking online for interview questions or stories for each company you’re interviewing with. Insight from people who have gone through the process can be a big help for you.
Working Out Problems
- Stop and think before you start writing. You’ll probably be nervous and jittery during the interview, so it’s only natural to start working out the problem right away. But in most cases, this isn’t what the interviewers want you to do. They’re looking for someone who will try and understand the question or problem before they start writing. If you rush into it, you could make mistakes or look careless. Take a minute to understand what you’re being asked first.
- Don’t be afraid to say something like, “That’s a great question, let me think about it for a second.” This buys you time and shows the interviewer that you want to understand the problem before jumping into it.
- This goes for remote and phone interview as well, if this is how your interview is done. You might feel like you have to start talking right away, but feel free to take a minute and think.
- Repeat and define the problem that the interviewer gives you. Before you start, confirm that you understand the question being asked. This makes a good impression and shows the interviewer that you’re trying to fully understand the problem. Be explicit and repeat the question as you heard it and ask if you’re correct.
- Don’t repeat exactly what the interviewer said. Rather, say the question as you understand it. This shows greater understanding of what you have to do.
- Say something like, “So, it sounds like you want me to write a function to output a string of integers, is that correct?”
- Don’t be afraid to ask for clarification if you don’t understand the question. Saying, “I’m sorry, I’m not sure I caught all that. Could you repeat it?” shows that you’re being attentive and gathering information.
- Ask relevant questions to understand more about the task. While you might feel like asking questions makes you look uninformed, many interviewers actually want you to ask questions. These questions show what your thought process is, which is a very important part of the interview. Feel free to ask about the limits or constraints on the problem so you understand the requirements.
- This is especially important if the question is a bit vague or ambiguous. The interviewer may have done this on purpose to see what kinds of questions you ask. Say something like, "Okay, I can work that out, but what constraints should I know for this problem?"
- Interviewers might be able to provide more guidance than you think. Always listen to their answers to catch any hints they’re giving you.
- Confirm that the assumptions you’re making are correct. You’ll always have to make a few assumptions when you’re coding. The problem is identifying which assumptions are the right ones. Always verbalize the assumptions you’re making and ask if they are correct. This shows the interviewer that you aren’t making uninformed choices.
- For example, you could say, "I'm assuming you don't want a loop built into this equation, otherwise the code will go one forever. Is that correct?"
- Companies often say that it reflects badly on candidates who make assumptions without checking first. The wrong assumptions could ruin an entire code and cost a lot of time and money to fix.
- Identify the algorithm or data solution you’ll use for the problem. Once you’re ready to start writing the solution out, start by deciding on which algorithm or data structure you’ll be using to solve the problem. This gives you a good path and guideline to work the problem out. If you’ve studied your algorithms ahead of the interview, you should have a whole list to choose from.
- Remember to state the algorithm out loud so the interviewer knows where you’re going with your solution.
- There are probably multiple choices for which algorithm or data set to use. This is fine, and it’s a normal part of coding. There are always multiple answers, so use the one that you’re most comfortable with.
- Show your whole process of working out the problem. The interviewers are at least as interested in seeing your thought process as they are in seeing your final answer, and probably even more so. The way you work out problems is a major part of the type of coder you are, and this helps the company decide if they want to work with you. Write all of your work on the whiteboard or computer so the interviewer sees your whole process.
- It’s possible to get the answer wrong but still make a good impression if you’re using a logical and clear thought process.
- Remember to ask questions at any point if you have to. You don’t have to stop asking questions just because you’ve already started working the problem out.
- Explain all of your thoughts out loud. Keep talking while you’re writing and walk the interviewer through your process. Really show the interviewer that you’re thinking about the problem and be explicit about all the steps you’re taking. It can also help to explain why you chose this solution over other solutions.
- If it helps, try to imagine that you’re a teacher and the interviewer is your student. Talk them through the problem-solving process.
- Simple explanations to guide the interviewer alone include, "So you see right here I'm putting together a stream of integers. This is how I'm starting to build my data set for the algorithm."
- This is especially important for remote interviews, where the interviewers might not be able to see what you're doing clearly.
- The interviewer might ask further questions based on your thought process. Be ready to address these or explain yourself more.
Making a Good Impression
- Show enthusiasm for the job and the company you’re interviewing with. This isn’t related to your coding skills, but it’s an important part of your interview. Companies want to know that the people they hire are a good fit, and they might hesitate to hire someone who seems uninterested, even if they’re a good coder. Show excitement and enthusiasm about being there to show the interviewers that you’ll work well in the role.
- Remember to make eye contact, speak clearly, and use expression in your voice. These are all good ways to show enthusiasm.
- Keep this enthusiasm going no matter who you talk to. Whether you’re checking in with the receptionist or speaking with the CEO, these people all represent the company and could have an opinion in whether or not you’re hired.
- Give examples of times that you've collaborated with a team. While coding can seem solitary, in reality it’s very collaborative. If you can’t work well with others, you probably won’t get hired. Show that you get along with people and can work in groups. This all makes you a stronger candidate.
- Communicating well with the interviewer is a huge part of showing your teamwork skills.
- It helps to have a few stories prepared about when you had to work in or lead a team. This is a concrete example of your teamwork skills.
- Remain calm during the interview, even if it gets tough. Depending on the company you work for, coding can be a high-pressure job with tight deadlines and high expectations. Companies are looking for candidates who are not only good at what they do, but can handle the pressure. The interview might be tough, but do your best to stay calm and avoid getting flustered.
- It might be tough, but continuing to smile and act politely is possible even if you're feeling overwhelmed.
- Don't be afraid to pause for a minute and take a few deep breaths if you're getting flustered. If the interviewer asks if you're okay, it's fine to say "Yes, I'm just taking a minute to think about what I'm doing next."
- Accept feedback from the interviewer to show that you're a team player. Since teamwork and collaboration are important parts of being a coder, always treat your interviewer like someone you’re cooperating with. Be confident, but don’t act like you know everything. Instead, be willing to listen to the interviewer and accept their feedback, even if it’s critical. Taking criticism well can make you look very good to the interviewer.
- Even if you don’t get the job, the feedback from interviewers could be a big help for future interviews.
- Explain how you practice and improve your coding skills. Coding changes constantly, and even professionals need to keep their skills sharp. Your interviewer may ask how you practice in your spare time. Have a few examples of activities you do to improve your skills to show that you’re dedicated to the profession.
- You might build websites or apps as a hobby, or do digital classes to stay up to date. All of these are good ways to show your dedication to improving.
Tips
- Remember that almost all coding problems have multiple solutions. Some are better than others, but you can find the solution in many different ways.
Warnings
- Never make any assumptions about the problem you're solving without asking! Most interviewers will count that as a huge strike against you.
- The interviewers may ask you demonstrate skills that you said you had on your resume, so never lie on your application. You could end up getting exposed in the interview.
References
- https://www.freecodecamp.org/news/coding-interviews-for-dummies-5e048933b82b/
- https://www.freecodecamp.org/news/coding-interviews-for-dummies-5e048933b82b/
- https://www.freecodecamp.org/news/coding-interviews-for-dummies-5e048933b82b/
- https://youtu.be/k2irIS1dk4I?t=81
- [v161479_b01]. 21 July 2020.
- [v161479_b01]. 21 July 2020.
- https://www.mtu.edu/career/students/networking/interviews/prepare.pdf
- [v161479_b01]. 21 July 2020.
- https://youtu.be/k2irIS1dk4I?t=224
- https://youtu.be/k2irIS1dk4I?t=248
- [v161479_b01]. 21 July 2020.
- https://sites.rmit.edu.au/csit-careers/2018/11/25/the-ultimate-guide-to-smash-your-coding-interview/
- https://www.indeed.com/career-advice/interviewing/coding-interview-questions
- https://www.freecodecamp.org/news/coding-interviews-for-dummies-5e048933b82b/
- https://www.mtu.edu/career/students/networking/interviews/prepare.pdf
- https://www.mtu.edu/career/students/networking/interviews/prepare.pdf
- https://sites.rmit.edu.au/csit-careers/2018/11/25/the-ultimate-guide-to-smash-your-coding-interview/
- https://www.mtu.edu/career/students/networking/interviews/prepare.pdf
- https://youtu.be/k2irIS1dk4I?t=81
- https://youtu.be/k2irIS1dk4I?t=341
- https://www.mtu.edu/career/students/networking/interviews/prepare.pdf
- https://triplebyte.com/blog/how-to-pass-a-programming-interview
- https://sites.rmit.edu.au/csit-careers/2018/11/25/the-ultimate-guide-to-smash-your-coding-interview/
- https://sites.rmit.edu.au/csit-careers/2018/11/25/the-ultimate-guide-to-smash-your-coding-interview/
- https://sites.rmit.edu.au/csit-careers/2018/11/25/the-ultimate-guide-to-smash-your-coding-interview/
- https://www.indeed.com/career-advice/interviewing/coding-interview-questions