I wanted to give back to this community after I've been lurking for a while. I want to share some Leetcode tips since I'd say my strategy differs from most that are posted here or elsewhere. My account will probably be deleted soon since I've used a non company email to sign up (I don't have a company email yet), so don't expect answers after a certain time. New grad (MS). I got an offer from Microsoft (TC 180k in Canada) and Google (L4, in team match stage). First time interviewing. Fundamentals: I have a pretty good knowledge of fundamentals. If you don't, I 100% recommend you go through an algorithms book. Yes, I know, it's no fun if you haven't done a class on it before, but I believe is the best way to at least get a grasp of everything. I dislike interview preparation books (CTCI is just bad in my opinion), but I guess they're better than nothing. I suggest CLRS as a first algorithms book. You don't need to understand the math behind it, but at least be comfortable in how to design an algorithm. Leetcode: I first did the "Top Interview Questions" collection (available for free), I did the medium collection fully and some of the problems from the hard collection. It's good because it exposes you to a lot of different areas (you need to be good at ALL of those). Then I bought Leetcode Premium. This unlocks company tags (useless for some companies like Google, more useful for Microsoft and others). I spent 90% of my time doing the "mock interviews". Trust me, that was the thing that really made me excel in my interviews. The mock interviews give you a strict time limit, and in the end, they give you a percentage rating against all the other people that did the same mock interview set. This is much, much more useful than looking at the percentile for individual problems since many people just copy and paste the code from the top most-voted answer and get 100% percentile, making the average score go up. In a mock interview you don't have access to the discussion forum (of course, you can open another tab and cheat, but I feel like most people won't do that). Be really comfortable with easy questions. This means <5 minutes each, at most. Binary search, sorting, simple data structure operations must be automatic. Medium questions are the most important ones to do in order to prepare for interviews. Don't spend too much time on hard questions: if you are comfortable with mediums, then usually hard questions are just a intricate mix of medium questions. If you can't get to a solution after 30 mins (or 1 hour if you feel like you're close), just look up the solution, and then go back and solve the question in your own code. Don't copy and paste! Once you're comfortable solving questions, focus on speed. Mock interviews are good for that, because they give you a time limit and put you under pressure. My target times were: Easy: < 5 minutes. Medium: < 15 - 20 minutes. Hard: < 30 - 40 minutes. I achieved the desired target time for easy and medium questions, but hard questions can be really frustrating and never achieved a consistent < 40 minutes. Some hard questions I was never able to solve, and that's fine. Focus on medium. My ratio was 20/70/10 easy/medium/hard. I had one month to prepare, I did around 200 leetcode I would say (unfortunately problems solved in mock interviews are not counted towards the total solved, so I'll never know how many I've actually solved). Then, identify one area where you suck. In my case, dynamic programming. Read up tutorials / book chapters / explanations on that area, and understand the solution to common problems really well (like rod cutting for dynamic programming). Then go to the relative section on Leetcode and start doing them until you feel good. After doing like 15 dynamic programming questions I finally felt like I could get the hang of it. In terms of tutorials: do not use random online resources! I can't stress this enough. There's so much crap online that you don't want to get inspiration from! GeeksForGeeks is a terrible resource, for example. Answers are often wrong, with bad English, terrible explanations, and the site has a horrible interface. Prefer blog posts from reputable sources (like actual interviewers), or books. Just search your problem on Google and choose wisely (look at multiple explanations!). I hope this helps! TL;DR: Leetcode mock interviews saved my life. Use real resources, not random online blogs. Focus on correctness, and then speed.
This is amazing! Thanks for the advice! :) Mind me asking how many YOE you have? Did you also happen to study for system design?
< 1 YOE (just some internships). I did spend a couple of days on system design (I read some of the free content of Grokking the system design), but didn't focus on it because I was told there would be only coding interviews. Definitely not enough if you know they'll focus on system design though.
Amazing post
🍿
Dude what is CLRS?? And what is the different between that book and CTCI? I was thinking to buy CTCI but now that you said that I am not sure
Introduction to Algorithms
Is that the name of the book?
One of the useful posts! Thank you and congratulations!
Thanks a lot for this amazing post ! Can I DM you ? I need some guidance
Sure, can't guarantee that this account will be valid for a long time though.
Congratulations!! Dont you find the algorithm book clrs to be too much to do. I.e its lot of theory. Did u focus of specific ones ?
It does have a lot of theory but you can just skip the math heavy parts. I'd recommend just go over the basic chapters that detail Big O complexity, sorting, and common data structures (arrays, linked lists, hash tables, trees and graphs). Then venture into specific topics such as dynamic programming or advanced sorting algorithms. Many do not know, but the book has a very simple and slick algorithm for the median of two sorted arrays that is way easier to reason about than most code you find online.
I would suggest "Algorithm Design Manual" by Skiena for interview prep over CLRS. Using CLRS to prep for interviews is the equivalent of reading a dictionary to learn English. CLRS is really a reference textbook for undergrad algo courses, using it for interview prep is severe overkill.
It is overkill if you have 1-2 months to prepare. If you prepare 6 months in advance, you may as well read an algorithms book. I mean, it's actually useful in real life. I agree that Algorithm Design Manual is a good book.
What about EPI would you recommend it?
In my opinion EPI is better than CTCI but aimed at someone with some background. But as with all things, it's a matter of preference. If you feel like CTCI helps you, go for it.
Product Talk
15h
659
Why do you own an iPhone?
Tech Industry
Yesterday
1110
Do you really think Amazon is that bad
Tech Industry
Yesterday
2174
I paid 250 for a Google Referral and got Scammed
Tech Industry
Yesterday
847
Best LCOL or MCOL city?
India
Yesterday
1715
Slavery has REVERSED! the US is the slave!!! Check out this dude who pays a personal trainer in India
Bless your heart for taking so much time and effort to post this. Good job. And more importantly congratulations 🥳