Ask HN: Is there merit to Leetcode without courses?

16 points by canaus ↗ HN
I have around 2 years of experience in software engineering (realistically web development). I work at a decently large and recognizable company for my area, but would like to join a FAANG, mostly due to compensation and career recognition.

I have heard Leetcode is a good way to prepare for FAANG interviews, but I don't have a strong algorithms background. Should I try and take free courses (MIT OCW or something similar) prior to working with Leetcode?

13 comments

[ 2.8 ms ] story [ 36.7 ms ] thread
If you've never taken a course in data structures and algorithms - take one. Especially if you'll be tested on them; it seems like the obvious thing to do.
Would going through the entire course, along with coursework and readings provide enough understanding to forego Leetcode and to start interviewing?
Probably not. You need to practice. As a fellow self-taught engineer, I'd say it's worth doing. Check out something like algoexpert.io or one of Andre Neagoie's courses on Udemy to get a mix of theory and practice.
Take the class and do some leetcode practice. Also, don't look for shortcuts.
Sorry for effortposting where it's potentially unnecessary.

Many traditional textbook problems show up on LeetCode: for example, #23, #72, #141, #207, #322. They have textbook answers (of the kind that you're unlikely to reinvent starting from nothing). I could teach a somewhat disjointed introductory course on algorithms entirely from LeetCode problems. I could do that because I can tell which problems are typical, and which ones are distracting, exotic, time-consuming variations. For example, LeetCode #1 is a common textbook technique, #2 is a simple exercise in being careful, #3 is somewhat tricky, and I haven't seen #4 in the wild anywhere outside LeetCode. The solution that LeetCode authors propose for it is complicated and poorly explained.

People do compile curated sets of LeetCode problems. Without curation, you will waste a lot of effort on time-consuming, but less relevant problems. And it's also not clear how you would assess the quality of someone's curation. It's not like university professors release their own lists of LeetCode problems you should tackle. (One possible exception to this is the newest edition of Skiena's Algorithm Design Manual, which makes reference to relevant LeetCode problems here and there.)

The final problem with LeetCode is that the user-led discussion boards are occasionally helpful, but at most times are just awful rabbit holes of people competing on trivial runtime differences and code golfing their solutions. I think immersing yourself in LeetCode comments is a very reliable way to learn dysfunctional coding habits and pick up a distorted worldview of how to approach the coding part of an interview.

Is there a curated list of problems you would reccomend?
I don't really have one, but you can find a bunch of repositories of individual people's solutions if you search for "LeetCode" using HN search.

Simply Googling around brought me to this, which seems as good as anything else: https://seanprashad.com/leetcode-patterns/

Leetcode will teach you algorithms assuming your read the solutions and various tutorials on the site. You might have more breadth by taking a course though — there are only so many algorithms that fit into a LC style problem.
Just do Leetcode and research all of the data structures and concepts you encounter.

This was wayyyy better than the algorithm course I took.

It's easy to understand DSandA way harder to use them in practice.

Note: unless you're super gifted, expect this to take a LONG time.

I kind of treated like going to the gym where I try to do it everyday and make it kind of a lifestyle more than a one time thing.

I don't think leetcode is useful at all.

Any good CS/Engineering program should have a good algorithm and data structure course.

If all you care about is passing tech interviews: do Leetcode.

If all you care about is learning about algorithms and data structures: do courses, get a degree and/or read reference books.

Leetcode to help you jump through hoops, books/courses/degrees and non-trivial projects/real-world experience to help you actually do the work.

I'd like to think that a course sequence in algorithms and/or preparing for an algorithms qualifying exam would enable you to ace leetcode and whiteboard interviews, but I'm not entirely sure that is the case. Leetcode and whiteboard interviews seem a lot closer to so-called programming competitions.

> but I don't have a strong algorithms background.

Very few people would say they have strong algorithms background even if they did research in graph algorithms.

Can you solve Leetcode easy?