harisrid Tech News

Spanning across many domains – data, systems, algorithms, and personal

PERSONAL – My Leetcode Journey: How Persistency Transform Skills

Persistency. Persistency matters. – a wizened engineering manager.

Hi all 🙂 !!!! Just like you, I’m painfully average.

I briefly want to talk about my Leetcode journey, and how I drastically improved and got better at the skill ( to the point of having solved 1000+ LC MEDIUMS and an almost 100 out HARDS, which BTW, is an ungodly number to solve ). To be forthcoming and transparent, I don’t think of myself as the world’s best natural problem-solver – I’m not a USACO/AIME/Putnam medalist, I never did competitive programming ( outside of an intro to competitive programming class ), I got a B- in my undergraduate algorithms, and there was a time where dynamic programming made zero sense to me.

Yep! Turns out, I’m probably closer to downright painfully average. I used to struggle immensely with the puzzle-solving skills and the algorithmic-thinking needed to cut through the HARDEST of problems. But somehow, over time, things started to “click”, and I’ve gotten better.

Figure : Dated on 03/28/2025 – number of problems solved

Days Past – the Practice Routines

My practice routine is simple. On a daily basis, following a block schedule, for 30-minutes a day in the morning ( e.g. 7:00 a.m. – 7:30 a.m. or 8:30 a.m. – 9:00 a.m. ), I practiced a single problem. Somedays, I had more luck where I solved the problem in fewer than 20 minutes ; on those days, I solutioned a second problem 🙂 .

The practice routine also helped because I avoided the major pitfall that most other folks run into – CRAMMING. I know there’s people out there who can practice and code algorithmic problems for 2-3 hours straight – some an ungodly continuous 8-12 hours. Yes, there’s times that I can enter “the flow state”, but trust me, I am not a person who practices LC problems for more than even a consecutive two hours on end ( save for those occasional problems where I really had to invest my mental faculties and I obsessed over them; there was one where I once spent two 2-hour sessions on ). Nope, I’m a persistence hunter – a long-distance marathon runner – and where I excel at is showing up and being consistent. Because getting started is the hardest part.

Figure 0 : Example visual and practice of a short leetcode problem.

Back in the day, I used to practice by solving two problem categories – EASY and MEDIUM. I started off by solving the EASY problem, and then moved over to solving the MEDIUM problem. Solving the EASY problems helped tremendously – it got me into the groove and the momentum of problem-solving. It gave me motivation, because at least I could tell myself “Hey, even if I failed today’s MEDIUM problem, I solved today’s EASY problem”! I preferred the days where I solutioned a problem, versus solutioning nothing – it was more motivating. ( well not only that, but there’s only so many EASY problems online, so at some mathematical point, once they’re decently exhausted, there’s no choice but to “level up” and move to the MEDIUMS. You’ll get forced to level up because you will likely hit a “saturation point” ).

As for MEDIUMS problems, I conjured up a “mental roadmap” in my head for how to tackle them. I focused on practicing problems by clusters or by categories. Some weeks, I focused on solving five SLL ( singly-linked list ) problems. Another week, I shifted to solving trees. The third week, recursion. I rotated across categories, which I think helped because problem-solving techniques within categories translated well across each other; solving one SLL problem helped me solve another SLL problem.

“Giving Up” – But The Smart Way

Another street-fighting tactic was learning “when to give up”. And I don’t mean give up by “all is night and admit defeat, All-Mighty Warrior“, but rather, give up as in “Hey, go circle back to this problem a few days or weeks later, you’ll crack it!”. I wish I could explain it better, but I also don’t think I can. There’s something subconscious taking place when we’re awake and when we’re asleep. I mean, humans think about problems at random times – when we’re showering, eating lunch, driving, hiking, talking to friends, or at the movies. I had moments where I spent 30 minutes on a MEDIUM and “gave up”, but then a couple days later, “kaboom” – I saw what to do. This also happened faster when I went and solved other problems in the meantime – I think solving those problems gave me additional problem-solving experience or different frames to view a former un-solvable problem.

So instead of having a day where I would go “Oh my god I can’t solve a single MEDIUM today, I give up”, I cognitively reframed and strategized differently. I said to myself “Hey, let’s put those problems in the backburner and tackle something else”. And that tackling – of the something else – helped.

Figure 1 : What does my multi-colored problem-solving look like.

Cluster-Based Practice

I also recognized that clustering practice based on the data structures and algorithms helped me. For example, one intuitive progress was “singly-linked lists” -> “trees” -> “graphs”. Which makes sense, because a SLL is a 1-D tree in the hiding and a tree is a graph in the hiding ( with n vertices and n-1 edges ). I noticed another intuitive progression with “recursion” => “top-down memorization ( TDM )” => “bottom-up dynamic programming ( BUDP ) “. In this scenario, I recognized that solving BUDP immediately would be HARD, but writing up the naive recursive solution and then converting that to a TDM-based approach made more sense! I could still pass those DP problems within reasonable time-limits without going down a far more difficult path.

Pen-and-Paper To The Rescue

And the last time, which I’m surprised, is to use pen-and-paper. I have no explanations of this either, but it helps me to diagram and think about problems using a pen. There’s some people out there who can think in their heads and type out directly ( I’ve gotten to this point, but only because of sheer practice ). It also helps to use multiple colors – not just one – to flesh out patterns or highlight different parts of problem ( I should share an image of what this looks naturally looks like ) . I personally don’t understand people who use a single black color market to solve problems – I like to see the kaleidoscope : blue, green, red, black, purple, brown, and whatever else.

Figure 2 : The pens I use to solve problems” ( turns out a kid’s multi-colored pen does the job )

My Takeaways

I’m now at a point where I’ve become far to experienced – a maestro, I should say – at this oddly specific niche skill. And I need to do something with it – personally, I think it is pointless to keep all the knowledge and the tactics that I’ve learnt to myself. It would entail a slow transition towards teaching and writing, but, I think I can make some use out of this stuff or do something with it 🙂 !

Wish me luck to this !!!

Posted in ,

Leave a comment