What we can learn from a business and productivity coach about studying for coding interviews

Coding interview fundamentals

If you know me personally, you know that I’m obsessive about the things I find important or interesting. I’ll read book after book on topics that other people would probably find insufferable, like personal finance or optimizing my diet.

Goodreads screenshot
To give you a sense, here are the last 30 books that I’ve read. Of the 30, 20 of them are related to business and finance. So yeah, a little obsessive.

One person in particular, who has some of the best bits of wisdom, is Ramit Sethi from www.IWillTeachYouToBeRich.com. Now I know the name probably makes you want to run the other way screaming, but don’t knock it till you try it. Ramit is one of the best business and career coaches out there.

Recently, Ramit published an article on productivity that featured the following graphic:

I will teach you to be rich graphic

I love this because it is directly applicable to how we think about getting a job in software engineering.

As the pyramid shows, there are three levels to everything we do. There are the fundamentals, the psychology, and the details. When we are learning something, we tend to obsess about the details. That’s the part that we see. That’s the part we think about.

But the details are also the least significant piece of the puzzle. Without the fundamentals and psychology supporting them, the details are worthless.

Countless examples of people focusing on the details come to mind. While writing this article, I went on HH Coding Interview Prep and just grabbed the 4 most recent posts.

Facebook screenshot

Facebook screenshot

Facebook screenshot

Facebook screenshot

Do you notice something similar about all of these? They’re all focused on the details.

Specifically, every one of these posts is focused on figuring out the specifics of an interview for a certain company. If we dig below the surface, each of these questions is really asking “what questions am I going to be asked in my interview?”

Now I should clarify that these are not bad questions to ask, and I understand where they’re coming from. However, the questions themselves are misguided. They focus on the top of the pyramid rather than strengthening the base.

What if we reframe the question? Rather than “What will I be asked at company X?”, we could ask “How can I prepare myself to answer any question I might be asked?”

Do you see the difference? In the first question, we are asking about the specific details. For every interview, we will have to re-ask a variant of the same question. The answer is dependent on the specific details. The second question, however, is broadly applicable. If we can answer the second question, the first becomes irrelevant.

I see these types of questions time and again. Whether people are trying to solve a specific practice problem or trying to decide which line to cut from their resume, these are all details.

The details are important, but not until you have everything else in place.

What I want to talk about specifically today is the fundamentals. These are the core on which every other aspect of interviewing for a job is built. For coding interviews, these are theoretical knowledge, coding ability, problem solving ability.

Theoretical Knowledge

Theory is everything that you learn in school and immediately forget upon graduating. It’s what you learned in your datastructures and algorithms class that you never use in the real world because why would you implement a priority queue when someone has already done it better for you.

However theory is one of the fundamentals that lets everything else in your interview fall into place.

When you are trying to decide between two different algorithms, a quick time and space complexity analysis can easily tell you which solution is better.

When someone asks you to sort a linked list, it’ll really help if you remember how to do a bottom-up mergesort.

Knowing this stuff is really important and that means particularly for those of you who are already out of school, you may need to dedicate more quality time to refreshing your DS and algos knowledge, since it’s not as fresh.

One of the best resources out there to refresh this the free Datastructures and Algorithms course from Princeton University available on Youtube. I highly recommend at minimum going through any topics that you are less than 100% on.

Programming Ability

While theoretical knowledge is more of an issue for experienced engineers, college students don’t have all the advantages. Another core fundamental that you need to master is coding ability.

This is a perfect example of a 10,000 hours skill. Simply, it is something where practice and experience is the best way to get good at it.

For those who don’t have as much coding experience, this can mean many things. Maybe you start a side project. Maybe you do an internship. Maybe you join an open source project. Here are a ton of open source projects you could start working on right now. Find something that sounds interesting and start contributing!

Regardless of how you do it, having strong coding ability is essential for your interview.

By becoming a good coder, you learn common sense syntax. You learn how to recognize if something seems reasonable or not. It’s like when you read a sentence in your native language and it just doesn’t sound right. Even if you’re not a grammar expert, you can tell that something is off.

With coding interviews in particular, it is the same thing. You don’t have the compiler to fall back on so you need to be intimately familiar with how the language works. This will allow you to catch so many mistakes you might otherwise miss.

Problem Solving Ability

The last, and most overlooked, fundamental that you absolutely need is problem solving ability. It is when people don’t develop this skill that they devote their time to memorizing solutions rather than truly understanding how to solve problems.

This is not an easy skill to learn, but there are tons of different techniques that can help you get there. My favorite is learning how to break down the problem into smaller, more easily digestible components.

Let’s say that you want to remove all of the duplicates from a linked list. You can do this in one step if it is obvious to you, but imagine that you see this and don’t know what to do. How can we break this problem down into smaller chunks?

First, we know how to iterate over a linked list, right? If you don’t then you need to refer back to the theoretical knowledge mentioned above.

Now can we identify whether a given node has any duplicates? Yes of course we can. In the most brute force sense, we can just iterate over the entire list and compare each node’s value to the value of our current node. If we find another node that has the same value then it is a duplicate.

Finally, can we remove an arbitrary node from a list? Hopefully yes. This is a little trickier than the other steps, but again is something that you need to know.

Now that we know how to do each of these, we can write pseudocode for our problem:

When we break down the problem like that it becomes super simple. Granted, our algorithm is not super efficient and we will ultimately want to improve upon it, but this gives us a starting point.

These sorts of problem solving skills are the final essential fundamental for coding interviews. They are also a completely learnable skill. The problem solving techniques that work for each person differ slightly, so I highly recommend working with a coach to hone these skills.

 

With so many things that we do, we forget to focus on the fundamentals. Whether that’s because of shiny object syndrome, where you are attracted to the thing that superficially looks most appealing, or because of simple lack of understanding, the people I see struggle the most in interviews are those who don’t have a firm grasp on the fundamentals.

It’s not sexy to study datastructures and algorithms. Who wants to sit down and methodically explore how you do your best problem solving? But if you do these things and only worry about the details afterwards, you will set yourself up for your strongest possible interview performance.

Nail your coding interview and get the job you deserve

Sign up for my weekly emails and I’ll show you how to become an interview rockstar, solve brutal coding problems, and get the dev job you deserve.

We won't send you spam. Unsubscribe at any time. Powered by ConvertKit