1 Year of Consistent LeetCoding

davinderpalrehal

Davinderpal Singh Rehal

Posted on October 24, 2024

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.

💖 💪 🙅 🚩
davinderpalrehal
Davinderpal Singh Rehal

Posted on October 24, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

1 Year of Consistent LeetCoding
leetcode 1 Year of Consistent LeetCoding

October 24, 2024