All posts
All posts

Practical Tips for Nailing Algorithms Interviews

· 3 min read
Cover Image for Practical Tips for Nailing Algorithms Interviews
Photo by Christina@wocintechchat.com on Unsplash

Intro

Interviews are naturally stressful. For me, it’s hard to think about too much while being interviewed. If I know something, it'll just pop out; if I need to show working methodologies that are already embedded in me, I'll shine. But if I need to actively think, my mind is too stressed, and all I can think of is, "Why don't I have an answer already?"

This seems reasonable to me. The situation is stressful, and I believe each of us experiences this at a different scale. That's why I try to follow a few guidelines whenever I go to an interview that requires more thinking, like an algorithms interview. I'll write them down here for anyone who's interested or maybe even for myself for the next time I’ll need them.

Preparation

Preparation builds familiarity, which leads to confidence.

  1. The more prepared you are, the more confidence you'll have. Try out as many exercises as you can. Even if you don't manage to solve them, the fact that you know more "tricks" and can recognize patterns will make it easier to tackle similar problems. As I mentioned above, if I already know something, it'll probably pop into my head, and translating what you already know to fit a new problem is easier than creating a brand-new solution from scratch. I recommend trying LeetCode - easy and medium-level questions. If, during the interview process, you get one of the hard-level questions, you'll at least have the basics to understand and give it a try.
  2. Ask your friends or a mentor to give you a mock interview. As I mentioned above, the more prepared you are, the more confidence you'll have. You'll also get tips from someone who's actually interviewing other people.

During the Interview

  1. Always start by solving the problem with a "naive" approach. This will probably help you get into the flow of solving the problem. Don't forget to tell your interviewer that this is what you're doing. Say something like: "I'm going to try and solve this with a naive approach first to make sure I understand the question."
  2. Align on the requirements - What are the edge cases? What do I need to solve? Try to get the full picture first and then come up with a solution. Showing that you think about edge cases at the requirements level will leave an impression on your interviewer, showing you're trying to provide a solution that covers all cases.
  3. Communicate everything. You can either talk about what you're about to do or write comments that clearly state it. This will give your interviewer "hooks" to ask questions and direct you towards the solution if they think you're missing something. Remember that you're also being rated on how you communicate and pass information. Communicating your thought process can even help ease your nerves—you’re explaining things to your interviewer, not just silently working under pressure.

Summary

This isn't an exhaustive guide on "how to pass a LeetCode interview," but it does have a few tips I wanted to share that might help some of us. Don't forget that interviewing (from both ends) is a skill that requires sharpening. Sometimes, you won't be at your best, and neither will your interviewer.

With practice, these patterns become second nature.
Feel free to add your tips as comments here or on X / Bluesky.
Thanks!
Matan.