Red-Green-Code

Deliberate practice techniques for software developers

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

LeetCode Tip 18: Learn General Skills From Specific Problems

By Duncan Smith May 10 0

LeetCode 2023

Using a practice journal for your LeetCode practice helps you learn as much as you can from a single problem. This requires a different mindset than using a problem list from Tech Interview Handbook, NeetCode, or the Daily LeetCoding Challenge. When you use a problem list, your goal is to get a variety of experience from a set of problems. A practice journal, on the other hand, helps you learn one problem as thoroughly as possible.

You can learn a lot by working on one problem through multiple repetitions. Every LeetCode problem covers one or more common concepts. By repeatedly solving the same problem, you can focus on the concept rather than having to figure out a new scenario, as you would if you kept picking new problems. For example, there’s a binary search problem that asks you to add events to a calendar. The first time you solve that problem, you need to spend time understanding the scenario. But the scenarios in LeetCode problems are less complex than the associated algorithm. So it may take only one or two repetitions to master the scenario, at which point you can focus on the algorithm.

Although the scenario may be simple, it is still a useful part of the problem. Recalling the steps of an algorithm is difficult in the abstract. Studying algorithms with an associated a scenario gives your brain something to latch onto. When you encounter a similar problem, rather than having to recall “binary search,” you can instead recall “how to add an event to a calendar without double booking.” As you practice more model solutions for an algorithm, you’ll learn multiple scenarios that help you approach the algorithm from different angles.

Practicing the same binary search problems multiple times doesn’t directly teach you to solve new binary search problems. But it’s a prerequisite for that skill. It helps you master binary search and several associated scenarios. When you encounter a new problem that tickles your binary search sense, you can focus on the specifics of that new problem, confident that you have mastered the implementation.

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