If you believe in the goal of preparing for coding interviews and you agree that LeetCode is a good way to pursue that goal, you may feel like getting on the site and building a daily streak. But it’s important to pick the right priority to focus on during this daily practice. While you can get some benefit out of simply opening LeetCode’s daily challenge problem and trying to solve it every day, there’s something missing from this type of practice. This year’s tips will fill in the gaps in the familiar “practice, practice, practice” approach.
Companies don’t use algorithmic coding interviews to test you on every conceivable computer science or software engineering topic. They focus on a relatively small set of concepts. You can find these concepts in the list of tags on the LeetCode problem page. Ordered by how often they appear in the LeetCode problem set, the first 10 concepts are Array, String, Hash Table, Dynamic Programming, Math, Sorting, Greedy, Depth-First Search, Database, and Breadth-First Search.
With this list of concepts in mind, we can target a more specific practice goal. Rather than practicing the skill of “solving LeetCode problems,” we can instead practice the skill of “solving Dynamic Programming problems” or “solving Depth-First Search problems.” That’s not to say that this skill will give you what you need to solve any problem, since you won’t always know which concept you need to use. But if you suspect that you’re looking at a Depth-First Search problem, it won’t do you much good unless you know how to implement Depth-First Search.
With that in mind, our first set of LeetCode tips will look at a process for learning the LeetCode algorithms, data structures, and techniques found in the tag list. We can ignore, for now, the general problem of how to solve a random LeetCode problem. Instead, we’ll focus on choosing a LeetCode tag and learning how to solve problems associated with that tag. If we can do that with one tag, we can do it with two tags, then three tags, and so on. Eventually we’ll reach the point where if we know which concept a problem requires, and if the problem has a reasonable difficulty level (i.e., Easy or Medium), we’ll have a good chance of solving it. No flashes of insight required.
This year, I’m publishing a series of tips for effective LeetCode practice. To read the tips in order, start with A Project for 2023