Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: Does LeetCode/HackerRank make you a better developer?
27 points by skwee357 on Oct 31, 2023 | hide | past | favorite | 27 comments
I know this is question is very broad, but bear with me.

I consider myself a strong engineer. I have 14 years of experience, I'm mostly autodidact, and I can learn new stacks/technologies pretty easily.

Being an autodidact, I don't possess a degree, however I know about basic algorithms such as binary sort, quick sort, graphs etc.

Recently, I started to interview again, and some interviews require HackerRank test. Some tests are designed to evaluate a specific knowledge, say SQL or multithreaded programming, while other questions are purely algorithmic (in the style of: "find if a string is an anagram").

I don't have a problem with specific domain knowledge questions, such as SQL or multithreading. I do have a problem with purely algorithmic questions. I never used binary search, or needed to reverse a string as fast as possible, in my career.

And, sadly, I start to question my career. Do I suck at those questions because I never worked with something algorithmically hard? Do I suck at them, simply because I'm not used to solving them? Are they even good evaluation tools to understand if the candidate is suitable for the work he/she is going to perform?

So my questions is: do you think that being able to solve LeetCode/HackerRank questions (not brute forcing them, but rather understanding the underlying algorithm) help you become a better developer (rather than better at solving these types of questions), or are they, mostly, useless and it's better to build and ship software?




The short answer is, No.

> Do I suck at those questions because I never worked with something algorithmically hard?

You probably have done some algorithmically complicated things in your 14 year career. Of course someone has always done something _more_ complicated but whatever.

> Do I suck at them, simply because I'm not used to solving them?

Yes. LeetCode can be compared to the SAT or ACT in the United States. It's a standardized test where you can improve your score simply by knowing some tricks and how the test works.

> Are they even good evaluation tools to understand if the candidate is suitable for the work he/she is going to perform?

Absolutely not, unless the LeetCode questions are somehow directly related to their day-to-day job, which is in the small minority.

> do you think that being able to solve LeetCode/HackerRank questions (not brute forcing them, but rather understanding the underlying algorithm) help you become a better developer (rather than better at solving these types of questions), or are they, mostly, useless and it's better to build and ship software?

I think understanding the underlying algorithms can help one become a better software engineer. Mostly things about data structures focused on when to use one over the other, some efficient sorting algorithms, that sort. Not an obsession with Big O notation, questions with very specific algorithmic solutions such as "given a list of integers from 1-100, in a random order, and one is missing, how would you find the missing number", and the like.

But yes it's always best to build and ship software. That's supposed to be the point of learning these things in the first place. Shipping trumps everything else, always.


I share your sentiments. I, too, have never needed to reinvent the wheel and implement my own list class in Python say instead of using the one from the std lib. And countless other similar cases and things.

That being said I think places do Algorthimic tests for two reasons:

Laziness Scale

Laziness. They choose this because they can’t be bothered to come up with a puzzle from the work and make it scoped well enough to fit an interview but also challenging enough to show the interviewer the candidates skills. So instead they have you implement some algorithm you memorized.

Or they’re lazy because they’re incompetent interviewers and use these as a proxy for IQ. If that’s the case just leave. You don’t want to work there.

Then there’s scale. Google likely gets 1000 applicants or a given role. (Maybe more by a factor of 10?) How would they filter out enough candidates before you sit for an hour with an expensive engineer? They need a way to quickly filter out a ton of folks.

So that’s scale. It’s got a bit of laziness in it. But it’s primarily about managing the number of folks looking to try for a single job.

All of that said I’m just a tardigrade in a fast chasm of space trying to take on the Death Star; there’s no way the tech firms will change their hiring ways because of some logical aren’t on my side.

And who knows? Maybe you’ll get hired at Google and then go work on the next generation of kubernetes 2.0 — the point being this is a necessary evil that stands between you and many others to get paid 500k/year.


I think a good developer is composed of many things, and LeetCode/HackerRank type learning can help you become better at only a small subset of those things.

It's like trying to get your body into good shape, you need to work on different parts of the body, not just focus on your left arm (unless your left arm is especially weak and you want to focus on that).


I think leetcode helped me quite a bit as a software developer. I was in a similar boat as you, 12+ years experience doing software. I have an electrical engineering degree (famous for being bad programmers ha!) but no CS background. I could normally hack at problems, figure things out, and get things done in different settings (Linux, embedded, web, etc).

However.. studying leetcode really helped me understand fundamentals much better. I also read some algorithm books. I feel like I have a better understanding of software in general! And it has helped my career tremendously. Just my experience, I totally understand why people don't like the interview but for me I appreciate how coding problems are at least more straightforward than other arbitrary interviews.


Nah. The secret is that interviewing skills are almost orthogonal to real life skills. It doesn't hurt to have the know-how, the chops to do the leetcode problems but it's questionable if you will ever be able to use them in the real life (unless you do really specialized work - and at that point you will need to know way more).

So 1) don't feel bad. it's just like a muscle you don't normally exercise. Start exercising it and you will get better. 2) accept that this is part of our shifty industry - it is what it is. It's pretty dumb but you will have to go through this hazing ritual every time you get a new job.


I don't necessarily think that practicing leetcode will make you a better developer, but good developers should be able to solve most leetcode questions in a few hours from scratch (with full internet access) without having ever seen those types of problems or data structures involved - maybe not with perfect computational efficiency, and certainly not in 30 mins during an interview

That said, writing more code and solving harder problems is what makes you a better developer - so if leetcode is what gets you to do that then it will probably have the desired effect


Consider trying last year's advent of code -- I think they are fun puzzles, and in my opinion, a programmer able to deal with logically complex requirements should be able to solve them all.

I've been a professional programmer for a long time. My opinion is that what we mostly do is more akin to plumbing than "engineering". When we say "complex" we mean DAGs, CI/CD pipelines, a self-healing K8s setups, and so on. But this stuff -- at least in my opinion -- just isn't very hard, not in the way that a fancy video game, a robotics control system or a sophisticated compiler can be.

Computer science and mathematics applied to coding and internalised in your practice will not merely make you a better developer, it will put you on another level; you won't see code the same ever again.

Finally, I'd suggest that solving puzzles is more indicative of what you already know rather than a good way to acquire new knowledge.


I prefer the adjectives strong/weak over good/bad or better/worse to describe developer skill for two reasons. Good or bad can be perceived as an inherent quality, while it is obvious that strength is acquired. The second reason is because better/worse can imply subjectivity. That is, that it wouldn't be possible to tell a strong developer from a weak one because it is all in the eyes of the beholder or some BS like that.

Onto your question, the answer is yes, very much yes. Solving puzzles indeed makes you stronger. It exercises your brain exactly like lifting weights exercises your muscles. Almost any skill can be trained the same way; there are chess puzzles, writing "puzzles", acting "puzzles", even musicians have certain "puzzles" they hone their techniques on (e.g Segovia scales).

I don't know why puzzles have such a bad rep on Hacker News. It may be a case of sour grapes. Like you see a jacked dude and you think "Eh, easy with steroids!" or "Yeah, but does he know basic arithmetic?" Cause admitting that he spent countless hours in the gym while you (like me) spent countless hours watching movies and eating chocolate is a too big of a blow to your confidence.

Apparently some dude didn't land a job with Google because he couldn't invert a binary tree. So he thought it was useless. I looked it up (https://leetcode.com/problems/invert-binary-tree/) and had a laugh. Because the solution was readily obvious and required no more than three lines of Python.


My exact experience, just few more years. And no, I’ve never heard from anyone in my (decent above average) pay grade about their production leetcode success story. Not even a glimpse of it, not a single time.

I myself though implemented BFS once for a factory which planned tight supply for scheduled orders. That was it. Highest CS I ever needed.

do you think that being able to solve LeetCode/HackerRank questions (not brute forcing them, but rather understanding the underlying algorithm) help you become a better developer

Being aware and understanding what it does is enough, like in “it does x in log” or “it does x in nlogn with these caveats”. I’d never try to reinvent/reimplement any of it and would object if anyone tried. Because it’s trivial to screw up an edge case, and given the amount of screw ups in plain dumb code… I don’t believe anyone who claims they could do it in the wild. It must be an academic setting, not a regular company at least.


I think they make for poor evaluations, though understanding the underlying performance characteristics and limitations of common data structures and algorithms can certainly be important. That said, you'll probably need to get at least somewhat comfortable with these sorts of problems if you want to interview successfully.

FWIW, the last time I was on the job hunt, I found it quicker and more helpful to use a guided/structured refresher on common data structures and algorithms rather than to drink the firehose of random leetcode problems. I'm sure there are many options out there, but I used AlgoMonster[0] and was fairly happy with it. (I have no connection with them other than being a satisfied customer.)

[0]: https://algo.monster


There's almost too many wesbites that compile leetcode questions into a structured format now, which is good but the competition is also immense now.

Some good ones are:

https://seanprashad.com/leetcode-patterns/

https://neetcode.io/practice

https://www.techinterviewhandbook.org/grind75?weeks=1&hours=...

I can add more later.


grinding leetcode problems does not make you a better engineer as the problems you typically solve day to day are very different from leetcode problems

i have come to the conclusion it is a mechanism for veiled discrimination and for testing how much effort you put into “preparing” for an interview… which makes no sense because you have been “preparing” for 14 years.

the hiring process needs to be fixed so it prioritizes other things but unfortunately it seems we are stuck with it for now. myself i have no patience to deal with arrogant engineers who think i should be able to answer their cute trivia question or be the fastest developer in the west to implement binary search.


I think those textbook algorithms make you think about efficiency. But all of them suffer from being short. In reality I design low level algorithms doing real business spanning 500 lines at minimum, and the point is to utilize and alter multiple of those textbook algorithms. Sometimes you need to add more operations in the middle, sometimes you need to extract the data from the middle of one algorithm and pass it to the others. But when you equipped with those knowledge about algorithms, you know what to do immediately instead of confusing.


I'm in the same boat right now. I'm an average programmer who's been doing it for around 6-7 years.

Most HN posts are way technical for me, but there's a lot of other good tech news on here.

I'm interviewing now and I feel like I chose the wrong career because leetcode is a requirement everywhere. I graduated 10 years ago and didn't even know what leetcode was until around 5 years ago. Although to be fair I wasn't taking programming as a career very seriously during my degree which was in CS, I have to embarrassingly admit.


It may.

There's certainly a positive to being able to work through some complex/theoretical problems. These skills won't help you much at all in practical every day development, but they would certainly help take your problem solving up a level from where ever it is.

Though.. I would argue that time is probably better spent building practical knowledge/experience through project based learning.


Absolutely not.

It’s pretty well established that the skills required for interviewing in the tech industry are not in line with the skills necessary to be an effective software engineer.

Anecdotally, I’ve worked with some complete utter doofuses who somehow passed the leetcode tests, but are completely incompetent otherwise.


sure, in the same way pushups make you stronger. unless you do other exercises too, your body will not be strong. you can get strong without pushups, if they aren’t fun. being strong and staying strong should definitely be fun. in fact, it had to be. it’s the only way to sustain it.


Leetcode problems at the very least teach one a few good things about the language(s) they choose to do them in, IME.


Certainly makes you a wealthier one.


It doesn’t make you a worse one.


I don't know, but they certainly killed my interests in CS.


As a software engineer maybe a little but helped me pass the interview.


Not really. You get some exposure to a few concepts that are interesting and maybe a bit understudied in school (like dynamic programming) but challenges like the Advent of Code are better at that in my opinion.

You need to understand where they come from, namely the need for a standard and reproducible way to test candidates in 4 or 5 slots of 45-60 minutes each, in companies with huge and generic hiring pipelines where any developer can be tasked to interview any candidate. Unfortunately a lot of companies have copied the practice from Google and other big companies while they would benefit from a small scale and more personal approach. I feel like today's situation is better than it was 5 years ago though, maybe the prevalence of full or mostly remote interview rounds and/or Copilot plus ChatGPT have helped make companies and teams reconsider.


They make you code under pressure for sure.


yeah


It doesn’t make one much of a better developer but it makes you a lot better interviewer. I’m just okay at leetcode and find the process to be incredible difficult for personal reasons - legitimate post traumatic stress from being locked in a room doing homework I’m in therapy for. In the workplace I can shine and do very good work and get a lot of accolades, but this shit is my kryptonite and I keep working on it.


no, i don't think so. i feel I get bad than before.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: