My 2021 Journey to solving 1000 Leetcode Problems

Hey Leetcoders,

Today I reached a major milestone of solving 1000 leetcode problems! This was a goal I set back in January of this year. I wanted to share my story for others starting their journey or contemplating their journey.

image

My background has always been related to systems, infrastructure, cloud, automation, devops, SRE, etc. My current title is Site Reliability Engineer, and have had similar titles in past. I was never your "core" developer type. When I started in January I was in the 9th year of my professional career. I was a relatively strong python developer but only for tooling, scripts, and automation. If you asked me what DFS or BFS was I had no clue. I stuck with python during my leetcode journey and learned a lot more about the language and packages I did not know before (a separate post for that later on).

I had three primary goals as part of solving so many Leetcode problems.

1. Challenge myself
2. Refresh fundamentals of data structures and algorithms
3. Gain confidence in my ability as a software engineer

Along this journey I tried many approaches. I will share my experiences with you and I hope it helps with your journey.

I only took one set of interviews during the journey, received an offer, and took the offer. It was very early on and was a 35% pay raise over my previous position.

I used leetcode premium during my whole journey. It is well worth the price to have access to all the content.

General Advice

Here's my general advice in multiple notes. Often after a rough day of leetcoding I have to remind myself of this advice.

  1. This is a marathon, not a sprint. Each step builds off the next. There are no shortcuts. Be patient with yourself and trust the learning process.

  2. Find the time of the day that works best for you. Each period of the day has different advantages. I tried early mornings 5:30 AM. I tried evenings 10:00 PM. Ultimately the best for me ended up being weekend mornings and weekday evenings.

  3. Take your time on each question. This one I struggle with the most. Your mind wants to be lazy and jump to the solution; but it is so easy to gloss over an important requirement or edge case. I find that the more whiteboarding I do on a problem the higher the chance I have solving it correctly on the first try.

  4. Find a structured way to track your progress. As you make small improvements each day you might not appreciate the massive progress you've made over many months. Revisit problems you struggled with in the past; you will be surprised at how well you solve them after many months of practice.

  5. Be consistent. I have only missed a few days since February 2021. Start with one problem a day and work up to solving 2-3 problems a day. On weekends strive for 5-6 problems a day.

  6. When solving problems time yourself. Allow yourself at MOST 10 - 15 minutes to find the approach. Try not to leverage hints unless you are absolutely stuck. Try not to look at related topics (these are also hints). If you are not close to solving the problem after 20 - 30 minutes, mark it for future reattempt, review solution/discussion, and move on.

Journey Timeline

January 2021 "Bootcamp"

During my first month I spent time not doing leetcode. Instead I was refreshing myself on data structures and algorithms. This required a lot of coding from scratch and repetition to remind myself how to build and use the fundamentals. This blog: https://medium.com/@alimirio/before-you-start-solving-problems-on-leetcode-prep-work-9d65fc964c6f was helpful for my starting point.

February 2021 - March 2021 "Leetcode Explore Cards"

More than any other resources the "Learn" explore cards helped me the most in my journey. I did every single Learn explore card (except machine learning 101 and decision trees). I completed almost all the exercises for each learn card. If you have no idea where to start I highly recommend this as the place to start.

image

April 2021

This was kind of a lost month. I wasn't sure what to do next and mostly was doing popular questions without a proper vision.

May 2021 - September 2021

Starting in May I significantly improved my process. I created a spreadsheet to track problems attempted, time taken, etc. I would note the result of each problem in the following way. During this time I also started doing the daily challenges and some of the contests.

Green - Solved on first try in reasonable amount of time
Yellow - Solved on a few tries (2-3) with reasonable time or with first try but ugly code
Orange - Solved but with unreasonable amount of time or unreasonable ugly code
Red - Could not solve or didn't know how to approach

image

For every problem I also saved metadata about the topics and review each month the topics I was struggling the most on.

During these months I was also focusing a week on different tags. I realized later this was a little bit of "cheating"; I knew one of the approaches before even reading the description.

May 2021 - Array, Tree, DP, Recursion
June 2021 - DFS, String, Backtracking, and Binary Search
July 2021 - Trie, and Popular questions
August 2021 - Sliding Window, Stack, Two Pointers, Greedy
September 2021 - Graph

October 2021 - Now

Focus on random questions of most popularity/frequency. Do daily problem and biweekly contests.

Looking Forward - What's Next

Leetcode problem solving has become my number one hobby over 2021. I still love it and look forward to the solving problems each day. During that time though I have missed out learning other topics in our industry.

Its important to remember that to be successful in our industry you must become a lifelong learner. I plan to keep solving a few problems a day but look forward to my 2022 goals.

  1. Pick up golang development to start contributing to some major projects at work
  2. Refresh all my computer networking fundamentals
Comments (46)