Red-Green-Code

Deliberate practice techniques for software developers

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

LeetCode Tip 25: Deliberate Practice for LeetCode

By Duncan Smith Jun 28 0

LeetCode 2023

Unlike a real-world software project, LeetCode is set up for effective practice. But what is effective in general may not be effective for you specifically. So it’s worth thinking about the best way to practice. The framework I use is explained in Deliberate Practice for Software Developers. Let’s see how the five elements of deliberate practice apply to LeetCode.

Deliberate Practice Element #1: “It’s designed specifically to improve performance”

The LeetCode website is designed to help programmers prepare for coding interviews. So we could delegate responsibility for Element #1 to the LeetCode product managers and call it good. But that would ignore many improvements that you can make to optimize your own practice process through experimentation. By considering your goals, choosing problems carefully, writing detailed model solutions, using spaced repetition with carefully chosen interval lengths, writing a daily practice journal, and considering the other advice in these LeetCode tips, you can make your practice more effective than just opening the LeetCode website and going for it.

Deliberate Practice Element #2: “It can be repeated a lot”

This element doesn’t only mean repeatedly solving LeetCode problems. The skill that you need to repeat is more granular than one problem. Although you need to be able to solve a problem from beginning to end, and it’s essential to practice full problems, it’s also important to focus on smaller skills. As you practice problems, look for areas of weakness in skills like reading problem statements, translating a solution into pseudocode, fluently using the features of a programming language’s syntax and libraries, and selecting and implementing algorithms and data structures. When you run into trouble in one of these areas, find a way to practice it in isolation. The LeetCode website focuses on problem-level practice, so you may need to look elsewhere for some of these. CodingBat is a website that offers practice problems for more granular skills, though its features are rudimentary compared to LeetCode.

Deliberate Practice Element #3: “Feedback on results is continuously available”

The LeetCode UI is all about feedback. You get feedback through compiler errors, test failures, test data for failed tests, and the CPU and memory usage graph. But as with Element #2, you shouldn’t stop with the most obvious sources of feedback. You can generate useful information by tracking how much time you spend on each problem, writing notes in your practice journal, and comparing other implementations to your own. The goal is to determine exactly where your weaknesses are so you can focus your practice on them. This will accelerate your rate of improvement beyond what you would get just by practicing problems.

Deliberate Practice Element #4: “It’s highly demanding mentally”

LeetCode features can lead you astray when it comes to Element #4. Features like the daily challenge problem, the submissions graph, badges, and the solved problems counter. These are gamification features that are useful for building a regular LeetCode habit. But they aren’t always the best choice for deliberate practice. The daily problem might be too easy, might focus on a concept other than the one you’re currently studying, or it might be too easy or too hard. The submissions graph and problem counter might encourage you to submit a problem every day without thinking enough about what you’re getting out of that problem. So use these features to maintain your practice habit, but also set aside time to intensively practice the areas that you need to get better at.

Deliberate Practice Element #5: “It isn’t much fun”

Here’s a question from Reddit: Is competitive programming really worth it?

The top-voted answer:

It’s a hobby like any other. It’s like asking if making model trains is ‘worth it’.

Competitive programming and coding interview preparation aren’t the same thing, and people might be less likely to label LeetCode “a hobby like any other.” Nevertheless, preparing for programming competitions can be serious business, and is often used to get better at coding interviews. So it’s not all fun and games.

The message of Element #5 is that getting better at a skill requires hard work. So don’t be afraid to enjoy it, but if your goal is self-improvement, make sure that’s what you’re focusing on.

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