Live data from Hacker News

A guide to learning algorithms through LeetCode

github.com

101–110 of 222 posts

Re: A guide to learning algorithms through LeetCode

#101

It's becoming obvious to me that my time is better spent learning to solve these riddles rather than actually becoming a better developer. I have a job search coming up at the end of the year and whilst I've managed to largely avoid companies that ask this type of question, I believe it's seriously constraining my career. I can't speak for everyone but the whiteboard interview has prevented me from leaving jobs earli…

I spent a lot of time practicing leetcode, interviewed a bunch of times (4 times, about 25 technical interviews) at FAANG without getting an offer. They always tell me it was very close (or even that I passed, but they didn't find a team in the following month and asked me to reapply).

What leaves me with a bitter taste is that they don't seem to value the experience on my resume (e.g. OSS and tons of github projects, blog or scientific articles, things written by me they could actually check). It feels like they will favor a candidate who can solve leetcode problems a little bit faster to someone who is a more experienced SWE. Also the whole thing seems pretty random.

Also practicing leetcode feels like wasted time. It's not uninteresting but after you solve 500 problems, it starts to get uninspiring. There are cooler things to do for personal development, especially when you already have a demanding job.

But well, that's part of the game... at least the rules are clear, and the interviewers/recruiter are usually pretty nice.

Re: A guide to learning algorithms through LeetCode

#102
post #85

Earlier quoted context omitted.

> I can’t compete against people who essentially seem to have no life or other interests than getting job at Big N (or enjoy competitive programming). Interview prep doesn't need to be a grind. One of the nice things about Leetcode is that the problems are bite-sized. You can do one or two per day on your lunch break and make a lot of progress in a matter of months, or even weeks. Don't approach it like a cram sessio…

> All things considered, spending 50-100 hours of your free time solving problems on a free website at your leisure is really a small price to pay. The problem is - it's not 50-100 hours for most candidates to pass. I've done well past 400 hours of interview prep and never received an offer from Big N. I tried the consistent 1-hour or so a day for months thing - it isn't guaranteed either. Want to emphasize this poin…

I don't think it's just about solving the problem.

It's also about: - how you convinced yourself and the interviewer that your solution was correct (essentially an informal proof of your code)

  - how you test your code after you finish coding

  - what clarifying questions you asked to tease out a concrete question

  - what edge cases you thought of and how you handled them

  - how you handle bugs if they appear in the code

  - what solutions you presented and what their tradeoffs were, and why you decided to use a particular solution

  - whether your code was idiomatic

  - whether you used clean abstractions

  - maybe also comments and variable naming

... and probably others I'm missing.

I don't deny that interviewers have their biases, but I would hope that your interview performance is the major factor in whether you received an offer. There are plenty of people at Google and Facebook who haven't majored in CS at a top school.

Re: A guide to learning algorithms through LeetCode

#103

It's becoming obvious to me that my time is better spent learning to solve these riddles rather than actually becoming a better developer. I have a job search coming up at the end of the year and whilst I've managed to largely avoid companies that ask this type of question, I believe it's seriously constraining my career. I can't speak for everyone but the whiteboard interview has prevented me from leaving jobs earli…

I spent a lot of time practicing leetcode, interviewed a bunch of times (4 times, about 25 technical interviews) at FAANG without getting an offer. They always tell me it was very close (or even that I passed, but they didn't find a team in the following month and asked me to reapply). What leaves me with a bitter taste is that they don't seem to value the experience on my resume (e.g. OSS and tons of github projects…

“ Also practicing leetcode feels like wasted time.”

I think take home assignments are worst in terms of wasted time. At least your leetcode skills are transferable whereas take homes rarely transfer.

Re: A guide to learning algorithms through LeetCode

#105

I find this little sub-industry building up around, “the coding interview,” to be highly strange. Where are the papers that correlate this niche, specialized skill to general job performance and productivity? I get that at certain problem domains the asymptotic complexity becomes a baseline for performance so I’m not against testing people’s knowledge where it’s appropriate. But is it really the dominating skill? Rea…

> Where are the papers that correlate this niche, specialized skill to general job performance and productivity? I would love to read this research if it existed in the public domain. However, much of this comes down to trade secrets and business practices. It's also not very amenable to controlled studies. Practically speaking, these companies have a lot at stake in their hiring process. It's strange that so many pe…

On your last point, the best alternative I've seen is take-home projects where it would take less than a week to complete. The interviewer is free to frame a problem in a way that allows the engineer to apply their real-world experience and show their fit for the job. It removes all the variables around interview stress/anxiety and as a result is a better (but not perfect) indication of their performance.

Re: A guide to learning algorithms through LeetCode

#106
post #97
post #40

Earlier quoted context omitted.

Do you think it's unlikely for you to learn those skills quickly? People who have all those skills earn over $300K at those companies.

My experience of FAANG interviews outside the US is that the salaries they offer are really disappointing compared to the US. Other industries like finance were a better deal compared those companies. If I can get paid £90-110k in the City why bother working for Facebook were they were offering less than £90k? Note, I don't consider bonuses or equity to part of salary.

“ Note, I don't consider bonuses or equity to part of salary.”

Depending on the company and how much the stock appreciates this can easily be +50% of your total take home so I’m not sure why you’d discount it.

Re: A guide to learning algorithms through LeetCode

#107

I find this little sub-industry building up around, “the coding interview,” to be highly strange. Where are the papers that correlate this niche, specialized skill to general job performance and productivity? I get that at certain problem domains the asymptotic complexity becomes a baseline for performance so I’m not against testing people’s knowledge where it’s appropriate. But is it really the dominating skill? Rea…

>I find this little sub-industry building up around, “the coding interview,” to be highly strange.

You should see the sub-industries around passing a board exam. Most of us really don't understand the privilege we have relative to other high paying professions.

Re: A guide to learning algorithms through LeetCode

#108
post #8

This is really cool. What order are the chapters in? Seems intense to lead with dynamic programming.

I got really good at dynamic programming problems but then none of the companies I interviewed with asked me a dynamic programming problem. These were large tech companies and well funded startups. Perhaps it was just luck.

Questions with DP solutions are usually not particularly great for interviews. They usually don't have any solutions in-between brute force and DP. If somebody doesn't come up with a DP solution you, as an interviewer, just learned that they don't know DP, but it doesn't give you too much useful signal on the candidate's skills. DP is just kind of a trick that you can learn to solve this specific type of problems, but knowing the trick is not something that FAANG companies want to test for.

Re: A guide to learning algorithms through LeetCode

#109
post #42
post #4

Thanks for the write up and git book. Related question: I’m curious if any has game-ified algorithm learning, sort of like those old educational math games targeting certain grade levels. Might be cool to make a point and click adventure centered around dynamic programming or greedy algorithms.

There are plenty of competitive programming sites where you can grind rating just like you would for MMR rating in video games. For example CodeForces, AtCoder, TopCoder, and even LeetCode have rated contests

Thanks ghj.

I was aware of top coder/leet code, though hadn't heard of code forces/at coder.

For me the adventure game give a bit more concept linkage. Take Monkey Island, I can remember how to reply to many of the sword fighting insults, or what was needed to get pieces of eight via the cannon at the circus. There's something to be said for linking problems via a memorable story, giving examples and meaning from multiple angles helps retain the content over the dryness of problem prompt/quick solve.

Re: A guide to learning algorithms through LeetCode

#110

Earlier quoted context omitted.

Take the same energy and apply it to learning to build testable and understandable code. If you can go from nothing to smoking an algo interview in months you’re a fast learner. You’ll be fine.

I think that's what these leetcode type questions are good at. You're either naturally adept enough to do well, or internally motivated enough to memorize/learn them. Either way, it's a decent signal for a company that needs someone to learn their internal, proprietary techstack

> You're either naturally adept enough to do well, or ...

I'm personally very wary of using algorithms questions as a proxy for how "adept" someone is at software engineering. If I were running a business, I'd personally want to make sure people could manage technical debt and build decoupled systems.

I have had multiple positions at FAANG companies, and despite being "adept" according to these algorithms questions the systems built by these highly-paid (and, around me, generally experienced) people are pretty awful in terms of quality and maintenance.

Learning a proprietary stack also hampers effectiveness in future positions if wanting to opt-out of FAANG later on.

Post reply on HN