Red-Green-Code

Deliberate practice techniques for software developers

  • Home
  • About
  • Contact
  • Project 462
  • CP FAQ
  • Newsletter

LeetCode Tip 42: Getting Past a Learning Plateau

By Duncan Smith Oct 25 0

LeetCode 2023

When you first start using LeetCode, progress can be rapid. If you have programming experience but no LeetCode experience, you can get a general idea about this type of programming by solving a few easy problems. Similarly, when you first learn about a topic like binary search, it might only take a few hours before you can solve straightforward problems on your own. But then progress gets slower. Medium problems are trickier and take longer to master. To solve problems at that level, you have to understand the target algorithm well enough to customize it for each problem. And Hard problems generally require an algorithmic or mathematical insight that won’t come to mind until you have significant practice under your belt. So you may find that even after a lot of practice at this level, solving problems doesn’t seem to get any easier. A learning plateau is a point where continued practice doesn’t seem to improve results.

To learn more about the ideas in this tip, see The Intermediate Plateau: What Causes It? How Can We Move Beyond It? by Scott Young.

Here are three potential causes of a LeetCode learning plateau, and how to address them.

Harder problems require exponentially more expertise

Let’s say you spend a day studying a LeetCode topic and find that you can solve most Easy questions in that topic. Spending one more day won’t get you comfortable at the Medium level. It might take a week or a month, depending on your background. And Hard problems might require multiple months, as you study several related topics and integrate them to solve those trickier challenges.

The straightforward way to build exponentially more expertise is to spend exponentially more time studying. But you also have to consider your goals. Maybe you don’t need to master Hard problems, since they are less common in real interviews. You could instead optimize for breadth of knowledge, with the goal of mastering many topics at the Medium level. This will prepare you to handle the common question types that you might encounter in an interview.

Harder problems require a different kind of thinking

The easier a problem is, the more likely it is that you can solve it by applying a pattern. As you practice, you learn different ways to solve problems. When you encounter a new problem at the Easy or Medium level, apply a pattern you know, make a few adjustments, and solve it in 30-45 minutes.

If you try this approach with Hard problems, it’s not as likely to work. You might complete a solution that works for some test cases, but find that other cases are out of reach. Your solution likely won’t be efficient enough for large cases. Or it won’t be general enough, so you’ll need to add special cases for specific tests.

To resolve this dilemma, get back to basics. Return to topics that you already know, and study them again with the benefit of experience. Make sure you really understand why every part of an algorithm works, not just how to implement it. Study the mathematical models behind the algorithm. You may need to unlearn some techniques that you relied on to solve Easy and Medium problems, and learn to solve Hard problem using more foundational methods.

Solving harder problems requires more original thinking

Learning model solutions for model problems gives you basic patterns. To write a new model solution, you’ll start with someone else’s solution and modify it so it fits your style. Then you can practice and learn it so you can apply it to new problems. It will become part of your repertoire, and if you practice it on enough problems, you may barely need to think about it. But it nevertheless started out as someone else’s solution.

Since every problem on LeetCode has one or more posted solutions, you can take the same approach with Hard problems. Look through the solutions, find a good one, and turn it into a model solution. But this is less useful for Hard problems, since aren’t as similar to each other. Once you get to the plateau of Easy and Medium problem mastery, you have to spend more time inventing your own solutions using the experience you have so far.

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.

Categories: LeetCode

Prev
Next

Stay in the Know

I'm trying out the latest learning techniques on software development concepts, and writing about what works best. Sound interesting? Subscribe to my free newsletter to keep up to date. Learn More
Unsubscribing is easy, and I'll keep your email address private.

Getting Started

Are you new here? Check out my review posts for a tour of the archives:

  • 2023 in Review: 50 LeetCode Tips
  • 2022 in Review: Content Bots
  • 2021 in Review: Thoughts on Solving Programming Puzzles
  • Lessons from the 2020 LeetCode Monthly Challenges
  • 2019 in Review
  • Competitive Programming Frequently Asked Questions: 2018 In Review
  • What I Learned Working On Time Tortoise in 2017
  • 2016 in Review
  • 2015 in Review
  • 2015 Summer Review

Archives

Recent Posts

  • Do Coding Bots Mean the End of Coding Interviews? December 31, 2024
  • Another Project for 2024 May 8, 2024
  • Dynamic Programming Wrap-Up May 1, 2024
  • LeetCode 91: Decode Ways April 24, 2024
  • LeetCode 70: Climbing Stairs April 17, 2024
  • LeetCode 221: Maximal Square April 10, 2024
  • Using Dynamic Programming for Maximum Product Subarray April 3, 2024
  • LeetCode 62: Unique Paths March 27, 2024
  • LeetCode 416: Partition Equal Subset Sum March 20, 2024
  • LeetCode 1143: Longest Common Subsequence March 13, 2024
Red-Green-Code
  • Home
  • About
  • Contact
  • Project 462
  • CP FAQ
  • Newsletter
Copyright © 2025 Duncan Smith