DEV Community

Daniel
Daniel

Posted on

How to Master Programming Interview Concepts

Intro

There is a difference between learning and becoming a master of a concept. Learning is an initial ingestion of information. You understand what the topic is and the basics of how it works. Mastery is comprehensive knowledge of the concept. You know everything about it, can speak confidently, teach others, and can apply the concepts to new situations. In order to pass the programming interview for a Big Tech company, you need to be a master of computer science fundamentals.

When I was studying for programming interviews, I first went through the typical advice (leetcode & CTCI) that you find on the internet. After failing my first Google technical interview, I took a different approach to studying that led me to master the computer science fundamentals needed for the interview. I then absolutely crushed both my Google & Facebook interview and ended up getting offers from both companies.

I now run Hackpack, a community of engineers studying for programming interviews. It became difficult for me to categorize everyone based off of where they are in their preparation so I took the time to break down each stage. This should be used as a guide as you prepare for your coding interview and a tool to track your progress. Understand when to move on and where to spend more time in each stage. Following the five stages - Zero, Research, Repetition, Refinement, Master (ZRRRM) will allow you to effectively track your progress. Developing a mastery is a hard and long road, but with support, confidence, and a lot of practice, you can get there.

Zero:

Ground Zero is when you know absolutely nothing about what you are going to study. You have just started and you know that you need to study but are unsure about where to start. You cannot speak on the concepts and are confused when you hear people around you talking about it. You cannot solve any leetcode problems at this point.

Research:

Starting to study

This is an information gathering stage. This is where you are trying to understand what concepts the programming interview will cover. You are reading, watching videos, and looking at tutorials. You are getting a first pass at the different data structures and algorithms you will need to know. The resources people use at this stage will vary (algo expert, grokking the coding interview, algo monster, CTCI, etc.) and it really doesn’t matter which one you use as long as it helps you get a grasp on what the concepts are at a high level.

I am over simplifying it for this article but in reality this is one of the hardest stages of mastering a concept. It is daunting and intimidating to look at all of the information you need to succeed because with programming interviews, there is quite a lot to digest. People often give up during this stage from a sheer sense of being overwhelmed.

There is also a lot of variance as you start your research. Some people dive right into the Algorithm Design Manual (depending on your learning style, it may be too early for this) and get turned off. The good thing about this stage is that once you learn about everything you need to study, it doesn’t get any wider. There are a set amount of topics you need to cover and that is it. This is the initial pass and It only gets deeper from here. The goal of this stage is to understand the breadth of topics that are fair game.

When you are ready to move onto Repetition

By the end of this state, you have done the first pass of research and have a high level understanding of everything you need to know. You have gotten exposure to Leetcode and tried a few easy problems (& failed). You know what you need to study and this information has had a moment to bake.

Repetition:

Two Key Questions

Time to start diving deeper into these concepts. This is a slow state that takes a while to get through. You are building a sturdier foundation of your knowledge. This is when you start working on leetcode problems more seriously. It is important here do to these problems with intention and not just at random. Start with the easy problems. You will still be getting most of them wrong (which is normal) but when do you, take a moment to think deeper about the “Why”.

Try asking yourself these questions before you look at the solution -

  1. What am I missing?

    Why did I get the question wrong? What did I miss? Compare the correct answer to your problem and try explaining out loud to yourself what went wrong. Do not move on until you fully understand what you did wrong. This is the most important question you can ask yourself.

  2. What topics is this problem covering?

    Make sure you really understand what topic the problem is covering. Does this problem reference a tree? Did I use a linked list to solve this problem? Identifying the correct concept and why it works in this situation will help you learn from every problem you are working on. It will also allow you to identify this concept in the future.

Practicing in this way will take more time but it will allow you to learn so much faster than just solving leetcode problems at random. At this stage, you are still just learning. Leetcode problems should be approached with the mindset “quality over quantity”. You don’t have to do 100 leetcode problems when you are approaching each one with these two key questions in mind because you are deliberately building on your base knowledge each time you complete a problem. Don’t get me wrong, you will do a lot of problems in this state. But, when you are approaching them mindfully, they will get easier a lot quicker.

Mock Interviews

Start practicing with mock interviews (free resources included). You will fail the first few, but they get you comfortable with that interview environment and allow you to start practicing some of those soft skills necessary for the interview.

Deeper Resources

This is also when it is important to pick up a resource that is a bit deeper like the Algorithm Design Manual. This is a denser resource that teaches you all of the math behind the data structures and algorithms you’ll need for the interview. You will understand how all of these data structures are built, what their runtimes are, and why they behave like they do.

You need to put in the work with a resource that doesn’t oversimplify things to master the computer science concepts. This is understanding the “what” (what is a linked list?), “why” (why would we use a linked list?) and “how” (how can we creatively apply these concepts in different situations). You shouldn’t just memorize that binary search is log N, you need to know why. Why does a O(N²) runtime dominate an O(N) runtime? If you just say “because it’s bigger”, you aren’t really answering the question.

When you are ready to move onto Refinement

You have the fundamentals down at this point. You have finished the first half of the Algorithm Design Manual. You are doing well with easy leetcode problems but you are starting to make solid progress with mediums. You have done a few mock interviews and are starting to feel comfortable in the space. Ask yourself “How confident am I at this point?” If you are above a 6 or 7 you are ready to move on to refinement.

Refinement:

Practice, practice, practice

Even at the start of your prep, you should always be doing practice problems. But this is the stage where you really want to ramp up the amount that you are doing. The goal here is to see more situations where the fundamentals are applied (continue asking yourself the two key questions we discussed - What am I missing?What topic is this problem covering?). You should be pushing yourself here with a variety of problems, and you should start randomly picking problems to tackle.

Mock Interviews become more important

Continue practicing with mock interviews. These should be getting easier as you learn more and you should be feeling more comfortable with the interview environment. The technical interview will not just be a test of your coding skills. There are soft skills that you need to develop if you want to pass. The conversation that you are having with the interviewer is more important than you may initially think. You want to make sure you can clearly explain your thinking and the interviewer has a chance to see you as an actual colleague.

Time to switch it up

At this point your confidence will be building more and more. You will feel like “if you asked me a concept I feel like I could talk about it confidently”. Medium leetcode problems feel like easies and you start working on tackling hards. It is time to shift your studying to include more discussion based learning to challenge your intuition.

Don’t bullshit yourself

Discussion based learning comes from teaching, mock interviews, and talking with others to help flesh out your knowledge. 1-1 discussions are a great way to keep yourself honest. You should still always be asking yourself, “what do I think I am missing?” and “Do I feel confident on every concept?”. If you are not confident ask yourself why you are not confident.

Discussion based learning is important at this stage because at the end of the day you are only studying what you are aware of. There are things you don’t even know to ask yourself. So how do you ensure that you are confident on every concept? Teaching.

When you are teaching someone dynamic programming, you need to know dynamic programming like the back of your hand. People get tripped up on a lot of different things and you need to help them work through that with the foundation and understanding you have learned. If you can’t do that, you are not a 10/10 on the concept. The great thing about teaching though is that if you get a question you cannot answer, it helps you quickly find knowledge gaps. The student you are teaching hasn’t been heads down in dynamic programming like you have. They are coming in with a fresh set of eyes and the ability to poke holes in your knowledge.

Learning and understanding topics is well scoped but finding what you are missing at this stage is difficult. Teaching will help shed some light on what you may not realize you don’t know.

Talking to yourself

Another way to keep yourself honest in this stage is saying things out loud. It helps you realize the things you gloss over in your head. Including the little details that you take for granted but don’t fully understand. You are not able to fully explain these details and because you know enough to get by it has never been something you feel you needed to push further into. Saying things out loud forces you to address this. You are actively figuring out what you don’t know so you can go learn and practice it. Try recording yourself solving a leetcode hard out loud, then watch the recording. You will notice where you freeze up, and where you lack confidence. It’s really uncomfortable to do this, but remember, this is what your interviewer will see!

Repeat the loop

This loop should be repeated until eventually, you build an intuition that is so thorough that it doesn’t matter what gets thrown at you, you know all of the logical branches under each concept. Or, you know so many branches that if you do for some reason get stuck, a slight hint is all you need to push you in the right direction. This is where you need to get for these interviews.

When you are ready to move onto Mastery

By the end of this stage you should be able to easily discuss concepts with confidence. You are applying the concepts to problems you haven’t seen before, and can teach others comfortably. You are confidently solving medium Leetcode problems. You are making significant progress with hards.

Mastery

The loop that you cycled through in the last stage (figuring out what you don’t know, learning it, and then practicing) should be very flushed out. You have learned almost every possible angle and are now challenging yourself. Nothing new comes up when you are teaching other people.

At this stage, when you get stuck in an interview, you no longer freeze up, you start to get creative.

There is a study method that is often used in the medical field, coined “see one, do one, teach one”. The phrase came from a method in which a surgical student will observe a procedure and study it, practice and perform the procedure on their own, and then teach another trainee how to conduct the procedure. This is what you should be doing as you study for programming interviews. Learning the concept, practicing the concept, and then teaching the concept.

When I reached this point as I studied for programming interviews, I was going into my Google & Facebook interviews with the mindset “I have no idea what they could ask me right now that I wouldn’t already know”. I ended up getting offers from both companies.

Conclusion

If you are trying to get a job in Big Tech, you need to master the core concepts. Just learning is not going to get you across the finish line.

Getting to mastery is not an easy task. You might spend months on each of these stages as you prepare. Remember, you are essentially trying to cram a 4 year degree into a few months. It is difficult but doable. Be kind to yourself and stay consistent. If I could do it, you can too.

Overall, mastering a concept is way easier said than done, and what I missed during this time was someone who was also going through the same thing. I had no one to vent to or discuss ideas with. I ended up discussing these concepts with my mom (bless her) as I crept up to mastery. After I left Facebook, I started Hackpack, which is a community of engineers all studying for programming interviews. We provide support, hold each other accountable, and offer mock interviews so that no one has to master these concepts alone. You can apply here & make sure you are subscribed to the blog as I will be diving deeper into each of these stages in future articles.

Youtube | Twitter | LinkedIn | Events

Top comments (3)

Collapse
 
codewander profile image
codewander

This whole system is broken. It feels like the SAT prep industry. Thankfully some companies are moving away from this IQ test proxy / speed programming approach to things like woven teams realistic exercises and asking for code review rounds instead of hyper focusing on coding in isolation.

Collapse
 
tipseason profile image
Tip Season

Great resource. Thanks for sharing the tips. Practicing right set of interview questions is also very important. Recently started curating top interview questions. You can find them here: tipseason.com/coding-interviews.html to be

Collapse
 
andrewbaisden profile image
Andrew Baisden

So much valuable information here its looking like a good resource. It's true practice makes a whole lot of difference always be prepared.