Live data from Hacker News

A guide to learning algorithms through LeetCode

github.com

61–70 of 222 posts

Re: A guide to learning algorithms through LeetCode

#61

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…

Kind of a meta point, but why do you call it the whiteboard interview? I think that was more popular 5 to 10 years ago, actually writing code or pseudocode on a whiteboard. In my experience the leetcode style questions most companies use today have you actually write and execute code in a sandbox environment.

It may be that the algorithms you’re required to come up with are still overkill in that they’re things you would not normally need to write from scratch on the spot without being able to references any resources in your day to day work. But as far as the format goes, this style of actually writing and executing code is clearly an improvement on the write-code-on-whiteboard style of interview.

I feel your pain though, the weeks of study that almost any good engineer needs to put into preparing for interviews can be pretty grueling.

Re: A guide to learning algorithms through LeetCode

#62
post #51

Earlier quoted context omitted.

Have you looked into being a software person in a non-software (or only "software-enabled") company? You'd probably get a pay-cut vs. FAANG or whatever, but it wouldn't exactly send you tumbling into the working class. I really enjoyed working on software in biotech, for example, where I started my career... and sometimes think about returning with all my software-company chops to see if it's still as fun!

I suppose it might depend on the domain / industry. Biotech sounds like it has the potential to be interesting, but I currently work for a large non-tech company and have worked in government and don't like the being considered the cost center or having to deal with the seemingly unending layers of bureaucracy.

In biotech, at least back in the day, bureaucracy depended on company size and nationality, and there never seemed to be enough hackers for all the random tech stuff that needed doing. I'm sure it's changed a whole lot since then but as a general point, it was a lot more diverse along any vector you like than the software world.

Maybe you should find a startup with no layers of bureaucracy and no cost centers yet? This being HN, there are plenty of them around.

Re: A guide to learning algorithms through LeetCode

#63
post #38

Gosh, I don’t enjoy that there is so much competition in this space. 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). It feels like this culture has ramped up in the last 5-10 years. When I started interviewing, the questions were easier. It feels like they’ve gotten more difficult - or at least the answer the intervie…

> 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 session before your interviews. That doesn't work unless maybe you're a new college grad with no other obligations.

> go look at the leetcode discussion forums. There’s almost always some post at the top saying, “I did 1000 problems and won’t stop.

Obviously the Leetcode forums are going to be a hotbed of discussion about Leetcode. You have to keep in mind that many of those people are entry-level developers treating this as an extension of their education. For them, it's basically a miracle that a mostly-free website lets them practice for interviews for $200K-300K+ career paths from the comfort of their web browser. Compare that to just about any other high-paying industry, where getting the right education, credentials, certifications, and test results will take years of your life and potentially hundreds of thousands of dollars of post-secondary education. We really have the easy end of this deal.

Don't let the total number of Leetcode questions overwhelm or discourage you. It shouldn't be approached as a cram session before the interview. It should be approached as a consistent habit or practice over a longer period of time.

If you just don't want to do any Leetcode or whiteboard interviews, that's fine too! There are plenty of jobs out there that won't require any of that.

However, you can't have it both ways: Big N salaries come with a high barrier to entry. 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.

Re: A guide to learning algorithms through LeetCode

#64
post #59

Earlier quoted context omitted.

Bullshit. It has been my personal experience, and the experience of many people I’ve spoken with, that this kind of trivia is learned in order to get a job and then forgotten immediately afterwards because it’s useless. Anecdotal example: a former colleague is an incredibly talented systems programmer and has had to study leetcode garbage for the last few months in order to feel qualified to interview for a position…

I don't think the knowledge is useless as much as it's properly abstracted away into core libraries for 99.999% of the real-world use-cases. Maybe the questions started as "IQ tests" (or a proxy for "fresh out of a Stanford-like CS Program?") but my impression is that now it's a mild (or not) proxy for hazing. "I suffered through this crap and by God you are going to suffer through it to, or you can't join my little…

I think knowledge of the concepts is very useful, but precise recall of the algorithmic implementations is absolutely useless.

It’s very different for someone to have a solid grasp of, say, cache-aware programming techniques, algorithms and data structures that are necessary for low-latency architectural work, etc.

...but I’m aware of very few positions (if any???) that require the ability to arbitrarily synthesize that information on the spot.

EDIT: Originally meant to lead with the fact that I broadly agree with what you’re saying, I just wanted to clarify my original objection.

Re: A guide to learning algorithms through LeetCode

#65

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 was working on a “startup”/kinda just unemployed for two years. I studied leetcode hard, and got hired into a 300k a year job at FAANG. I know nothing about testing, git, software process, roll outs, dev ops, etc. I barely know how to do software engineering. What an idiotic hiring process.

Interviews are only partially about testing your body of experience. They're also supposed to test your aptitude and ability to grow in the future.

If you were capable of studying Leetcode so hard that you mastered the interview process at one of the most selective software companies in the world in only a few months, it's not much of a stretch to imagine that you could apply that same aptitude, ambition, and ability to learn quickly toward picking up the basics of git, dev ops, and so on.

Arguably, this is one of the benefits of Leetcode-style interviews. They focus on core software engineering aptitude, while not arbitrarily excluding people because they didn't use the right VCS at their last job.

Re: A guide to learning algorithms through LeetCode

#66

Earlier quoted context omitted.

I was working on a “startup”/kinda just unemployed for two years. I studied leetcode hard, and got hired into a 300k a year job at FAANG. I know nothing about testing, git, software process, roll outs, dev ops, etc. I barely know how to do software engineering. What an idiotic hiring process.

Interviews are only partially about testing your body of experience. They're also supposed to test your aptitude and ability to grow in the future. If you were capable of studying Leetcode so hard that you mastered the interview process at one of the most selective software companies in the world in only a few months, it's not much of a stretch to imagine that you could apply that same aptitude, ambition, and ability…

> it's not much of a stretch to imagine that you could apply that same aptitude, ambition, and ability to learn quickly toward picking up the basics of git, dev ops, and so on.

But you already have your reward, right? I’m not sure how much ambition is left after you actually get the job.

Re: A guide to learning algorithms through LeetCode

#67
post #55

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 am trying to resist cynicism, but I too am thinking that after my upcoming sabbatical if I want to get top dollar I should just invest in power-grinding at the leetcode gym. Still hoping to find a friendly startup though, since some of the MegaCorps are lifestyle-incompatible and I'm already used to making a lot less than Googlebucks.

> after my upcoming sabbatical if I want to get top dollar I should just invest in power-grinding at the leetcode gym

Given that top dollar can mean potentially a six-figure raise over median salaries, that doesn't exactly seem like a bad deal.

All things considered, Leetcode is remarkably accessible relative to the barriers of entry in other high-paying fields like law, medicine, certain finance careers, and so on. It's a mostly-free website that you can work through at your leisure from the comfort of your home, with plenty of Google results to walk you through the questions if you run into a problem.

Have you spend some time on Leetcode already? I could see how the questions could be daunting to new grads, but I didn't find it all that painful with several years of industry programming experience.

Don't get discouraged by the sheer number of Leetcode problems. You don't have to do them all to get value out of it. The key is to do a couple per day in your free time (lunch break, while you eat breakfast, whatever). Any consistent practice will add up over weeks or months.

Re: A guide to learning algorithms through LeetCode

#68
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?

Reading some of the comments of people who went through the pipeline of this cottage industry, it sounds like it’s not even useful after you get hired. In fact optimizing for it to get through the interview sounds like a bad idea! Imagine landing the job and having no other skills.

I’m curious how these algo expert/monster/crushing the interview businesses survive and perpetuate this highly competitive environment.

Re: A guide to learning algorithms through LeetCode

#69

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 was working on a “startup”/kinda just unemployed for two years. I studied leetcode hard, and got hired into a 300k a year job at FAANG. I know nothing about testing, git, software process, roll outs, dev ops, etc. I barely know how to do software engineering. What an idiotic hiring process.

That’s because at FAANG those problems are already solved. And there’s a team of experts working on each of them. Maybe multiple teams.

Your job is to be a clever code monkey. The Process will take care of turning your coding into engineering.

Leetcode interviews are great at testing for just that. A high IQ willing to solve arbitrary puzzles just because someone said “solve this”

Re: A guide to learning algorithms through LeetCode

#70

Can you imagine having to learn all this just to make a connection to a database, process some data, and then persist it somewhere?

The popular sentiment on computer science knowledge has done a complete 180 in the past several years.

Not that long ago, it was popular to complain that junior SWEs didn't really understand the algorithms, the data structures, and what was going on behind the scenes. The complaint was that they were just copy and pasting from internet searches until things sort of worked on their machine, but they couldn't recognize when an O(n^2) solution was going to work on their local n=10 test set but bring down the main website.

Now that knowledge of CS fundamentals has become valued in interviews, the pendulum has swung the opposite way. We have more free resources than ever before to practice and study CS fundamentals, algorithmic challenges, and even practice your interview skills. It's never been easier for a junior SWE to sit down, put in the effort, and work their way into a $200-300K job with sufficient dedication. Yet people never tire of complaining about Leetcode or having to understand CS fundamentals online.

Personally, I've never met anyone who was good at Leetcode yet produced bad code in production. I'm sure there's someone out there who knows a guy who knows a guy who can somehow ace Leetcode but can't write an efficient website backend, but it's not the norm.

Post reply on HN