Ask HN: How does one stay motivated to grind through LeetCode?

96 points by blutoot ↗ HN
I was recently laid off at a big tech company after 10 years. And now I am facing the harsh reality of trying to crack leetcode medium/hard problems (something I never managed to do routinely while I was working at this company). Is anyone here in a similar situation or has been in one? If so, how do you keep yourself motivated to solve multiple problems a day, especially knowing you are actually never going to work on such problems as part of an actual job?

Edit: I need to practice leetcode because the interview process for almost every software engineering role (especially in the Bay Area) seems to require going through at least one round of coding challenge based on leetcode medium/hard problem. I did not call it out earlier because I thought this is a very obvious point. Perhaps, I should have clarified that I am mostly targeting software engg roles.

73 comments

[ 0.25 ms ] story [ 108 ms ] thread
(comment deleted)
I find motivation from the fact that it should result in a job I could enjoy. It's similar to studying for an exam at university. You will likely not need the knowledge after, but it unlocks the true goal you want (a degree)
If u dont wanna do it, then why are you doing it?

I mean we all know those things are stupid and an employer who puts stock in them is defo not someone you'd wanna work for, cus they are building teams on stupid principles and clearly dont have a clue about making software.

I'd say spend your time building something you always wanted to. That will really show off your skills.

Don't do it if you don't want to do it but also accept the consequences of this decision.
I get this. I couldn't grind leetcode before the LLM AI era, now even more so. It always made me feel like I'm doing a junior's work.

I guess it comes down to the kinda work you want to be doing. I myself love building products and product features and I've never really needed any leetcode knowledge for that (I don't work on products with a massive user base). I suppose if I had a problem that required a specialised algo, I'd just consult a few AI tools.

Good luck finding that motivation though.

(comment deleted)
Have you looked into competitive programming? It's basically the same thing but a hundred times more fun.
You don't. You need to have a goal and clear understanding about why you are doing what you are doing. This is the same with pretty much all activities that require significant effort - motivation is a brief blip that eventually withers away once you start struggling. What you need is discipline, planning, and regular routine. Plan (allocate some time each day/week) and do this regularly. Can't take it anymore? Make a coffee, take a walk, rest for a little while, take a nap, whatever, and then try again. Motivation is not something that you should be constantly chasing in the first place.
> How does one stay motivated to grind through LeetCode?

Isn't the prospect of upcoming technical interviews motivation enough?

> especially knowing you are actually never going to work on such problems as part of an actual job

Actually, unwittingly, problem solving being a common organizational behavior, and most algorithms being a blueprint for optimal problem solving; maybe get curious and shed the incline that they are merely academic?

Anyways, I did this, myself recently. I picked up CLRS and read it, omitting or skimming the proofy sections, opting to focus on design and intuition, which is troublesome when they begin to overlap. I hope to revisit it. It's a nice space to be in, a blissful stroll through pedagogy, little history lessons, easy stuff.

As I progressed through the readings I worked a healthy number of problems. Lots of struggle and pain working exercises, opting to avoid hints or shortcuts and spend hours and hours to internalize. This part stings. No one likes to bathe in the lather of their own ignorance, but it can be done.

One of the problems I experienced trying to hold motivation was a sense of futility. There really isn't a sense of progress if you're just aimlessly solving problems with some abstract notion of getting better. Instead what I found helped is trying to work towards some sort of goal, for me that goal was to improve my _approach_ to leetcode problems, not necessarily focus on how many I can solve. Through this I found out that most leetcode-style problems fall into one of a number of solution 'buckets,' and the challenge shifted more into a problem classification task, rather than a coding task. I found my ability to do (a very few) hards unaided its own reward and motivation to continue! Up to a point of course, at some point it does just become repetitive again. This website helped a bunch:

https://blog.algomaster.io/p/15-leetcode-patterns

(comment deleted)
Leetcodes are fun! You should find pleasure in solving puzzles and figuring things out. Consider yourself lucky that the interview process contains a part that is basically a game that you can get good at by memorization.
I feel this. The last time I was job hunting I started the leetcode grind doing the blind 75 list you can find online. Luckily for me my network came through with a job.

I’m currently employed but if I lost this job I don’t know if I could do it again. I have enough savings to make it to retirement if I cut back expenses. I’d hate to blow it all not working for several years though.

I’m really really not happy with the field now. The whole agile and seniors “leading” projects where we do literally everything is complete bullshit imo. Hey manager wtf are you doing? Hey product owner make one effing decision this week! It’s infuriating.

I had a very little percentage of leetcode-like tests while my job search. And it's been long already. I do not motivate myself at all. I just hate it. These are absolutely irrelevant puzzles that I almost never face in real-life work.
AI is about to kill software jobs, and ppl are grinding leetcode

Talk about people grinding punch cards when calculators are about to wipe them out

I started to enjoy it after I started getting better at it.

Mix it up with some easy, medium, and hards.

I found Neetcode to be a very fun way to progress through them. It has a skill tree that makes your progress more visible and has great lessons too.

On the more abstract motivation side, despite the somewhat contrived nature of the challenges compared to day-to-day work I have treated it as a learning opportunity as there is genuinely some interesting stuff in there and there you never know when it might come in handy.

Why you need motivation? If you don't find a job you're gonna get to the streets. If you want to work at a tech company, then solve leetcode questions. No motivation needed.
Man, I've probably spent a combined 2 hours over my entire life on leetcode... And that was mostly just curiosity.

Is this a uniquely US thing ?

AI should make people start really trying to build their own solopreneurships and start their own companies or band together in small teams and forget about jobs. It's not going to be the same again. But we're at an inflection point where we can make a difference as individuals.
Based on my recent job search: Don't focus on grinding leetcode, it's not worth your time unless you're applying to Meta/Google/MSFT etc.

- give yourself a concrete algorithm practice goal, such as "get through Blind 75" (it's a list of 75 questions you can find online).

- practice using data structures and also implementing whatever your language doesn't provide

For context, I just spent most of the last two months doing a job search in the Bay Area. Did final round interviews at several companies ranging in size from a few people to a few thousand.

I encountered exactly 1 (one!) direct leetcode problem during my interviews.

Maybe combine it with learning that language you wish to?
Wanted to respond to a few comments about why motivation has been an issue for me up until this point.

It is an issue simply because leetcode grinding makes me feel like all my 10+ years of commitment to my previous employer (often foolishly at the expense of my personal well-being) and all the things I have contributed and picked up on the way mean nothing / nada / zilch to my future prospective employers. The whole prep process makes me feel like I need to start from scratch and nothing that I did in the past matters at all. I find this extremely frustrating.

I understand your frustration.

You can't change the past, and you can't control how companies interview. Focus on what you can control.

Any overlap between interview skills and job performance is a coincidence.

You have to accept this on a visceral level.

Alternatively, remember that the reason the company is making you jump through these hoops is that there are many other candidates who are equally qualified.

Don't think of it as a grind! I play some Leetcode almost daily purely for my own enjoyment. The problems are actually pretty fun for the most part. They can force your mind to think of a problem in ways it isn't used to which is rewarding in and of itself. And looking at how others have solved the same problem afterwards can teach you all kinds of nifty tricks, especially in programming languages you're less familiar with!

If Leetcode is just a means to an end for you you're probably not going to have a good time.