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 (20)
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.
: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?
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.
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 😄 Full-Stack Developer 🔖 Technical Writer (400k+ Reads) 🔥 Managing 5+ Communities 🚀 Open for Collab - Anmol-Baranwal
How do you make money? Because I can code I just need to profit from it lol
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.
Thank you :) I am trying freelancing but hard to get gigs and they don't pay much.. you are completely right about everything though.
Which GitHub link are u talking about?
Thanks so much. I will check out the sheets and start leetcoding.
Keep going 💪
This is beautiful. I'm off to go check leetcode out this instant.
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.
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
andHash Table
I will mark them as aYes
. 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 asNo
.I hope that makes sense, in this way I am able to see which topics I need to concentrate on more.
Always nice to read experiences of people as a beginner myself. Guess I gotta keep moving forward with your experience in mind too hah!
Have you followed any particular DSA courses at the beginning?
I have tried AlgoExpert and NeetCode, out of which I recommend NeetCode more, though I recommend just doing a list from LeetCode and go deeper in topics that you have problems with. I don't have a particular course.
Great, Thank you for sharing.
Where do you work currently? Did you land a job in big 4?