Red-Green-Code

Deliberate practice techniques for software developers

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

LeetCode Tip 45: Forgetting and Remembering

By Duncan Smith Nov 15 0

LeetCode 2023

Solving LeetCode problems is a specialized type of programming. Just as some programmers like to work on low-level code for embedded systems, and others are experts in web applications, programmers may choose to learn interview programming using LeetCode.

But while programmers use their real-world specialty every workday, they might go years between job interviews. So if you’re going to invest more than a little time in LeetCode practice, it’s worth thinking about how best to retain your hard-won interviewing skills during the time between interviews.

To learn more about the ideas in this tip, see No, You Haven’t Forgotten Everything by Scott Young.

Here’s the canonical LeetCode interview preparation process:

  • Step 1: Decide that it’s time to look for a job.
  • Step 2: Grind on LeetCode for a few weeks/months.
  • Step 3: Interview with multiple companies. Get multiple offers. Make them fight each other.
  • Step 4: Profit

During the time that you’re preparing for interviews, there’s an immediate benefit to carving out time in your schedule for LeetCode practice. But once you accept an offer, you have other priorities. Rather than proving your value in an interview, you’ll be proving your value by ramping up on your new job. So how do you avoid losing all your LeetCode skills while you’re busy doing real-world programming?

To answer that question, it helps to understand why we forget things. The obvious answer is disuse. The more time that goes by since you last implemented Dijkstra’s Algorithm, the more likely it is that you’ll forget some details.

But there’s also a less obvious explanation for forgetting: interference. According to the theory of interference, we never truly forget anything. Some memories are just more difficult to recall. As an analogy, imagine that there’s a web page that has some information you’re looking for, but you’re having trouble finding the search query that returns it.

Interference is problematic because it prevents you from remembering something that you need. But it’s also useful because it focuses your brain on the memories that are most relevant to your current needs. For example, if you’re working on a real-world programming task, you might not want to remember every LeetCode pattern you have learned. But in an interview, you would like to have access to those memories.

To recall the right memories at the right time, you can take advantage of the brain’s system for bringing less used memories back into active use. As explained in LeetCode Tip 43: Find the Zone of Optimal Improvement, the brain maintains a retrieval strength for each memory, which it increases when a memory is useful but difficult to retrieve.

This system is the key to maintaining your LeetCode investment. If you learn a topic thoroughly the first time around (e.g., by using the process outlined in these tips), you can be confident that it will be stored in your long-term memory. So when it’s time to prepare for another interview, you can wake up these hard-to-recall memories, rather than learning topics from scratch. Then, when it’s time to go back to full-time job mode, you can let those memories go dormant again.

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