Header Ads Widget

Responsive Advertisement

How to Pass a Coding Interview: Tips, Advice & Resources

How to pass the coding interview with any large tech company?

How to Pass a Coding Interview: Tips, Advice & Resources

Now there's a lot more that goes into this than people think. They think you just need to be an algorithm master and do ten thousand leetcode questions and you'll be good to go. I'm here to tell you that is incorrect.

I am a computer science major in myself second year. I am years old and up until 3 months ago I had never done a coding interview before in my life and I had never even prepared to do when or done any of those kind of algorithm questions that you see so commonly in the coding interview.

So I went from pretty much three months ago I would say in November to having absolutely no experience not being prepared whatsoever to actually doing 4 technical interviews passing all of them and getting an offer from two different companies. So I did 3 technical interviews at Microsoft received an offer and then did one technical interview at Shopify and received an offer from them.

And those are the only technical interviews I've done. I passed both of them and that was on my first try.

Now a very quick Disclaimer here just so that I'm being transparent with all of you guys. I did accept the offer at Microsoft. I'm going to be a software engineering intern this summer in Redmond Washington and I'm very excited about that. I'd be working on the Python core extension team. Now the offer at Shopify was also great. I would have definitely loved working there but between the two I decided to pick Microsoft.

Now another quick Disclaimer because I know some of you are screaming at me in the comments right now when I just told you I didn't have much experience. I do have a lot of experience programming compared to probably your typical or average students. But again that's not going to take away from the advice I'm going to be giving you guys. It's just a Disclaimer.

So you know that maybe 3 months of prep that I did you might need to extend that a little bit as I have done a lot of programming in the past that some of you may not have done before.

So what I'm going to do now is walk you through my favorite two platforms to use to prepare and show you exactly the types of questions the amount of questions I did to prepare and the way in which you guys should approach these questions. So it's one thing to just do with a ton of different questions right? I mean you hear this all the time. People that do like the hundred like code questions and they go in and they still fail.

So that's why it's very important that you don't just do a ton of practice which is important but you do the practice correctly. So please pay attention throughout this when I'm kind of talking about the way you should do these questions because I don't want you to just waste your time answering coding questions that aren't really doing anything for you.


So the first platform that I always recommend is AlgoExpert.io. Now I'll be completely transparent here if you guys decide to purchase this platform which is a premium paid platform it is $ 85. Now I understand that immediately make some of you guys question my judgment. If I'm being sincere on this platform you don't fair enough but I'm going to walk you through my pitch on why I think this is the best platform for a beginner to get started on.

I don't think this is necessarily the best platform to stick tooth for the entire coding interview prep but I think that if you're someone who's getting started or who doesn't have a strong Foundation or is maybe a little bit more worried about their interviews then this is a better one to be on just because of the solutions that come with it. So for those of you that don't know this platform has coding questions.

It has a data structures crash course on it for people that aren't familiar with data structures yet or haven't taken the course or need a refresher and also has coding interview tips. Now they recently released the System Expert thing which I believe is a new product. I'm pretty sure this is 50 % off for the initial launch.

Go down to the questions

Now and talk about what I did on this platform. So as this comes with 85 coding questions. They're organized into an easy medium hard very hard and extremely hard. Now if you're going to use this platform or if you're not anyways what I would really recommend is dialing in on the medium and hard questions or like medium to hard medium-hard. Look in that range is kind of your bread and butter because these are most likely the questions you're going to get asked the cover.

If you can answer these medium and hard questions a really wide variety of the way to prepare these easy questions are almost like okay if you're just getting started like you're a real beginner these are where you're going to start to kind of get the idea of. Okay. This is how I approach a question. This is a basic algorithm but once you get past that you need to go very quickly into the mediums ace all the mediums like I've pretty much done here and then start working your way on the hearts.

You'll notice that the hard questions even the very hard questions are not necessarily that much more difficult. They're just different algorithms combined together. They're almost a combination of different medium questions. So really it's important that you can nail the medium questions because if you can't get medium you're not really going to be together and you're not going to get anything or difficult than that.

And chances are if you nail all these medium questions even if you've been asked a more difficult question in the interview it will likely use principles that you've already practiced from the medium questions.

So to give you an example of how you should actually practice these specific questions you can group these by not only category but by difficulty as well. And what I typically recommend is making sure you're doing questions kind of in all of the different categories almost in a loop. I like to do array binary dynamic. I go through all of them so that that way I'm not just doing like array questions in a row and just memorizing the solutions to array questions.

I want to every time I see a question have to think and not have the solution memorized. You don't want to have that. You want to have an idea of how to approach the question but you almost just want to have to think so that you can practice doing that because that's what you're going to have to do in the interview.

So if I pick a question say here like a medium question from a raise. All right. You can see this is my answer for this medium question. The reason I really like this platform is that they have hints that you can look at here.

How to Pass a Coding Interview: Tips, Advice & Resources

They also have the fact that I can just run my code and CD output in the test cases here. I can see their solution. I can move the windows around. I can change all these different things. I can set a timer which I recommend you do every single time you practice programming questions set the timer before and it's so easy on this platform to do it as well. 

You can see the test cases and then the best part is you can look at a video explanation of the question and how to get at the solution. Now sometimes there's multiple solutions. If there is this video will cover all of them.


If you can go to a conceptual overview or code walk-through. And for people that are beginners, this is extremely helpful and is what really built me in a strong foundation and allowed me to move over to leetcode.com which I'm going to talk about now.

So obviously here 85 questions I would not really say is enough prep for the interview. I would say that this is really good in terms of building your Foundation building up a wide range of different questions and understanding how to approach the problem but you really need to dial in on some more practice. And this is where I suggest leetcode. So once you have the Foundation done from a platform say like AlgoExpert or something else if you guys have any other ideas for them leave them down below.

I would buy leetcode premium which I'm pretty sure is $35 a month or something like that.
Pick the company that you were interviewing at on this premium tab here and do every single question from the module that is suggested. So here you can see that this tells me all of the questions that are frequently asked at Microsoft.

How to Pass a Coding Interview: Tips, Advice & Resources

Guess where I got a job. Right. And look how many questions I did from this. I did 59 % of them. Since I was interviewing at for the intern level I knew that the questions like backtracking sorting and searching dynamic programming and design wouldn't be asked as frequently as say a raised linked list and trees and graphs. So what I did was I did almost all of the raisin strings almost all of the linked list and almost all of the trees and graphs.

Now there's some pretty stupid questions sometimes that I don't bother doing. But the idea is do as many as possible from the from the company that you're going to work at. And this is where you know you build the strong Foundation on a platform like Algo Expert and then you dial in on the specific company you're going to be interviewing at with a company like Lika or Yeah I guess company like Leo or a website like Lika. And this is really good. The premium just makes it so much easier to do things.

I'll show you that although I did that module I also answered was these 56 questions on leetcode. So in combination with that little module, I showed you the 56 questions here and all the questions from Algo Expert. I ended up doing about 150 coding questions before where most of them were medium or hard questions. So on leetcode I had 40 medium although I will say the medium questions on leetcode are definitely harder than the medium questions on AlgoExpert in general.

How to Pass a Coding Interview: Tips, Advice & Resources

And really medium on leetcode is kind of where you should focus the easier like okay if you're warming up you're not that great at it yet. Okay, start with those. But really quickly try to get into the mediums. And if you want to challenge you the hard. But these are pretty time-consuming so I usually don't even bother doing them. So that is my kind of guide for getting prepped and ready to go.

You really should be feeling extremely confident before you step into the interview because you've done enough prep right. And that's the idea is that the way you're gonna perform well is with your confident in your ability. And you know that no matter what coding question you get you're gonna be able to nail it.

And the only way to be in that situation is to already be really good in data structures and algorithms and foundational algorithmic thinking and problem solving or to do a ton of practice. And that's where I recommend start here get the foundations and then move to leetcode. And this is where you'll move a lot faster and you'll just do a lot more questions. And if you have the premium version then you can sort by company.

I can go down and I can sort by Microsoft and I can really save myself a lot of time by answering questions specifically from the company I'm going to be interviewing at.

Okay so now that you have the knowledge necessary to answer these questions you've done your algorithm practice. You're confident with your data structures and you know that given one of these problems you will be able to come up with a solution. It's time to go through the procedure of how you're going to solve this problem in person and on a whiteboard.

Now, this is gonna be completely different than likely how you've practiced and you really need to listen to me on kind of the stages of what you need to do because if you don't follow them it's gonna be very unlikely that you actually end up getting an offer or getting hired. Now the stages and I'm about to give you in kind of the process and almost algorithm for solving the algorithm or coming up with the algorithm is what I've employed and used while I was practicing and exactly how I got the offers by literally sticking you know point to point on what I'm about to tell you.

So the first thing you're gonna want to do when you're giving a programming problem is analyze the crap out of it. Now I really mean that you should almost be spending the same amount of time analyzing the problem as you should writing or at least that's what I did in all of my interviews. What you want to do when you're given the problem is you want to make it as clear as possible what you're trying to solve and make sure that you understand the problem that you and the interview are on the same page.

A lot of the times you'll get asked questions that intentionally have ambiguous things have little tricks in them or things that should be simplified or clarified before moving forward. well, your interviewer wants to see you do is clarify those things and ask those questions.

For example, a good question you should always really be asking is can I expect integer values? Can I expect valid input? Is the output need to be in this format? Are we assuming this? Are we assuming that you want to reduce any ambiguity that you can? Because that's a huge thing in programming in general. And if you can show that skills to your interviewer not only is it going to kind of convey a good message to them but it's going to make it a lot easier for you to solve the problem right?

If you have some very complicated input and you need to validate that before it comes in. If you can just ask the question can I assume that this is valid? And they say Yes. There you go. You've just saved yourself probably five or minutes of validating the input so that's something very important. Ask lots of questions make sure you know what you're solving and make sure you understand the problem to a tee. And your interviewer knows that you understand it. 

The way that I like to do this is just literally running back the problem kind of discussing each point in the problem to my interviewer asking some questions making sure that they know that I'm taking a good look at the problem before I dive in. After you've done this and you're clear that you understand what you're solving you've done the analysis and you know that they know that you know what you are doing. Then you can start talking about how you're going to solve the problem.

So here is where you're going to want to start probably diagramming and just drawing things out on the whiteboard.

To be honest it doesn't really matter how meaningful the sketches are that you're doing so long as you can kind of convey that you're doing a little bit of a plan before you just get into the coat even if you know how to solve the problem exactly already and you can just hard code and run through the solution it. Do Not do that. You have to discuss exactly what you're gonna do the approach you're going to take and you want to consider different approaches as well.

What I will typically do is I will start with kind of a naive approach even if I know a better approach walk through the naive approach or the one that is like the worst space-time complexity. And then from there slowly build my way up into a better approach. Even if I know the problem and I haven't memorized and I could literally just write it on the board I will make sure that they know. I know that both approaches and I'm considering the space-time complexity between them.

This is the biggest thing probably the massive thing that's going to make a huge difference because you're showing that you can look at different alternatives. Pick which one is the best and then implement that and slowly build your way up to a better solution. You don't want the interviewer to know that you've just memorized You want them to think that you're figuring it out live in front of them.

If you can do that then that's going to make you just a lot better in the process because not only are they going to be like Wow this person has a really good thought process. They're thinking things through. They're going to be like and they're pretty smart too. They went from the naive solution to this better solution just by doing analysis and drawing things out.

Now at this point in time, you 10/15 minutes deep and you haven't written any code and that's totally fine. And that's what I did for all my interviews. As soon as you come up with the kind of strategy that you want to employ check it with your interview.

You don't need to be unconfident and be like Is it okay? Can I do this? Just be like this is the approach I'm going to go with. Do you think this sounds okay or would you prefer if I went with a different approach? Is there something you can think that's maybe missing here? You just want to be confident you're working as a team and that's what you want to show is that you can work with other engineers as well.

You can take their feedback and you can bring that into the question. And a lot of the times if you've gotten this far already and you've done a good job that might even tell you Hey this approach is good. Can you do it this way? I think it'll be easier for you which is what happened to me at actually two of my technical interviews where I had a very kind of complicated way of solving the problem that was going to work. They gave me a hint gave me an easier way. Boom.

I solved in the next minutes and they're very happy with the solution because I use their feedback. So once you've done that now it's time to actually code. And this should be the easiest part. The hardest part for me really is just analyzing the problem picking out the edge cases describing reducing ambiguity talking about the implementation and drawing the diagrams. Once you've done that it's just about trend translating this to code. And this comes down to practice.

If you program a lot if you're a good programmer this should be easy. This should be the easiest part. Try to make everything as readable as possible. You know you just want to employ good standards and you want to show that you're thinking about the reusability of this code especially working at large tech companies where we need to scale these algorithms to millions of people. Well, you got to write code that someone else can read and especially your interviewer and you want to make sure.

And this is a very important part when you're coding that. Although I know you could go fast and speed through it. You take your time and really talk about every step you're doing and why you're deciding to do something. There's a lot of times where it's difficult to read people's code if you don't know their thought process. So give the interview or your thought process. You should not be silently sitting there writing code.

You should really be discussing why you're doing something. And maybe after you write lines take a step back draw the box decay. This does this. I've decided to use this because this is faster. This method. I know I probably could be done another way but from now we'll leave it like that and then continue to move forward.

I never will really go more than seconds without saying something because you don't want to lose your interviewer and you want them to know exactly what's happening and always kind of be working with you and giving you the benefit of the doubt. And this is why it's very important that you analyze the problem beforehand.

So your interviewer knows exactly what you're about to code and they're in the mindset like Okay so this is the approach we're taking. Let's see how well he could do. And if you make a small mistake in your implementation what happened to me interviews was they would actually pointed out and say Hey I think you might have missed a line there.

And I'm like Oh my gosh. Thank you. I just didn't see it. And they totally get that. They're human too. They make mistakes. They know that you decide to talk about the implementation. You've been doing a good job coding. You made one mistake. They have no issue telling you that and helping you move forward. They want you to succeed and that's what you want to do here.

You want to win your interview over at the beginning. You want them to think you're confident and smart and be giving you the benefit of the doubt. Because if you don't do that and you just go and code thousands of lines on the whiteboard you don't say anything and you make a mistake. How are they going to give you the benefit of the doubt and be like Okay you know maybe he just made a mistake. No, they're gonna think that you don't know how to program.

They're gonna think you didn't know the implementation you were going with and you're just trying to run something through your head and memorize the solution and write it out.

So that's kind of my algorithm for coming up with your algorithm to a programming problem. Again analyze the problem reduce ambiguity come up with the implementation discuss different alternatives of the implementation and why you're going to go a certain route. Really make sure your interviewers with you the entire time you can even ask them like Hey does that make sense?

You understand what I'm doing as if you're teaching them what you're about to write on the board and that's the way that I take it. I am almost teaching them exactly what I'm about to show them and making sure they're on the same track as me. And that's only going to give you an advantage. When you code make sure that you're describing everything that you're doing good. Variable names clean code.

Try not to go into crazy indentation levels. It just makes it very difficult to read and that's all you really need to do. If you can do all of that then you will pass your coding interview. That is the secret to it. Now obviously there's lots of different components as well. You need to answer behavioral questions. You need to be just a good personality in general.

But if you can go in right at the beginning and you can just have a smile on your face you can have some good answers to the questions and you can be ready and prepared for your coding aspect. When you start coding you're already gonna be winning in the interview which is what you want because if you're already winning you're gonna get hints. You're gonna get help.

You're gonna want your interview is gonna want you to succeed and that's just gonna give you a massive benefit. Now this leads me into practice which obviously is extremely important. All of the skills that I've just mentioned may seem overwhelming and they may seem like it's difficult to be able to master that especially if you're on a tight deadline or a tight schedule. But you need to be practicing doing that while you're solving program programming problems.

For me what I would typically do because I'm not just gonna talk for like four hours alone by myself is I would do like three or programming problems. And then the fifth one I would do on a whiteboard that I actually have over here in my room that I bought specifically to practice programming problems. And I would treat it as if it was an actual interview and I would genuinely look to my wall and ask you questions.

I would do stuff like that. That is the kind of practice I employed to make sure that when I got there I have been practicing an environment as close as humanly possible to what I'm actually going to be performing in. You don't want to leave this up to chance. You don't want to leave this up to okay I'll get it in moments. I'll kill it.

Now you want to go there as prepared as you possibly can be so that when you leave even if you don't get the job there's nothing more you could have done. And that's the thing that I said after my interview I was like Regardless if I get the offer or not I did as good of a job as I could do. I did as much prep as was reasonable in the time before. And there's no reason that I should be upset that I didn't get the job because well there was nothing more I could have done.

And those are my tips to you
Practice like you play right? You're gonna be playing and you're gonna actually be doing the thing in a real interview. Practice like you would do that. You don't need to do it every day but make sure that you are okay with vocalizing your solution which is a lot more difficult than it looks.

Last words

And that's what you guys need to get to for these programming interviews. I had a massive advantage because as much as I've only been prepping programming problems for 2/3 months I had been preparing and practicing my communication skills for the past three years. So that's what you need to do. That's how you get the job. There's no easy shortcut. There's no go. Let code by this website do that.

It's a lot of hard work and I mean it pays off. Look at the compensation from some of these companies. Look at career development. There's a reason why the acceptance rate at Google is 0.2 % from people that apply. It's just because it actually is hard and it does require the work and not that many people are willing to put it in. So that has been this article I hope you guys enjoyed.

I hope these tips help you understand this was long but I'm gonna give you guys as much information and value as I can. If you do appreciate these kinds of article please leave a comment down below.

Post a Comment


class='back-top' title='Back to Top'/>