DEV Community

Cover image for How to Start Practicing Coding Interview Questions
Sharon Fitzpatrick
Sharon Fitzpatrick

Posted on

How to Start Practicing Coding Interview Questions

Okay so I have a confession to make I've been dodging practicing for coding interview for months. I've conveniently always had a side project to work on or was too tired from programming all day at work to start them. But the truth is I was scared to start them because they made me feel stupid.

I wanted to share some steps I took that are helping me overcome my fear of interview questions, so that hopefully they can help you too. Feel free to share more things that personally helped you out in the comments below!

Step 1: Make Your Motivation to be More than Getting a Job 🐺

Having multiple motivations to practice coding interview questions will make it easier to start and continue the routine. For instance, you may want to learn more programming shortcuts that increase your speed. This is a great motivation because it will have you digging through the solutions to find ways you can better your code. My motivation is practice explaining my problem solving out loud so that I can improve my speaking skills. This makes me more excited to start than just plain "I need to do this for the job" 😩.

Step 2: Make a Schedule & Stick to it 🗓️

I have found they key to making progress on interview questions is to practice in little chunks at a time 3 or 4 times a week. Spend 30 minutes to an hour 3 or 4 days a week practicing interview questions. This will lead you to developing a habit of studying them and make it easier to continue practicing long term. Also don't beat yourself up or increase the time you study the next day if you miss a day. When you increase the barrier to starting by punishing yourself you make it not only harder to begin a practice session but also turn practicing into a punishment. Think of practicing interview questions as time of exploration 🚀 and learning. Find a way to frame it as a fun experience.😄

Step 3: Study the Algorithms & Structures in the Solutions ⛰️

When you encounter a data structure or algorithm you don't know in the problem or solutions spend some time studying it and practicing it before getting back to the problem. This will help you learn these structures in an organic way. Furthermore, since you are practicing them before you apply them to the problem you will know when and how to apply them. ✨ This LeetCode Discussion explains this idea more in depth

Step 4: Practice Writing out the Steps 📝

Write out the steps (not code) you need to do to solve the problem first. This will let you fully understand the problem so you don't start coding then realize your approach was all wrong. (admittedly this still happens to me sometimes 😅). Then reread the question to make sure your steps would produce the output the question is asking for. This also helps you practice explaining the way you would solve the problem to an interviewer.

Write out the high level steps like:

  1. Set the maximum value to the first value of the array
  2. Iterate through all elements of the array
  3. Compare each value in the array to the maximum value
  4. If this value if greater than the maximum value make this value the new maximum value
  5. Return the maximum value

Step 5: Remember You're Not Stupid these are Hard

As this post on Leetcode shows these problems are challenging (not impossible), so expect yourself to get stuck on a lot of problems. Never call yourself names like "stupid" or say "I'm just not that smart" the way you speak to yourself impacts how you view yourself. Its going to cause you to lose motivation, not solve problems you were capable of solving, and feel so much worse about yourself. Instead remember that these problems are meant to be challenging and that no one knows how to do them right out of the womb 👶. A friend once told me that when you do something for the first time its going to be bad, but when you do it for the 100th 💯 time its going to be great!

Step 6: Reward Yourself 🍰

Let's face it is programming is hard work and you should reward yourself each week after you finish all your practice sessions. This will incentivize you to keep making progress. Also occasionally take a look back at your old solutions to see how much you have improved. This should be a confidence boost ⏫ because your can see how much better you understand the solution and even how you can do it better now!

I hope these tips help you and please let me know in the comments what strategies you use when you practice interview questions. I'm still learning and would love to hear your secret tricks.

Top comments (0)