DEV Community

Cover image for 1 Year of Consistent LeetCoding
Davinderpal Singh Rehal
Davinderpal Singh Rehal

Posted on

1 Year of Consistent LeetCoding

It was September 2023, a time when change was in the air. I found myself between jobs, and as luck would have it, Google had just kicked off a hiring wave in Nairobi, Kenya. I came across the Google Foobar challenge, a coding gauntlet I'd heard whispers about. With a decade of coding behind me, I felt it was time to give it a shot.

The first challenge was like a warm-up—a binary search problem that felt like a gentle jog. The second and third problems followed suit, manageable and engaging. But then, the fourth challenge appeared, and it was like hitting a steep hill. This was my introduction to graphs, a concept that had somehow eluded me in my career.

Feeling a bit overwhelmed, I turned to YouTube for guidance. As I watched the videos, explaining the algorithms and concepts, I couldn't help but feel a touch of imposter syndrome. How had I worked as a software engineer for so long without encountering these problems?

To cut to the chase: a Google recruiter did reach out. It led to a phone screen and three rounds of interviews. Unfortunately, I didn't make it through. But this experience kindled a fire in me to master data structures and algorithms (DSA).

Determined to improve, I found the LeetCode 75 question set. I tackled it with zeal, making notes and learning heaps. Halfway through, I landed my first contract of the year, which meant less time for practice. To keep pushing myself, I started doing LeetCode’s daily challenges. This eventually led to a 365+ day streak.

I tracked every question in a (Google Sheet)[https://docs.google.com/spreadsheets/d/14GXh2RLulTo2vLeLzOuOqqCm5DQmCI-OK8MJvi9yJz8/edit?usp=sharing]. My system was simple, if I can't solve it within the time I mark it as a fail:

  • Easy: Solve within 25 minutes
  • Medium: Solve within 45 minutes
  • Hard: Solve within 1 hour

Every two weeks, I'd revisit a failed question and give it another shot. Here’s what I learned along the way:

Some Topics Pop Up More Than Others

Arrays (Lists)

Following (PrimeAgen)[https://www.youtube.com/@ThePrimeTimeagen]? Then you know arrays are fundamental to DSA. A year in, I can vouch for it. Efficient array manipulation is essential.

Strings

Strings are like arrays, but with a twist. They’re immutable in most languages, meaning any change requires creating a new string. This was a lesson learned the hard way.

Hash Tables

When mapping data, hash tables are a go-to due to O(1) insertion and deletion. Initially, I thought hash tables were complex, but I learned they’re essentially objects.

Sorting

Know at least two sorting algorithms. Bubble Sort is classic and quick to code. Merge Sort is powerful but takes practice. And there’s Bucket Sort—mind-blowingly fast but space-intensive.

Greedy Algorithms

Greedy problems are intriguing. They allow early exits once conditions are met. These problems still trip me up sometimes, but they’re rewarding to solve.

Conclusion

DSA can become addictive. Once you start spotting patterns, solving problems becomes almost mechanical. I’m hoping for another shot at Google. Until then, I’ll keep grinding LeetCode and getting better at this craft.

Top comments (26)

Collapse
 
anmolbaranwal profile image
Anmol Baranwal

Great 🔥 I was always more interested in GitHub compared to Leetcode. Solved around 124 questions on all topics (except trie) and then moved on. My favorite topic was DP.

Being consistent definitely helps.

Collapse
 
davinderpalrehal profile image
Davinderpal Singh Rehal • Edited

:EDIT: Just realised there is a comment already asking the same

DP is something I still struggle with specially the harder problems. So when you say more interested in GitHub is there a section in GitHub for solving problems?

Collapse
 
kelsey-d profile image
kelsey-d

Do you mean you preferred contributing code? Clarifying just in case there was anythign else GitHub offered it's a completely different landscape to LeetCode.

Collapse
 
anmolbaranwal profile image
Anmol Baranwal

Yes, I loved working on new projects and contributing to open source.

I participated in 500+ discussions (was trending on github discussions for 2 months), did 200+ PRs (became a maintainer of open source repo) and created several projects (got 1k+ stars)...

I have slightly less time now but I have always been more interested in development side rather than CP.

This is my GitHub if you want to check it out!

Anmol-Baranwal (Anmol Baranwal) · GitHub

Top 5% GitHub 💜 Open Source Advocate & Maintainer 😄 Software Developer (200+ PRs) 🔖 Technical Writer (500k+ Reads) 🔥 Open for Collab - Anmol-Baranwal

favicon github.com
Thread Thread
 
chrisx001001 profile image
ChrisX001001

How do you make money? Because I can code I just need to profit from it lol

Thread Thread
 
anmolbaranwal profile image
Anmol Baranwal

I’ve never done anything just for the money. All the time I spent in open source, I never once thought about getting something back from the community, like a job or anything.

You can either do freelancing, technical writing or try Indie Hacking. There are bunch of things you can do to earn money using coding but only a very few would match your style.

Thread Thread
 
chrisx001001 profile image
ChrisX001001

Thank you :) I am trying freelancing but hard to get gigs and they don't pay much.. you are completely right about everything though.

Collapse
 
vignesh_s_d92096a83af7013 profile image
Vignesh S

Which GitHub link are u talking about?

Collapse
 
blessedtechie profile image
Blessing Emejulu

Thanks so much. I will check out the sheets and start leetcoding.

Collapse
 
freelancer2020 profile image
Mostafa

Keep going 💪

Collapse
 
backyardkaiju profile image
Mohammed Awwal Mohammed

This is beautiful. I'm off to go check leetcode out this instant.

Collapse
 
amitovhal2 profile image
amitovhal2

Great Article; I felt the same when I first encountered the leetcode problems,
Also, great Excel. If it's okay, can you please share the sheet for anyone to use and track their progress? I didn't get where exactly or how it marked the self-solved problem.

Collapse
 
davinderpalrehal profile image
Davinderpal Singh Rehal

Thank you, you should be able to download a copy of the sheet and use it for yourself.

I am using a boolean marking system for all the questions I encounter. What I usually do, say if the problem is Two Sum, it is marked as an easy question so on my timer I will set 25 minutes and if I am able to solve it within the time limit then I will look at the topics that belong to the question which is Array and Hash Table, so in my sheet I will create new row with the name of the problem, then in the column for Array and Hash Table I will mark them as a Yes. If I was not able to solve the question in 25 min or I had to look at the hints or a YouTube video then I would mark those columns as No.

I hope that makes sense, in this way I am able to see which topics I need to concentrate on more.

Collapse
 
alisamir profile image
Ali Samir

Image description

Collapse
 
dinesh_reddy_4cd59b51bec7 profile image
dinesh reddy

Where do you work currently? Did you land a job in big 4?

Collapse
 
nozibul_islam_113b1d5334f profile image
Nozibul Islam

Great, Thank you for sharing.

Collapse
 
ameer_hamza_5a71257dd6d27 profile image
Ameer Hamza

I appreciate the help you have given us and the efforts you had gone through.

Collapse
 
jairo1031 profile image
Jay Rodriguez

What are your thoughts on Algomonster?