HowToUseThisGuide
In this guide, you’ll find 50 of the most popular coding interview questions that I’ve seen asked.
And for every single one, I’ve provided code and a detailed video explanation.
But here’s the thing. It’s not going to be enough for you just to read through the whole thing and
head off to your interview. If you really want to get the most out of this guide, you’re going to
have to put in the work.
The key when you study these problems is to solve them exactly as you will when you go into
your interview. Developing a systematic approach and practicing it will allow you not only to
solve these problems, but solve so many others in your interview.
Here are the steps that you should follow:
1. Understand the problem
While this may sound obvious, it is a step that is constantly missed. My favorite go-to
problem when evaluating people is asking them to print out a linked list in reverse order.
Consistently, at least half of the people will spend a lot of time reversing the linked list
and returning it, rather than using a simple stack-based or recursive solution that prints
out the list and returns nothing.
Understanding exactly what is being asked of you is critical to your success. Ask any
clarifying questions necessary (you can also ask later so you don’t have to figure out all
your questions now). Also consider the example you’re given. Look at the input and
figure out how that resulted in the given output. If you see any obvious problem areas or
edge cases, add in your own example. Based on the input and output, what should be
the signature of your function?
2. Find a brute force solution
While I’ve already somewhat belabored the point here , it is absolutely essential that you
start with a brute force solution. Far too many people try to jump into an optimized
solution and get lost. At that point it can be really hard to recover without simply starting
over, and in an interview you definitely don’t have time to start over.
Finding a brute force solution also guarantees that you find a solution. When searching
for a brute force solution, there are a couple of things you can try. If a question asks for
the most something (longest path, largest weight, etc), you can solve it by finding every
possible solution and comparing them.
If you’re unsure how to approach a problem, try solving it by hand first and then
Enjoyingthisguide?ShareitviaEmail,Facebook,LinkedIn,orTwitter!
©BytebyByte2018
4