There may be a way to design an effective interview process where candidates don’t have to prepare for the interview while companies still get the information they need to make effective hiring decisions. But no one has yet come up with such a process that scales to the needs of large companies. So we have the current state of affairs, where programmers need ways to prepare for interviews.
One justification for interview preparation is that the type of programming that people do for their jobs differs from the type of programming required for algorithmic coding interviews. So programmers prepare by practicing common algorithms that they may have forgotten from their student days. But even if your job is algorithmically oriented (maybe you’re implementing algorithms and data structures for a language library) interview-specific practice still helps. This is because practicing coding for interviews is inherently different from coding as part of your job.
When you’re writing software to be used by customers, you have limited time for activities that don’t directly contribute to finishing the project and getting the result into customers’ hands. Once you implement a solution that meets requirements like correctness, performance, and code quality, you’ll probably need to move on to the next work item. This differs from coding for practice, where you can spend more time on a solution to learn more about how it works, or try alternate solutions and compare them. Although you may still have a deadline (like your interview date) you can justify learning an algorithm from the ground up. That is often not something you can justify on a real-world coding project.
In the current era, there are many ways you can produce a block of code besides writing it from scratch. Two of the most common are getting it from Stack Overflow and asking a coding bot to write it for you. Even coding interview problems can be solved this way. But during a traditional coding interview, you’ll have to write code from scratch. If you have only coded with online resources, you may find this difficult. So it’s worth spending time practicing without modern conveniences. As part of your daily practice, write your solution with no help from an IDE or any coding resources. If you get stuck, focus on the areas where you have trouble.
The first element of deliberate practice states that deliberate practice is “designed specifically to improve performance.” So a musician performing in front of an audience or a programmer doing their regular job is not engaging in deliberate practice. Rather, they are taking advantage of the results of deliberate practice. To improve performance in interviews, you have to practice specifically for that goal, which means finding the parts of the interview process that you find difficult, designing exercises to target them, and repeatedly working on getting better.
This year, I’m publishing a series of tips for effective LeetCode practice. To read the tips in order, start with A Project for 2023.