Red-Green-Code

Deliberate practice techniques for software developers

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

LeetCode Tip 41: Make Sure Your Skills Will Transfer

By Duncan Smith Oct 18 0

LeetCode 2023

To get better at coding interviews, you can practice LeetCode. To get better at LeetCode, you can study algorithms and data structures. To understand how algorithms and data structures work, you can study discrete math. When you study or practice one thing in order to understand or improve another thing, you are relying on a process called transfer.

To learn more about the ideas in this tip, see How Much Transfer Should We Expect Between Skills? by Scott Young.

Increase the overlap between skills

To help a skill transfer from one context to another, make sure there is an overlap between the two contexts. Programmers practice LeetCode problems because they expect the problems they’ll encounter in an interview will resemble the ones on the LeetCode problem list. But if we only practice solving problems and submitting them to an online judge, we shouldn’t expect those skills to transfer when the interviewer asks us to explain how our solution works, since the online judge doesn’t care about that.

Take advantage of increased expertise

A benefit of gaining expertise in an area is gaining more abstract skills that transfer more efficiently to other contexts. If you learn how to solve specific problems, your skills will only transfer to problems that fit the patterns you learn. But if you learn the process of finding a solution, you can apply it to a wider variety of problems.

Learn the fundamentals

Fundamental knowledge doesn’t directly transfer to practical skills. Being able to prove that Quicksort runs in average $O(n \log n)$ time doesn’t mean you can implement Quicksort, and being able to implement Quicksort doesn’t mean you can solve any LeetCode problem that requires a divide and conquer approach. However, understanding the fundamentals can help you learn more advanced topics. So it indirectly contributes to transferrable skills.

Use the right type of practice

According to cognitive load theory, the limited capacity of working memory can impede learning if we don’t take it into account in our practice. When we first study a topic, it’s best to use examples and practice smaller components that fit into working memory. For example, it’s best to practice easier problems when learning a new algorithm. Once you can fluently implement the algorithm in its basic form, you no longer have to keep the implementation details in working memory. Your fingers know how to implement it with little input from your brain. That frees up cognitive capacity to consider the details of a more complex problem that is based on that algorithm.

Don’t just practice the target activity

To maximize transfer, it may seem like you should just practice the activity you eventually want to master. For coding interviews, this would mean spending time in mock interviews. But although this would give you a lot of practice in explaining your thought process while solving problems, it wouldn’t be the most efficient way to learn every LeetCode problem type. Learning new problem types requires concentrating on the details of the problem, without having to think about the other parts of the interview.

Similarly, the best way to learn to solve LeetCode problems isn’t to spend 100% of your study time solving problems. Time spent studying and understanding the underlying algorithms and data structures can make problem-solving practice more efficient.

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