Red-Green-Code

Deliberate practice techniques for software developers

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

LeetCode Tip 44: Taking Advice

By Duncan Smith Nov 8 0

LeetCode 2023

Ask any experienced LeetCoder what you should do to improve, and they’ll give you the same answer: practice. These tips also focus on practice, and for good reason. If you want to learn to solve LeetCode problems, there’s no substitute for practice. And it’s challenging to practice consistently, so regular reminders can be helpful. But you can’t just practice.

In Most Books Won’t Change Your Life (But You Should Read Them Anyway), Scott Young considers the value of “advice books,” defined broadly as any book that might convince you to change something in your life. As anyone who has tried to implement advice can attest, it’s a lot easier to read advice than it is to make a change. So the question is: should we only read an advice book if we have time to try out what it recommends?

Translating this question to the world of LeetCode practice: Should you only read a book or article if it applies directly to your current practice topic? For example, if you’re learning binary search, should you only read the binary search section in an algorithms textbook, or maybe something about loops and arrays?

The idea of mapping your reading list to your practice schedule seems reasonable. Technical material is hard to read and understand. Pairing it with a hands-on problem-solving is a standard way to make learning more effective.

But Scott, using the economics concepts of marginal costs and marginal benefits, argues that it’s worth reading more than just what you can directly use. In this calculation, marginal costs are the costs of buying and reading books. For example, a typical nonfiction book (not a textbook) might cost $20 and require 20 hours to read. If the marginal benefit you get from reading it is more than $20 plus the value of 20 hours of your time, you come out ahead.

To help calculate the marginal benefit of reading, here are some ways that reading can help with coding practice, beyond just showing you how to solve a problem:

  • Avoid bad choices: A book can warn against bad architecture, design, or practice choices, so you know to avoid them.

  • Build your idea list: When you’re ready to implement a new idea, like a problem-solving strategy or an algorithm, you can only pick from the ones you know about. When you read about an idea, you can add it to your list. If you regularly add to your list, and bubble better ideas to the top, you’ll always have good ideas to choose from.

  • Create patterns of thinking: Some ideas are more about a general approach than a specific procedure. For example, the idea of keeping a practice journal can help you become more intentional about your learning. Once you know about that idea, you can implement it as you work on other things. It’s not the type of idea that you have to carve out time to practice on its own.

  • Find coding buddies: If you work or study with experienced people, some of it will rub off on you. Reading books lets you learn from a wide range of experts, even if you don’t work with them directly.

  • Win the coding lottery: Beyond the reliable benefits of reading, there is the element of luck. It’s always possible that you could read something in a book that helps you pass an interview or solve a difficult problem at work. The potential benefit of such an event could more than make up for what you invest in your reading habit.

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