Key Takeaways
- Coding interview practice is crucial for success in software engineering roles.
- It’s normal to fail coding interviews, and many experienced engineers do; preparation can help mitigate this.
- Key steps for preparation include getting a formal education, practicing coding skills, and studying algorithms and data structures.
- Engaging in open-source projects and doing mock interviews enhances practical experience and readiness.
- Overall, consistent practice and learning from failures improve performance in coding interviews.
Introduction
The importance of coding interview practice cannot be understated. Many who work in the tech industry understand that some jobs require vigorous preparation and the will to get through the interview process. Landing a career as a software engineer has several prerequisites, such as a formal education, a great resume, a personal project to list in your portfolio, and countless hours of interview preparation and practice.
Fortunately, books are available to help with the interview preparation process. One notable book is Cracking the Coding Interview by Gayle Laakmann McDowell, which has been the standard go-to book for coding interview preparation for years now. In addition, many other sources around the web have all sorts of tips and practice questions to help refine your skills to ace the interview.
Why Practice or Prepare?
Some of you may be wondering what the point of coding interview practice is if you’re already seasoned veterans, and the answer is simple. Coding interviews are stressful, and generally the pressure of someone watching your every move in your day job is non-existent. We all perform differently under pressure, and coming up with an algorithm that solves a problem on the spot takes practice.
Some jobs may be easier in nature than others and not touch on the more complex points of software engineering, such as creating the most optimal algorithm to analyze genetic data in the quest to fight cancer. Occasionally, we get spoiled and use existing solutions to a problem that have complex implementations. In that case, we are only thinking about the abstract or basic required knowledge to work with those solutions and not necessarily having intimate knowledge of their inner workings.
This is why it’s important to practice and challenge yourself regularly. Granted, some people may land jobs that require this sort of complex thinking all the time, and that’s great. However, some people may find themselves creating basic applications in an office environment that do not require as much complexity when crafting and analyzing complex algorithms.
It is Normal to Fail a Coding Interview

I cannot stress this point enough. It is absolutely normal to fail a coding interview. There are many reasons for it. Even the smartest software engineers in the world fail coding interviews. Occasionally, it’s because of reasons apart from our technical prowess. Other times it’s due to lack of preparation. When the best software engineers for a given role don’t make it through the interview process, it’s considered a false negative. When you fail a coding interview, that doesn’t mean you aren’t capable of being a wonderful software engineer. Rather, it’s possible you’ve never practiced the given problem, are nervous, haven’t engaged in previous coding interview practice at all, or are perhaps just a little tired. The list of reasons for this is vast, and more details can be found in Cracking the Coding Interview. I also suggest reading this article about failing these interviews, as it gives you great perspective and will encourage those who fail not to give up.
Success consists of going from failure to failure without loss of enthusiasm. – Winston Churchill
Coding Interview Preparation
At this point, you probably understand that preparation is critical. Thus, I have outlined some important steps below to help you prepare for any future coding interview. These steps apply to everyone, regardless of years of experience. If you have already completed an item on the list before getting started, congratulations! That just means you have a head start. Even so, don’t rush through these and take your time. Following these steps will ensure optimal coding interview practice and preparation.
- Get a Formal Education—This is a highly contested and debated idea, but the truth is in most professional settings you are going to need a college degree to get your foot in the door or advance. This is why I suggest getting the proper formal education in computer science.
- Practice Your Coding Skills—It is essential to understand the basics of programming, especially anything object-oriented. Keep in mind, during your formal education you may have had extensive practice, but the idea here is to have a decent foundation before moving on to more advanced tasks. Thus, start coding simple projects to ensure you thoroughly understand all the basics. I also recommend going through the book Code Complete, Second Edition, by Steve McConnell, as it will give you many best practices that you may not learn elsewhere.
- Brush Up on Math, Algorithms, and Data Structures—You may have already gone through this in your formal education, but refresh yourself on these topics. For math, practice algebra and calculus. I’d also look into Discrete Mathematics and Concrete Mathematics. Afterward, reading a good book on algorithms and data structures is a great idea, such as Algorithms, Fourth Edition, by Robert Sedgewick, which has a great companion video series that I highly recommend (you can buy the book and video series together). Another great book is Analysis of Algorithms by Jeffrey McConnell. Keep in mind that data structures will be discussed in these books, as they are at the heart of most important algorithms. You can always study data structures separately if desired.
- Contribute to Open Source and Create a Personal Project—Once your skills are refined, then contributing to an open-source project is not only an admirable thing but will also give you experience working with an already established code base. You’ll be able to see how some of the best software engineers in the world structure their code and discover any coding standards or style. Another great idea is to create your own realistic but ambitious project from the ground up. This will demonstrate ambition and desire; this really reinforces your learning.
- Read Cracking the Coding Interview and Practice Interview Questions—Now that you have more experience, it’s time to study for the real thing to do the best possible in any coding interview. Start with reading the book Cracking the Coding Interview and do all the practice questions without cheating by looking at their solutions. If you get stuck, then check out the solutions, but you should try as hard as you can to be the first to solve the problems. This will give you great practice for the real coding interviews. Once you feel you’ve solved the problem, compare your implementation with the solution in the book and investigate how to optimize it. Next, search the internet for other coding interview questions and practice those. Have your friends give you mock coding interviews and get comfortable coding on the spot in front of someone on the computer, and please keep in mind the whiteboard. Something else to note: Cracking the Coding Interview has some tips about preparing for these interviews, so I suggest not skipping that section. Some of the advice I’ve given here can be found in the book, but I’ve added my personal spin on the subject.
Conclusion
Coding interviews aren’t easy by design. Even the most talented software engineers fail these interviews. Regardless of experience, coding interview practice is essential for success. Prepare to fail some of these interviews and learn from your mistakes. Each time you interview, you will get better and better.
However, before applying to jobs and potentially landing an interview, ensure you have practiced extensively and prepare your brain to solve some complex problems found in these coding interviews. You are more than likely going to get a question you’ve never solved before, but your prior practice should make the transition from problem to solution much easier.
If you fail, do not stop! Failure in this case is when you give up. Instead, ask for honest feedback and give yourself a personal assessment. Figure out how you can improve moving forward and practice some more. In time, you will get your dream job.
