Red-Green-Code

Deliberate practice techniques for software developers

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

LeetCode Tip 24: Coding for Practice is Different from Coding for Work

By Duncan Smith Jun 21 0

LeetCode 2023

There may be a way to design an effective interview process where candidates don’t have to prepare for the interview while companies still get the information they need to make effective hiring decisions. But no one has yet come up with such a process that scales to the needs of large companies. So we have the current state of affairs, where programmers need ways to prepare for interviews.

One justification for interview preparation is that the type of programming that people do for their jobs differs from the type of programming required for algorithmic coding interviews. So programmers prepare by practicing common algorithms that they may have forgotten from their student days. But even if your job is algorithmically oriented (maybe you’re implementing algorithms and data structures for a language library) interview-specific practice still helps. This is because practicing coding for interviews is inherently different from coding as part of your job.

When you’re writing software to be used by customers, you have limited time for activities that don’t directly contribute to finishing the project and getting the result into customers’ hands. Once you implement a solution that meets requirements like correctness, performance, and code quality, you’ll probably need to move on to the next work item. This differs from coding for practice, where you can spend more time on a solution to learn more about how it works, or try alternate solutions and compare them. Although you may still have a deadline (like your interview date) you can justify learning an algorithm from the ground up. That is often not something you can justify on a real-world coding project.

In the current era, there are many ways you can produce a block of code besides writing it from scratch. Two of the most common are getting it from Stack Overflow and asking a coding bot to write it for you. Even coding interview problems can be solved this way. But during a traditional coding interview, you’ll have to write code from scratch. If you have only coded with online resources, you may find this difficult. So it’s worth spending time practicing without modern conveniences. As part of your daily practice, write your solution with no help from an IDE or any coding resources. If you get stuck, focus on the areas where you have trouble.

The first element of deliberate practice states that deliberate practice is “designed specifically to improve performance.” So a musician performing in front of an audience or a programmer doing their regular job is not engaging in deliberate practice. Rather, they are taking advantage of the results of deliberate practice. To improve performance in interviews, you have to practice specifically for that goal, which means finding the parts of the interview process that you find difficult, designing exercises to target them, and repeatedly working on getting better.

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