Table of Contents
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. Sometimes we get spoiled and use existing solutions to a problem which have complex implementations. In that case we are only thinking about the abstract or basic required knowledge in order to work with those solutions and not necessarily have an 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 but some people may find themselves creating basic applications in an office environment which 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. Sometimes it’s because of reasons other than 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 an amazing 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 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 to not 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 important 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 suggest 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/or Create Personal Project – Once your skills are refined then contributing to an open source project is not only an admirable thing but will 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 so as 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 checkout the solutions but you should try as hard as you can 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 look for ways 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 don’t forget 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.
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 of the 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.