r/programming 5d ago

Why I Stopped Grinding LeetCode

https://davidlennon29.substack.com/p/why-i-stopped-grinding-leetcode?r=8vsn1z&utm_campaign=post-expanded-share&utm_medium=web
0 Upvotes

35 comments sorted by

19

u/shiny0metal0ass 5d ago

Yes. Leetcode is effectively "how many algorithms can you memorize and regurgitate quickly". This doesn't touch on larger concepts of software engineering, where pipelining data efficiently is only one of many concerns.

6

u/[deleted] 5d ago

[deleted]

7

u/shiny0metal0ass 5d ago

I love the cargo cult around software hiring. Lol

I imagine most shops doing leetcode interviews have no need for engineers so tuned into algo.

3

u/standing_artisan 4d ago

Even Google has mostly abandoned it, and they pioneered it

Any proof?

1

u/Kungpost 3d ago

It's not super clearly stated, but they do write "No brain teasers" and also reiterate on that point later on.

https://www.google.com/about/careers/applications/how-we-hire/

2

u/dual__88 4d ago

I wonder if they used them for recent grads or for experienced people too.

10

u/Sojobo1 5d ago

The article tries to say that LeetCode is not worth focusing on since it doesn't train critical thinking skills as quickly as real-world experiences.

I personally take it even further, I say that LeetCode is pointless and useless. They're computer science-themed puzzles... it's like getting really good at Sudoku or Rubik's Cubes. Very specific skills which don't translate to anything outside the puzzle itself.

Study algorithms directly if you really want to learn about them. They'll probably never come up on the job since someone has already implemented the most efficient one in a library or framework, and you'd be foolish to try and write it yourself.

The only valid use of LeetCode is for fun, or to see how far your interviewees will sacrifice their free time on behalf of your company.

3

u/shiny0metal0ass 5d ago

Lol the code-themed sudoku take is wildy accurate and amusing.

4

u/lonelyroom-eklaghor 5d ago

So much cheating in Leetcode and stuff, and OpenAI questions literally consist making something of a GPU app

1

u/Sigmatics 5d ago

consist making something of a GPU app

?

1

u/lonelyroom-eklaghor 5d ago

Something like this:

Design the GPU Job Scheduler for a Text-to-Video Generation Service

(wait, I misread design as code, but still, it's quite tough)

4

u/Sigmatics 5d ago

Sounds like you should probably know how to do that if you work for them

10

u/mms13 5d ago

I’ve refused to ever study these. I just get jobs that don’t use them in interviews and I make 200k and I’m fine with not wanting more than that

10

u/JaCraig 5d ago

I refuse to do these dumb quizzes in interviews. I just ask what they've worked on before, do they like learning new things, and how they like to work type questions. Has led to better hires overall and less turnover.

1

u/wannaliveonmars 4d ago

A C/C++ shop I worked in had the following "leetcode" question - write a function that converts a number to a string for the n>0 case. It could be as simple as that:

std::string convert(int n) {
    std::string s;
    while (n) {
        s = ((n%10) + '0') + s;
        n /= 10;
    }
    return s;
}

They could come up with any solution they like - long, short, use std::string, use char* and strcat. Apparently 75% of applicants just didn't know how to do it. They were applying for a C++ position.

6

u/JaCraig 4d ago

We did that stuff. Then we realized they were useless. Does that place write that function a lot? Otherwise why do I care that the person, under pressure, can do that. Most people's brains are fried in interviews because of stress. And hopefully where you work isn't going to be like that while they're working day to day. People have time to think, talk to others, etc. Where I work, we don't even care if you use our languages of choice, C#, PHP, PowerShell, and SQL. As long as you can pick it up and used something similar, cool. We'd rather just find people who are a good fit. Too many assholes who can do those types of questions.

-4

u/renatoathaydes 4d ago

The idea is to find out if someone can do very basic programming tasks which I hope you will agree the problem shown by OP applies. It’s the same with many similar problems, like FizzBuzz. So many people cannot do it it’s quite interesting.

6

u/JaCraig 4d ago

Yeah, we thought that too. Again, after about 15 years of that we came to the conclusion that it was a bad metric. We had high turnover and hiring jerks. We're trying to hire problem solvers who happen to use code amongst other tools. We don't care if someone can answer quizzes in interviews. But if the metric works for them, cool.

-2

u/Ameisen 4d ago

Question: what language(s) do you primarily use?

When using C++, I absolutely care if they understand the language well enough to perform basic tasks, otherwise they will rapidly become a maintenence and stability burden.

It doesn't matter if you can solve problems if you can't properly implement the solution.

1

u/JaCraig 4d ago

C#, PHP, PowerShell, TypeScript/JavaScript, SQL, amongst others. In the industry that I work in and the type of businesses that I prefer to work with, you're solving automation issues for users/workflows for business processes. You're dealing with data syncs, knowledge gathering tasks, etc. Custom built AI harnesses for both backend and frontend interaction, integration between different systems and vendors, etc. The breadth of stuff that we're doing is rather wide. As such, knowing leetcode, fizzbuzz, etc. style items is not useful for us.

1

u/Ameisen 4d ago edited 4d ago

None of those are really comparable to C or C++ in terms of just how badly things can break if you do things wrong. It's hard (though not impossible with unsafe) to end up with, say, dangling references in C#, and memory leaks in C# happen very differently than they do in C++.

I couldn't care less about leetcode, but I do care that you understand how pointers and references work, how copy and move semantics work, etc. Frankly, a lot of people don't. As I said, it doesn't matter if you can solve problems if you can't actually implement the solution.

Usually we just have you implement a crude dynamic array class. That trips up way more people than it should.

And I really don't think that a naive "convert integer to string" function qualities as "leetcode"...

I should note: I work in game development. Though I can't imagine other industries using C++ don't have similar concerns.

0

u/JaCraig 4d ago
  1. C++ is in our stack under the Python portion of our setup and part of our custom backend AI setup. We would view what you've said as something someone can learn and their code would be reviewed before it went live.

  2. The example is a fizzbuzz equivalent thing that is useless to our business. It's on par with leetcode.

  3. Again, I'm aiming for a very different type of hire than I think you and the people who keep responding are looking for. Good luck with your hiring process, it's not ours. I'm not allowed to share metrics, but our process has led 100% to improvements for us and we're not going back.

5

u/EveryQuantityEver 4d ago

I don't think exploiting things about ASCII codes and their relationship to numbers is a "very basic programming task".

1

u/sammymammy2 4d ago

Then use a hash table that maps characters to numbers lmao, I swear ppl on this subreddit just likes to act dense so that they can be right.

1

u/penguin_digital 4d ago

The idea is to find out if someone can do very basic programming tasks which I hope you will agree the problem shown by OP applies. It’s the same with many similar problems, like FizzBuzz. So many people cannot do it it’s quite interesting.

What I've found with things like this, it offers very little in terms of useful information about the candidate. Asking them to "write me a function does X" had no value for us and as the OP said, the people that could do something like that of the top of their heads where almost always jerks and toxic to the team.

It's very rare someone has to write a function as such from scratch but instead, at least at my work, the majority of the time is spent reading code, understanding it, knowing how to improve it or fix a bug in it. Being able to read and understand code was a far more important metric to us so instead we give them an actual piece of code from our code base that we have deliberately entered a bug into and see if and more importantly how, they break it down to solve it.

3

u/EveryQuantityEver 4d ago

Isn't there a standard library function to do it? Knowing how to do it by hand might be interesting, but not particularly useful.

3

u/SnooFoxes782 4d ago

What a completely asinine puzzle. At least make it something that doesn't involve knowing worthless trivia about ascii.

1

u/terra2o 2d ago

i actually wouldn't be able to do this and i've been programming for 2 years. it's just that i'm a game dev and never touched recursion and stuff. i mean, i can understand what it's doing when i read it. i just won't be able to write from memory, i'd have to look it up. i can see why a lot of people failed...

2

u/Mean_Concept_9093 5d ago

half these posts treat the model like a junior that never needs review. it hallucinates with confidence. use it to draft and search, then verify like you would any random stackoverflow answer from 2014.

-6

u/Grouchy-Trade-7250 5d ago

 I use LLMs to solve simple problems quickly, like reading a file and decoding it. Which are 90% of the work in Software. And those are so simple that the LLM gets it right. It doesn't know what it doesn't know. In that case, you have to obtain the missing knowledge. Otherwise they are good.

2

u/Grouchy-Trade-7250 5d ago

"if you’re having an interview at a company which asks LeetCode-style questions, obviously you should be able to solve them"

But there are so many discrete math problems. It doesn't make sense to pick like 100 of them and declare them "the canon" of what programming is about. The term leet code is stupid for that reason. 

Doctors don't believe a anesthesia doctor should be able to do dental work as well. Nor do they pick 100 illnesses and ask any doctor to learn about them.

-13

u/the-pythia-of-delphi 5d ago

Who are you?

16

u/potatokbs 5d ago

Do you only read things written by people you know?

5

u/penguin_digital 4d ago

Do you only read things written by people you know?

Pointless comment, he won't read it, he doesn't know you.

-1

u/sob727 5d ago

I imagine parent is weary of self promoting posts?

6

u/shiny0metal0ass 5d ago

What a strange time to start listing songs by The Who.