HACKER Q&A
📣 blutoot

How does one stay motivated to grind through LeetCode?


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.


  👤 ZpJuUuNaQ5 Accepted Answer ✓
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.

👤 wesrobin
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


👤 meltyness
> 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.


👤 azangru
> How does one stay motivated to grind through LeetCode?

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


👤 BinaryIgor
Don't grind just any problems in abstract, but ones that are actually useful and applicable to the complex systems we usually (want to) build :)

I was recently chatting with the ChatGPT about it and it come up with a solid list:

#1, #3, #217, #347 - foundations

#33, #56, #76, #239 - efficiency patterns

#102, #104, #110, #200 - recursion + structure

#207, #133, #323 - graphs

#215, #23, #621, #146, #692 - heaps & scheduling

#295, #355, #460 - system simulation

What I - more or less - asked for:

"Would you say that being good at leetcode style problems is a crucial/important skill for a web software developer who wants to work on the most complex software? Why yes, why not? If so, give me a good LeetCode numbers to tackle for practice in this context"


👤 rckt
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.

👤 le-mark
I feel this. The last time I was job hunting I started the leetcode grind doing the 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 ending decision this week! It’s infuriating.


👤 andai
Have you looked into competitive programming? It's basically the same thing but a hundred times more fun.

👤 stitch4143
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)

👤 mmkos
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.


👤 kotsmanis
Don't do it if you don't want to do it but also accept the consequences of this decision.

👤 everyone
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.


👤 loeber
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.

👤 lylejantzi3rd
Who says you're never going to work on such problems as part of an actual job? LeetCode problems are data structures and algorithms problems. All of programming is data structures and algorithms.

It's hard to believe you can work dozens of those problems and not learn something. Think of it as leveling up your skills. In fact, I'm surprised somebody hasn't gamified LeetCode yet.


👤 blutoot
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.


👤 andriamanitra
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.


👤 OisinMoran
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.


👤 theoldgreybeard
You don’t. I have never grinded leet code and never will. I have personally ended interviews where they tried to get me to do these. Not worth my time.

Any company that wants me to regurgitate toy problems that don’t have any relevance to the role is not one Im willing to bother working for.

I fee like if you’re “grinding” the goal is to memorize the solutions, which is kinda defeating the purpose anyway.


👤 jvanderbot
by far the best "trick" (such as it is) is to use study as a break from some other, worse drudgery. Productive procrastination.

You need your life to be so boring, and so full of non-intellectual chores that you long for an hour to look at code again.

This borders on facetious: but try becoming a manager, having kids, or becoming a hermit, I did all three and my side gigs / study was never better than during that time. I learned to just remove fun until the chores were fun. Like how carrots are actually really sweet tasting if you stop eating sugar.


👤 nickstaggs
For me there are 2 components to staying motivated.

1. Measurable, manageable goals. Don't toil for hours on end. I set the goal of 1 hard, 2 medium or 3 easy problems a day. And if I get stuck I consult chatgpt study to help direct how I should think about a certain problem.

2. Make it competitive. At least for the actual leetcode site you see how your run time and memory consumption stacks up against other users. I try to be the best in one or both. This can also get at run time and space complexities. You can also see the solutions for the fastest run times which can teach you some lower level ideas for the language you are using. I learned about holey arrays in Javascript due to this and how certain conditionals are better optimized for v8.


👤 SirFatty
I'd like an answer about how one grinds through anything. As I get closer to retirement, it becomes harder.

👤 keepamovin
When I was doing it, I enjoyed the challenge and learning how to get better at understanding, solving them myself, and seeing other's solutions. Trying to understand the clever algrithms was a funny challenge too. I set myself goals for how many I wanted to get through and put a certain amount of time in most days at it. It was pretty fun. When I interviewed the questions were much easier than leetcode, but similar process/understanding was useful, and I felt much more relaxed having prepared, which was highly useful!

👤 fleshmonad
Never learned anything through leetcode I couldn't have learned more in depth by my personal projects. Leetcode feels like some bullshit you talk about on LinkedIn in an LLM like voice, as is

> We all know skills in programming are important

>But it is not just writing code, but also solving problems quickly and with the right tools.

>Before doing leetcode, I didn't really know how to tackle the challenges I was presented at work. I would still perform, but not like I do now, being on the top 100 leaderboard

>also please please hire me please I am starving

Leetcode is pretentious bullshit for american HR departments.


👤 iansinnott
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.


👤 kilroy123
Just break it down into 15 minute chunks. Do one session in the morning. One at night or in the evening.

Make it a daily habit. Keep tapping your network, and good luck!


👤 TrackerFF
Personally I don't think "grinding" is the right way. The key thing is to truly understand the data structures and algorithms you're working with. Just grinding away is kind of like solving hundreds of difficult integrals and partial differential equations, without really understanding the math 100%, but hoping that you'll meet on a similar problem one day.

So first step is to really understand the theory, if you're not completely confident, or feel that there are obvious blind spots / gaps.

Next up I find it easier to classy the problems by type. Truth is that most leetcode problems are variations of more general subclasses. You'll have the knapsack problems, and other types. Learn to identify these, and study the more generalized versions of these problems, before you start solving the more specific versions.

I'm not saying that grinding is useless, because it can help you on speed and increasing your chances in stumbling on a problem you've solved before. The truth is that there's also an element of speed / efficiency to the LC-style interviews. But I think any sort of grinding should come after all the other things I've mentioned.


👤 LandR
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 ?


👤 buggy6257
Good lord based on these comments I am so glad to not live in the same bubble y’all seem to be in.

13 years as a dev, many jobs, countless interviews, and I have never once solved, been asked to solve, or even attempted to solve a leetcode problem.

Reading people talking about what they do here it sounds like voluntary torture. I would quit being a dev if that’s what it took.

OP: I’m saying maybe you don’t have to join them. Get out of the mindset. Find jobs that value your time.


👤 worldsavior
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.

👤 mamcx
Maybe combine it with learning that language you wish to?

👤 jameshush
When I went through the grind, I just would open up levels.fyi and check the salaries whenever I felt like giving up.

Now that I have a wife and kid, its very easy to find motivation to do things I don't want to do to provide for my family :P


👤 johnwheeler
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.

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

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


👤 anonym29
Think of the most annoying × least intelligent person you've ever met. Imagine that they have become a multi-millionaire, and are standing over your shoulder, watching you do leetcode. Right as you want to give up, you tell them this, and they say to you, "Have fun staying poor."

That feeling right there? Channel that into Leetcode. Your fist is your keyboard, their face is a working solution.

Vindictive spite is a very powerful motivator, even when it originates from fictional situations. The trick is to channel it into productivity instead of negativity.


👤 diamondfist25
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


👤 RGamma
[delayed]

👤 aristofun
Why do you want to jump through these ridiculous hoops to ruin your soul and mind by working a meaningless job under an incompetent manager in the first place?

Your motivation lies in the answer if you have any.

Money alone is not a motivating answer unfortunately, because our subconscious (soul if you will) truly does not care about money and wealth itself.

But unfortunately again it is the only real sustainable source of our motivation.

There are companies that do not do this shit or at least do very basic just to make sure you’re not a fake programmer. Why do you need motivation to learn leetcode simple? It’s mostly a very basic CS and something you should know already as a developer.


👤 exe34
you could print out the picture of a cheque with your future salary on a poster and stick it to the wall near your computer.

👤 JonChesterfield
Have a leetcode desk, shed, garage or whatever. Some place you go every day for some number of hours. Without a phone or a book.

You don't have to do the leetcode there. Can sit there for the whole time staring at the wall if you like.

But if you're doing anything there, it's leetcode. Your brain is a pattern matcher. It doesn't like boredom. Thus you can train it, a bit like a dog.


👤 regularization
Since you have to ask, your resentment against tech employers is unconscious.

You resent being a wage slave being forced to do this.

What can you as an individual do about this? As you already know the answer is nothing. Which further demotivates you.

The answer is to separate the concerns.

With regards to demotivation, resentment etc. - read some Noam Chomsky or Karl Marx or Bernie Sanders. Go to a few local Denocratic Socialists of America meetings and talk to the one or two people there who are not just the usual weirdos who show up at political events. If you want to hit back at companies forcing you to do this, and be able to stand proud and not be a wage slave slug doing unpaid grinding of Leetcode without a paycheck, this is the only way to hit back, if only in a small way. These things change collectively, not individually. You might feel better.

Then - suck it up and start grinding Leetcode. Think about how it's cool you just learned to implement Dijkstra's flag algorithm and the like.


👤 kurtis_reed
Companies are still doing this shit?

👤 BiraIgnacio
Grind is the operating word here, IMO. What I try, as a way of motivation, is to pick something easy and fun, just to get a quick dopamine jolt. Then it's all downhill from there

👤 giardini
You're procrastinating!

Get back to interviewing. Consider a job away from the Bay Area.


👤 rvz
Just build a startup.