Readit News logoReadit News
Posted by u/blutoot a month ago
Ask HN: 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 · a month ago
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.
Jeff_Brown · a month ago
Depression, lack of motivation, are functional. They kick in when you don't think your prospects are good, prompting you to step back and think. If you were sufficiently convinced grinding LeetCode was a good career move, you would be motivated. The fact that you're not suggests you should do some research rather than plowing ahead. What do employers really care about? What's the best way to convince them you've got it? Where do you fit in?
MangoToupe · a month ago
> If you were sufficiently convinced grinding LeetCode was a good career move, you would be motivated.

Motivation certainly doesn't work like that in my brain. Consistency in pursuing goals I know on paper are the right choice despite lack of motivation is the only way I've achieved anything.

If you can wed career goals with dopamine, that's wonderful! But I suspect you're extremely lucky.

bradlys · a month ago
This doesn’t work in Silicon Valley. He has to do leetcode.
porridgeraisin · a month ago
Yep. This is the way. Even if you don't want to/are not able to have a daily routine and such, detaching as many activities as possible from volatile things like motivation,mood,etc is extremely useful. That is the most important part. Early on in life it is easy, since you have a clear set of objectively great things to do - do great in school, do great in exams, do great in college, get a great first job, don't screw up health in growing years. So you can force yourself to do those no matter what. Later on in life (post college) it gets harder, since you have to ensure you're not forcing yourself to do something counterproductive, especially in new fields like SWE, where there's no clear industry standard career path yet, or an industry standard anything really. Academia in contrast you can apply this strategy until a lot later.
blutoot · a month ago
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.

gabrielsroka · a month ago
I understand your frustration.

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

shahbaby · a month ago
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.

aeonfox · a month ago
Competent people do pass the filter, but what Leetcode interviews do filter out are people with a shred of creativity who just won't submit themselves to the drudgery of studying useless crap for an interview – the kind of people who need purpose to always align with work or part of them dies. Avoiding these people is great for a company that's all about boosting it's ad revenue, and also great for the applicant who dodged a bullet.
hitarpetar · a month ago
I get it but it's sort of a strange thing to ask people to accept no?

like asking people to accept that 1+1=3. or that the day after Monday is Thursday. maybe that's the real function of these hoops -- selecting people who are good at doublethink

netllama · a month ago
If solving leetcode is the only way to differentiate candidates, then its meaningless and is not accomplishing anything.

Only those who can't or won't invest time creating a meaningful interview process fall back to leetcode.

andriamanitra · a month ago
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.

JonChesterfield · a month ago
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.

v-erne · a month ago
That's a great idea. I would love to be able to do that. If only I was not forced to live in the most expensive part of my country where one square meter costs more than half year salary of average person. At least from accounting point of view I'm a millionair, just without any ability to get my own space (because needs of family always come first). Life is strange.
blutoot · a month ago
This is incredible - have to try this - thank you :)
OisinMoran · a month ago
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.

fleshmonad · a month ago
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.

nrhrjrjrjtntbt · a month ago
Leetcode may be wrong but it is the reality if OP wants to get a similar big tech job. Unless he has a good connection.
theoldgreybeard · a month ago
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.

JustExAWS · a month ago
Well, that’s a fine ideal and I agree with you. But let’s not pretend that with your ideal you aren’t leaving money on the table.

I can afford to leave that money on the table at 51, grown kids, downsized to a condo in central Florida with just me and my wife. But in my case, it’s not even a trade off between not grinding leetcode and not getting (back) into BigTech. It’s just that I refuse to ever work in an office again.

The “goal” is to make a lot of money in cash + RSUs (public BigTech), if I were younger I would definitely do it and I encourage all new grads to do whatever it takes to get into a high paying tech company and then give them advice on how to play the game once they are there.

AnimalMuppet · a month ago
This. Seriously.

In a world with both Google and AI, why does anyone expect you to memorize the solutions to problems, especially to problems that won't actually be the ones you need to solve on the job?

But I wonder if, in order to get a job with the "just say no" approach, you need to leave the Bay Area. I wonder if most places there are so into the "that's the way it's done" that they can't see the absurdity of it. Other places in the country don't seem to be as infatuated with leetcode. But if you're determined to stay there, then it may be a search to find someone who doesn't use that standard for interviewing.

So you have a choice. Would you rather grind leetcode, or would you rather grind the job search for a place that doesn't interview that way?

(I had decent success with Robert Half. They're a recruiter that actually has a clue about tech people. They can work with more senior people, which 10 years qualifies you as. I forget whether they were the ones that led to my most recent role, but I remember being impressed with them as headhunters. They may be worth a shot in your situation.)

JustExAWS · a month ago
Let’s not pretend that the companies that Robert Half recruits for is near the same league of compensation of the companies that require leetCode.

Yes I realize those are the types of jobs most developers had - and the same types of jobs I had from 1096-2020.

pan69 · a month ago
I agree. But it also depends on the role you're hiring.

When I hire grads or juniors onto my team I will focus a lot more on leetcode style problems because a) they don't have much work experience so delving into real-world problems they have solved is typically not useful (exceptions there) and b) leetcode is usually closer to their recent experience which tends to be more academic in nature.

More senior roles typically have very different requirements. I don't need a staff or principal engineer to pass a leetcode test as it typically isn't relevant to that role. I respect their lived experience so I dive into real world problems they have solved, not just software but also people, culture, etc.

roland35 · a month ago
Leetcode stinks but you are really filtering out a lot of high paying jobs if you refuse to do it
notepad0x90 · a month ago
For the sake of argument: What if they have multiple candidates and they want to know which ones can solve problems better with code instead of hiring by vibes.
jimbomins · a month ago
It strikes me that software has become a bit like law and accounting used to be. "We had to suffer and so must you". Making it pointlessly hard to keep people out.

Rather than dealing with people on real problems.

I'm currently getting interviews. For work that I know from having done it for twenty years that coding is only a small subset of. But the emphasis is far more on coding than application of experience gained to overcoming similar problems quicker the second, third or fourth times I'd be working them.

It's sad. I'll certainly just say no to leetcode for the kind of engineering I'm looking for. Rather go do some (paid) gardening.

JonChesterfield · a month ago
Look at the code those people have put into production instead.

Or accept that you're filtering for pain tolerance of nonsense and the people you get will put up with grindy nonsense in your company. Which could be a blessing or lethal, depending on what you're doing.

theoldgreybeard · a month ago
The topic is leetcode. I've written code during interviews and in reasonable takehomes before. If your choice of candidate is boiling down to fizzbuzz I'm not interested.
AnimalMuppet · a month ago
Even so, why see which ones can solve problems that aren't the problems that the job actually calls for solving?

I mean, if you're Google, and a small improvement in algorithmic efficiency means needing a thousand less servers, yes, you want people who know that kind of stuff like the back of their hand. Most places aren't Google, though. Places that interview like Google that don't have Google-like problems have a mis-fit between their interview process and the roles they are interviewing for. So, places that aren't really on top of what they're doing as an organization.

hshdhdhj4444 · a month ago
When was the last time you interviewed?

Because the job market is very different today.

whatamidoingyo · a month ago
Agreed. I have done some in the past, did well, but still didn't get hired. Nowadays, I flat out tell companies upfront I'm not doing them.

Two companies still hired me after telling them this. I don't think it would work for juniors, though.

jvanderbot · a month ago
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.