The premise of these tips is that the best way to get better at LeetCode is to systematically learn model solutions to model problems. Just solving more problems (the problem quantity approach) or just solving problems at the right difficulty level (the problem quality approach) is not an efficient way to improve at LeetCode. Instead, you have to work through the LeetCode topics and learn the patterns for each topic. The preceding tips explain how to do that.

But there’s one skill that this process doesn’t directly address: solving problems you haven’t seen before. Given a problem in a topic that you have learned thoroughly by practicing model problems, you need to be able to solve a new problem in that topic. This is, of course, the goal of LeetCode practice. So at some point, as you’re learning a topic, you have to decide that it’s time to go beyond model problems and solutions.

**Practice**

Although solving model problems certainly involves practice, it’s a different type of practice from solving new problems. Solving model problems involves repeating skills in order to learn them better. To practice solving new problems, you just solve more problems. At this point, the quality plus quantity approach can work. Just solve more problems at the right difficulty level. (Solving a bunch of easy problems after you’re already good at a topic won’t make you any better at it). Quantity works at this point because you are applying skills you’re already good at. As you practice more problems, you reinforce these existing skills. And it works because most new problems will have a detail or two that you haven’t encountered in your study of model problems. As you solve more new problems, you’ll encounter more details that will round out your knowledge of a topic.

**Problem-solving skills**

If you try to solve a moderately difficult problem in a topic before you have learned that topic, you’re unlikely to be successful. Maybe you’ll manage to invent binary search completely from scratch. But you won’t be able to do that for every topic. So you have to learn the topics before moving on to practice.

Learning a LeetCode topic starts with learning information, like the steps of an algorithm, and learning to apply that information by solving specific problems. But at some point, you’ll have a solid grasp of how the topic works and how you can use it. Then what remains is practicing more general problem-solving skills. And although experts have come up with general principles for solving problems, there are a lot fewer of these principles than there are topic-specific principles. In fact, there’s a good argument that general problem-solving skills are really just the combination of many topic-specific skills. So while you can keep general principles in mind, you should spend most of your time on specifics.

**When to start solving unknown problems**

Although LeetCode has topic-focused courses that teach the fundamentals of a topic, it’s easy to get into a mode of just solving random problems using the daily challenge and the weekly contest. It requires effort and focus to go topic by topic instead. But learning a topic has diminishing returns. After you learn the basics of a topic, you should occasionally try solving a new Medium-level problem, to test your mastery of that topic. When you finish a new problem, evaluate how the process went. If you remembered all the applicable details of the topic, even if you struggled with other aspects of the problem, you may be ready to stop using model problems and solutions to learn that topic. Similarly, it’s good to spend some time practicing problems without knowing which topics apply. This is the situation you’ll be in when you’re in a coding interview, so it’s important to evaluate your performance in those circumstances.

*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.*