Hacker News new | ask | show | jobs
by evercast 1622 days ago
I don't see this mentioned by other commenters so let me provide another perspective. Namely, I think OP is doing it wrong.

OP claims to have done 400+ LC problems over a couple of months. Let me say it out loud here: this is simply crazy. It strikes me as an attempt to not learn how to tackle these challenges, but to actually brute-force through them. To anyone preparing for an interview: don't do this! Grab a book like Elements of Programming Interviews (EPI), maybe follow some online courses on programming puzzle patterns, and then start grinding LC. Maybe interleave grinding with learning? Your end goal should be to develop deep understanding of what you are doing, not memorise the solutions.

Also, while going through LeetCode, it is very important to realise that the problem classification there is a bit wild at times. Don't stress that you cannot solve a medium sometimes as they are mislabeled. I did mediums that could be hards, hards that could be mediums, and hards that were just impossibly hard. Typically a very hard problem is not something you should expect in an interview setting as most interviers* don't expect you to implement KMP on the spot. Doesn't hurt to know it and impress the interviewer with knowledge, but if you think memorising KMP is the way, you're mistaken.

* - there is still luck involved and you can have a crazy interviewer. It can happen, so just accept it and move on. Don't treat it as a personal defeat.

Source: I grinded and I had offers from most of FAANG letters.

4 comments

Yeah, I practiced leetcode by spending about an hour a day for 2 months, but I had only done around 60 LC total (25 medium, 35 easy).

I didn't feel a need to do much more as they had very similar patterns. I did attempt the ones I had solved more than once though, but it was to really drill in the principles behind the problem rather than to try and "memorize" them.

Prior to my prep, I had almost 0 algorithm experience. I got an offer from every FAANG I applied for.

Going to call bullshit on that, since in recent interviews most people have been getting hard problems and not "trapped rainwater" prefix sum hard problems, but the kind where the optimal solution has nearly 100 lines of code involving multiple steps (topological sort combined with dp and other garbage at one go).

Easy problems literally mean jack and I don't even think 50 medium problems could span all of the possible topics.

Sounds like you got in when it was easier.

It was 2019, so things may have changed but I doubt it. Maybe I was lucky? Or maybe you were unlucky. I also applied as a Senior SWE (mobile) if that makes any difference.

Out of the 12 companies I applied for I was given 2 hards (both were private startups), the rest were all mediums.

>nearly 100 lines of code involving multiple steps

I was never given anything even close to involving a 100 line solution. Are you sure this was even the correct/optimal solution? Either that or you're very unlucky. Which companies were asking such questions?

>50 medium problems could span all of the possible topics.

I was given problems that I hadn't encountered before, but I was able to solve them by deduction/critical thinking and applying the appropriate algorithms/patterns. Often the easy solution and the optimal solution weren't even that different, and just involved using a hashtable.

Grinding through hundreds of LC to try and memorize/familiarize yourself with the solutions really isn't the right method. Have you read Cracking the Coding Interview? Gayle McDowell has some videos on youtube in which she explains her process.

   I was given problems that I hadn't encountered before, but I was able to solve them by deduction/critical thinking and applying the appropriate algorithms/patterns. Often the easy solution and the optimal solution weren't even that different, and just involved using a hashtable.
Yeah, no.
this is the way. although your innate ability to learn and apply algorithms is probably above average :)
Including google and Facebook?
Yes, I accepted the FB offer.
This still seems off. If you wanted a deep understanding, you'd go for academic books about algorithms and data structures, then go try the leetcode problems without the coaching advice. Otherwise we're just coaching towards the particular interview format, which is only proving you can learn to game that particular format. Coaching for an interview format doesn't solve real world problems which is why people are annoyed about these interviews.
If its helpful, I did read one of those academic books (Segewick) thoroughly. But personally I found the practice questions laborious. You have to do the setup, you don't get the feedback. You don't know if its going to be easy or hard. And it takes some effort to see similar solutions. Conversely, once I paired with it with leetcode, I could e.g. finish reading about topological sort and then go look up common problems. I found alternative solutions, comparisons, got instant feedback, etc. To me, the combination of a quality DS&A book with leetcode for the raw (targeted) practice is a really great combination.
Adding to the comment about difficulty, the number and ratio of likes : dislikes on a problem is a good measure of difficulty. A Medium with 5K likes and 300 dislikes is probably quite a good (well-written, constrained, fair) problem. A Medium with 300 likes and 800 dislikes I'd steer clear of.
I'm more interested in how do you even get noticed by FAANG in the first place. I never get contacted by agents about them and applying just gets me ghosted every time?