408 points · by Fattestmoron · 4y ago · 456 comments
I've been at it intensively for a couple months and my mind simply refuses to cooperate. If anything, after having done 400+ problems I seem to be worse at them than when I started.
Since your time is more valuable than mine, let me summarize:
7+ YoE, MSc. in some science (like it matters)
Last 4 years been mostly ETL with Spark and some backend thrown into the mix with a "senior" title for devops and mentoring noobs.
I used to think this job was a creative one, since writing frameworks and libraries for further use, documenting code and extreme programming made me think that I was building something new and useful.
In fact, due to having extreme ADHD the only thing that kept me distracted during all my overtime was the ability to pursue fun and challenging things. MPP and all the cool stuff you can do with modern tools is fun, interesting and challenging.
Leetcode isn't about fun and challenging things, it's about thinking in one particular way, spitting out solutions using the same exact data structures and jumping through hoops on command without philosophizing or creating anything that can be reused/extended.
This is also what Software Engineering has become: you memorize, regurgitate and participate in agile the masquerade. Creativity is shunned. Tried architectures/patterns are what is expected.
I wish I had practiced law for the past 7ish years instead, because at least all of my skills would still be relevant.
I am self-taught and I can't do these leetcode problems if my life depended on it.
I still deliver high quality software on time, and on budget, and have a solid grasp on my career.
I wouldn't worry about this too much. It depends on what you are going for.
Sure, if you want to pass a FAANG interview where you are going to get these types of questions, go for it. To solve day to day business problems, you rarely need this stuff. You just need to learn how to write quality, performant, correct code that results in solutions.
The best way to do this is develop experience in the industry over the years.
My 2 cents.
The only job I've ever had to do any kind of test for wasn't leetcode - just a practical demonstation that I could write a basic CRUD app. Was actually a pretty good test to weed out people who were just completely useless.
I'm also finding that experience matters. It's just tough to get that across up front.
I think this is a totally reasonable way to weed out applicants, particularly if they allow you to do it during the interview time. I've been through several interviews (though, to be fair, they were well over 15 years ago, since that's how long I've been with my current employer) that used a similar exercise. One interviewer just sat me down at his workstation, and told me to build a quick crud with their tech stack (which, of course, I knew going in). Nothing was off-limits (web searches, etc).
I ask because as a startup founder, I would significantly prefer to try working with someone for 3 months instead of doing useless least-common-denominator interview questions. It's a bad fit, it's better to quickly part ways. But getting fired or asked to resign is a big emotional blow for many people, and I'm not sure if they would rather face that than the Leetcode grind.
I'm fairly confident in my ability to deliver value in the first couple of weeks on a project, so would much prefer this to having to spend time grinding leetcode puzzles that I'm not innately good at.
Note: a large part of this perspective is the privilege of feeling like I could get another job pretty easily, and having a sizeable emergency fund that I could draw from to continue the search if things didn't work out. So you may be filtering out people who are not in such a fortunate position.
As this is a normal contractual regulation there is almost no risk of any legal trouble (usually).
On the other hand side as soon as this trail period ends all the German workplace protection regulations start to apply in case of permanent employment contracts. So after the trail period ended it gets quite difficult for an employer to get rid of an employee.
But all in all that's pretty fair, imho. After a half year you quite surely know whether you like the workplace, or form the other perspective, the employee.
Because there is a difference between writing FizzBuzz and solving one of those dynamic programming problems that are so common in competitive programming. For the former, I am surprised you can even work without being able to to this, for the latter, you pretty much need special training that is not very useful in most professional settings.
I never took a leetcode style interview so I don't know what is generally expected. If you are expected to do hard problems, it doesn't test much besides your leetcode skills. But easy problems look like a pretty good filter, assuming the stress of the interview isn't blocking you, which is another problem.
IMHO I believe the right approach is to either ask from a standard bucket of questions that require preparation and advertise which ones to candidates, or not ask them at all. Asking "only a few really easy ones" is becoming a red flag to me.
And what are you testing than? Whether someone can memorize things?
Even though I'm not good at memorizing things every second monkey out there is.
Actually, people relying mostly on memorization for "problem solving" aren't very intelligent in my experience.
Especially in software development you don't want people who can mostly only reproduce things once learned by heart!
No two problem instances are exactly the same. It's all about the context! What is the recommended text-book solution in one case could be the most stupid thing you could probably do in another superficially "similar" case. You want people being able to recognize the difference and act accordingly.
(Of course you need some amount of drones in every company. Especially when your company is big. Not everything needs highly skilled and highly intelligent employees. Also there is only a given amount of adequate people available at all. If you're big you can't be too picky if you want to hire enough staff in a reasonable time frame. But those are problems of really large organizations).
But what if too many people pass those filters?
Then we move onto mediums.
But what if too many people solve those?
And that is how we reached the current state of interviews.
* I confirm that day to day business problems rarely are the sort of problems you find on Leetcode.
* I might ask similar questions in interview. I don't expect the candidate to solve them. As a matter of facts, I don't care if the candidate actually solves them or not. I am observing how the candidate behaves in front of a difficult problem. Will they freeze? Will they jump head in the code? Can they articulate their thoughts and think analytically about it? Can they think on the spot if I challenge their approach? Are they comfortable saying "I don't know"? This sort of things.
In my book, being a "good engineer" is much more about communication, collaboration, familiarity with git/sourcecontrol, clarity of commit messages, pertinent emails, being reliable, being resourceful, etc.
Good grasp of algo is a big plus, of course, but it's not something that all the best engineers excel at.
So what if they freeze during those 45 minutes? How representative is that scenario for what most devs do?
Also, most problems are not solved in the 45 minutes and in day to day coding , we generally have a minimum of day to think on the problem and solve it without people looking over our shoulder, google or ask someone :)
If a candidate freezes for 45 minutes in a 45 minute interview, they won't get the job.
... Right?
Clearly thinking on your feet in front of people is what it means to be good at ones profession.
And yes, if I ask you a technical question and you freeze, I don't want you on my team. It doesn't mean you're a bad engineer. It means you're not a good fit.
Don't undersell yourself, you ARE able to do them, maybe with some practice, like putting some basic algorithms implementation into your muscle memory.
Doubtfully it'll make you a better developer though.
Anyway, the most important skill for FAANG interviews is ability to write code on a whiteboard with a dried out marker.
The reality is that if this person's life really did depend on it, for example they lost their job and they have bills they need to pay or a family they are responsible for taking care of, then they almost certainly could put in the effort to brush up on their skills and get to a point where they could do leetcode easy or leetcode mediums in a matter of weeks or a month at most.
It's along the lines of an MIT grad saying that where you go to school doesn't matter or a rich person saying that money doesn't make you happy, or even the myth that Einstein failed at math. These statements that espouse a false sense of modesty have great appeal and they likely come from good intentions, but ultimately they give people bad ideas about what it takes to be a fairly competent developer.
This would be a good April Fools ecommerce site. "Dried out markers! Guaranteed to land you a job!"
For OP, I read your post and the post you linked from 9 months ago. It sounds like you two have fairly different backgrounds and experiences. The other poster said they had only worked for 1.5 years before getting fired at a first job, and then spent time leetcoding. 1.5 years is a short time for a person to be able to learn how to effectively work in a grown-up world after school/college. In fact, I had a similar experience at my first job (I didn't get fired, but I was getting below-average performance reviews and I left on my own), also for about 1.5 years. It wasn't until later I learned what matters, what to do and what not to do at a job, and then excelled.
For you, it sounds like you've already learned it, evident from the fact that you had 4 years at a real job with a senior title, proving that you can do it well. It sounds like your issue is more around finding meaningful work, having a disdain for the current trends of agile, react, CRUD apps, etc. which isn't uncommon. I think there are other solutions to what you're facing, and leetcode isn't it.
For me, the key has always been working in an industry I'm truly interested in, then I can dive deep into the business domain knowledge. I'm a very senior level engineer and I'm good at it but at the end of the day the code is still just a tool to me. I don't really care if architectures are tried and boring, I just want to make business impact and build products. Maybe it's the same for you, maybe not. The key is finding what matters for you, and not care about parts that don't matter.
Off the top of my head, React uses lots of graphs and trees to render stuff.
Also there is almost never a reason to implement such things yourself—even when you need the algos—as there are libs for that! (Imho one of the biggest signs of incompetence is when someone starts to reinvent the wheel! That's an absolute no-go. And the truth is: If you're not in academia doing research all the wheels you ever need are already invented).
A valid test for a candidate would be whether he/she is able to google for an algo and pick the correct code form the results.
Such a test would be good enough as a lot of bad candidates would fail as they wouldn't google but start to "solve" things on their own; the other bad ones wouldn't be able to pick the right solution at all—because they don't know what they should look for in the end.
I believe you and others when they claim they are good developers. I just want to point out that for many people, it can be impossible to understand how your minds work.
Maybe it is a bit like dyscalculia, where some people can not comprehend "amounts". They can not calculate well, but they can actually be good in other fields of mathematics.
Edit: I never did a lot of leetcode, but for reference, here is a problem they categorize as "hard": https://leetcode.com/problems/median-of-two-sorted-arrays/
It requires calculating the median of an array. Is that really a kind of thing people who are otherwise good developers can not do? I must admit it really boggles my mind and makes me a bit hopeless and desperate. It seems all attempts to explain stuff to people are futile anyway, at least for some things.
There's a huge meta-game around these questions that you pick up after practicing them enough.
Even without the hint, I intuitively know looking at that question that linear time is too easy for a 1 hour face to face interview at Google.
I also know that as the data is sorted the optimal solution must be logarithmic, as in these contrived problems there's no such thing as an unnecessary detail. Monotonic means binary search.
I haven't built this intuition from my experience as a software developer, but by spending my free time playing the game and grinding these arbitrary puzzles.
The fact you missed this meta, tells me absolutely nothing about your skills as a developer, only that you haven't been grinding leetcode.
That shouldn't be a signal not to hire you, but that's how the game works at FAANG.
If you can make this observation about the arrays, and code a fully functional binary search taking into account whether the total length of both arrays is odd/even, handling the out of bounds case, whilst under pressure on your third interview of the day with just the intuition you've built in your day job, then as far as i'm concerned you are the exception not the rule.
I really appreciate your greater point. I've been given all sorts of CS problems in interviews that I don't have any background in understanding the context enough to know what to do. I changed careers from experimental physics, so my software work is essentially self taught. That doesn't mean I'm totally useless in my job or not an asset to my team or can't deliver products that generate massive revenue. But, those things are how interviewers make me feel.
Merging and comparing arrays as in that task also seems like something that might actually come up in a job.
However, I take the point of the other comment that the real issue here is doing it with certain speed requirements. That does make it harder, indeed, but still doable.
Also I must admit I used to enjoy such tasks more in former years, now it seems more like a needless chore. On the other hand, somehow I feel compelled to solve games like "Human Resource Machine" or "Infinifactory", which can be equally tedious.
I'll try to solve that leetcode task.
A good exercise, I think, would be to ask people to implement binary search (assuming they never have before). We can all intuitively explain the algorithm, but actually getting all the code just right is a little tricky. See if it trips people up. Then ask them to do it in 20 minutes or they are fired (e.g. comparable to interview scenario).
>I still deliver high quality software on time, and on budget, and have a solid grasp on my career.
There's simply no way of proving that to recruiters without Leetcode.
If a recruiter can't assess engineers without something like Leetcode, they need to find a another job. Assessing talent is the job of a recruiter, and if the only way they can do that is with Leetcode, that's just pathetic.
OP claims to have done 400+ LC problems over a couple of months. Let me say it out loud here: this is simply crazy. It strikes me as an attempt to not learn how to tackle these challenges, but to actually brute-force through them. To anyone preparing for an interview: don't do this! Grab a book like Elements of Programming Interviews (EPI), maybe follow some online courses on programming puzzle patterns, and then start grinding LC. Maybe interleave grinding with learning? Your end goal should be to develop deep understanding of what you are doing, not memorise the solutions.
Also, while going through LeetCode, it is very important to realise that the problem classification there is a bit wild at times. Don't stress that you cannot solve a medium sometimes as they are mislabeled. I did mediums that could be hards, hards that could be mediums, and hards that were just impossibly hard. Typically a very hard problem is not something you should expect in an interview setting as most interviers* don't expect you to implement KMP on the spot. Doesn't hurt to know it and impress the interviewer with knowledge, but if you think memorising KMP is the way, you're mistaken.
* - there is still luck involved and you can have a crazy interviewer. It can happen, so just accept it and move on. Don't treat it as a personal defeat.
Source: I grinded and I had offers from most of FAANG letters.
I didn't feel a need to do much more as they had very similar patterns. I did attempt the ones I had solved more than once though, but it was to really drill in the principles behind the problem rather than to try and "memorize" them.
Prior to my prep, I had almost 0 algorithm experience. I got an offer from every FAANG I applied for.
Easy problems literally mean jack and I don't even think 50 medium problems could span all of the possible topics.
Sounds like you got in when it was easier.
Out of the 12 companies I applied for I was given 2 hards (both were private startups), the rest were all mediums.
>nearly 100 lines of code involving multiple steps
I was never given anything even close to involving a 100 line solution. Are you sure this was even the correct/optimal solution? Either that or you're very unlucky. Which companies were asking such questions?
>50 medium problems could span all of the possible topics.
I was given problems that I hadn't encountered before, but I was able to solve them by deduction/critical thinking and applying the appropriate algorithms/patterns. Often the easy solution and the optimal solution weren't even that different, and just involved using a hashtable.
Grinding through hundreds of LC to try and memorize/familiarize yourself with the solutions really isn't the right method. Have you read Cracking the Coding Interview? Gayle McDowell has some videos on youtube in which she explains her process.
You should check out https://github.com/poteto/hiring-without-whiteboards, which is a list of companies that don’t use LeetCode in their interview process.
An issue I often ran into when using the repo myself was I’d find a company that sounded awesome, and then find that they didn’t have any open positions. I created nowhiteboard.org to act as a way to pull all the jobs from the companies listed on that repo (and other companies that I’ve manually found that don’t use LeetCode).
I think there’s a matter of education and shining a light on the companies that don’t use LeetCode as I feel that the prevailing notion in online communities is that companies only use LeetCode to interview. I’m obviously biased since I’m obsessively researching this, but I’ve read a good few comments online of engineers who’ve stated that they haven’t had to use LeetCode for any of their interviews over their career, and that all of those companies aren’t listed on the repo above.
If companies had a good way to source candidates that are hesitant to jump jobs specifically because of LeetCode, I could see our industry starting to make some semblance of progress towards making LeetCode less prevalent in interviews.
Anyways, rant over, hope your job searching goes well!
Any mention of these gets a hard NO early on during the interview process.
It's really insulting to put so much effort into something and then get treated this way.
Recently: * burned 2 days PTO putting together a comprehensive solution I was proud of. Feedback was they wanted me more proficient in their specific tech stack. I'd already said I was looking to learn their preferred language on the job and would do the test in a language I was more comfortable with, and they had been happy with that line of discussion.
* was given an open ended dataset and told to spend 2 hours on it. Did all the initial analysis I do on any new dataset in my regular day to day job, spending a little more than the allotted time, and found some interesting things. Feedback was that I should have gone deeper in my analysis.
I think if I had the power, I would allow candidates to have multiple ways to interview at a company. Some companies do this already where the tech assessment portion can be administered as a take-home, LeetCode challenge, or re-factoring some sort of code.
There are downsides to LeetCode, and there are downsides to take-home projects. My intention with the website is to offer extra choices to developers when choosing to interview at companies.
And I think as a candidate (and companies as well,) LeetCode is the more scalable of the interviews since there’s defined criteria to study and to test on, so I do see the merits of your POV!
I’m not necessarily about this full-on hatred for LeetCode, BUT I also did buy fuckLeetCode.com just in case
I also find that Leetcode translates really well into the code I write in my freetime (a roguelike. Real work is boring fullstack crud). I personally hate reaching for libraries in my side projects, so being able to have these data structures and algos at my fingertips and being able to implement say A* or a weighted rng function or something else on the fly has been super handy. I honestly don't think I would be able to implement a vertex fragment shader w/ lighting without the skills I've picked up from Leetcode grind.
"Solve this problem in 45 minutes. Top to bottom, single pass, no typos, right now, while I'm watching and interrupting your thought process. You are not permitted to feel anxious. You now have 43 minutes - Go!".
This is not a representative field test.
The "right" way to use Leetcode, is to treat it similarly to how IBM does their weird IQ test screening, except Leetcode is strictly better than an IQ test. It is NOT a simulation of work. It is also NOT an "intelligence" test (thank god for that).
If anything, it is closer to how professional sports teams evaluate young athletes via a training combine or a set of individual drills/tests. Doing vertical jumps or sprinting really fast are not "representative field tests" of how well you actually play a sport (the whole sport, not just a single part of the sport), but they are good-enough filters for an athletic "interview".
However, in the same way that IQ tests are bad for a multitude of reasons including implicit demographic biases, so too are Leetcode tests flawed (including a heavy element of age-ism, as there is a strong anti-correlation between "years since college" and affinity for Leetcode-style tests).
I disagree for the same reason that I didn't like D&D-style magic, where magic-users memorise their spells and can only do magic as far as they still have spells in their memory "slots". That's not how real magick, a.k.a. programming a computer, should be like. Memorising solutions is useful and you should not reinvent the wheel (ahem, which means you should use libraries actually) but I am not convinced you can really learn The Laws of Magick (principles of programming) by solving specific coding exercises and memorising their solutions.
True, but my understanding is in interviews, which is the context most people are interacting with leetcode, the interviewer is looking for only one of those answers, and you have to regurgitate the right one fast.
I’m not sure how common this way of thinking is, but I wanted to point it out since many of the comments here make it sound like only the best answer will do.
I've been doing this crap way too long to do brain teasers at an interview. I suck at them, I always have. Advent of Code makes my brain hurt.
That doesn't mean I can't design, implement and lead a team to create a service that can handle insane amounts of load with minimal cost.
Can't even think of a similarly stupid thing to ask for a different field. Are doctors quizzed on House[0] -style patient cases to see if they can tell the actual cause from the top of their head?
You just answered a different question. OP was referring to job interviews, not certifications (most certifications in S/W development work the same way).
The analogy would only hold if medical doctors would have to do these multi-hour exams each time apply for a position.
So do they?
Or is it a certification exam comparable to an AWS/Cisco/MS cert?
Now that I'm looking again I do see that many companies have switched to practical take-home type stuff, which is far preferrable.
But what really surprised me are the portfolios — trainee doctors keep track of things like procedures done, so they can present a portfolio at job interviews.
OSCE example: https://www.gmc-uk.org/registration-and-licensing/join-the-r...
The BMJ on “Creating a good portfolio”: https://www.bmj.com/content/338/bmj.b811
I don't know about doctors but police inspectors are definitely trained on Cluedo. /s
I get the sentiment. I really do. I have been both a programmer and a lawyer. I was a programmer for about 5 years in the late 90s/early 00s. Then I was a lawyer for more than 10 years.
Being a lawyer is not better than being a programmer. For the overwhelming vast majority of lawyers, you either make a lot of money killing yourself with lack of sleep and high stress and wasting your life doing the same shit over and over again, or you make a loooooooooot of money doing that same thing but making a bunch of assholes even more money in the process, or you make very little money but not proportionally less hassle/stress/life-wastage. Yes, your skills do retain relevancy for quite a long time though. There is that. But so what? Still gotta do shit-tons of CLEs every year. Still gotta keep up with the laws and chase clients (unless you're the super rare rainmaker or are okay stagnating).
After I got tired of being a lawyer, I went to be an experimental scientist. This has been nice, but it's not for everyone, of course.
I was going to continue on to a PhD, though my circumstances have changed enough that I am no longer sure if I can do that, as much as I want to do that. I have been thinking long and hard about what to do lately. Having had experience as both a lawyer and a programmer, I tend to lean towards going back to being a programmer.
My only real point though, is, the grass is always greener. :)
In the end, I really do sympathize. I'm not trying to be critical at all.
It sounds like hell compared to a software job.
Software development isn't perfect, but the compensation, hours, freedom, time off, potential upside, even stupid stuff like being able to wear normal clothes or get flights paid for if you want to go to a conference. It's a pretty sweet gig.
LC was obviously to prep for interviews which are time boxed. This means for each problem I had to:
- plan, come up with a pesudo-code and verify the correctness *before* implementing it
- write concise and readable code
- make practical tradeoffs
LC isn't fun. Maybe it is for some folks but it was discouraging for me to some extent since it made me compare with folks who can solve these problems when I'm clueless
But this was the eye-opener at the same time. It was shocking to see someone can solve the same problem with less than 10 lines of code when my code is 100+. It taught me what parts of my code was unnecessary and also some neat tricks certain languages provide
This isn't to say I'm LC God. I still suck at LC but what I appreciate is I get better little by little. I tried a medium level question last night after more than a year of break and couldn't solve it haha
I see your point about creativity. I think algorithms are mostly memorization. I'll never be able to come up with KMP algorithm or gift wrapping algorithm from scratch. However, how to apply these algos on a problem or transforming a problem into another problem that can be solved easily is creativity IMO
I do have ADHD as well and my advice is this is something you have to solve with pychaistrists with different meds and therapies.
LC is not fun but necessary to be a good engineer IMO
It did alter my coding too.
You are not an 3l337 h4x0r who p0wns puzzles for a living. You're a professional software developer who builds useful systems for people and organizations.
It sounds like you know the kind of culture you've enjoyed, and you know what the red flags are. Which makes sense. I think everyone gets pickier as they gain experience.
A classic.
Even if you don't do well at the single LC style question in our interview loop, you can still pass and be hired, there are other things we ask that are specifically NOT LC type questions.
Find a startup to interview at, skip the 4 LeetCode questions in 4 hours interview.
The amazing thing about SW is you can get a job - and even some of the best ones - without any formal education. So even if you don't agree that the ability to solve Leetcode problems is predictive how good an engineer is - just power through it.
And keep in mind that, for example, Electrical Engineers have to know tons of difficult math, physics, circuit theory, analog and digital design - and yes - even programming, where the acquisition of these skills is just as hard as getting decent at Leetcode - just to make a fraction on what you make.
In the US of A. In continental Europe this is just an office job. Maybe you can consider it an upper-middle class job if you're senior enough.
Pay is not related to effort, pay is related to value provided.
Its not an insult, comparative effort is a way many people think at the bottom out of necessity to focus and escape, people at the top gaslight people into thinking this way to retain all the value.
Tiger Woods started training at age two, and spent his entire childhood training hard, consistently, repetitively, nauseatingly.
It takes monumental 'raw effort' to get into a good law firm and to work your way up.
But the partners, even though they don't have to do a lot of the grunt work, are not slouching. They are busy to the point where it can even take over their lives: social aspect of their lives blend with business. Imagine your ski vacation becomes 'work' because it's with the clients. Etc..
This process lacks inspiration. Even following a company’s “false positives are worse than false negatives so we don’t care that experienced people can’t pass” logic, leetcoding doesn’t help with that. So a third unknown process needs to be done instead.
The simple reality is that there is alot to build, in this sector. People can slave away preparing themselves for a lower paying job with higher requirements, and that has nothing to do with whether this sector pays alot now or 10x more in the future. The market is saying what to do. Hiring practices are hampering the market efficiency. Full stop.
I think it's a weak correlation at best. A single data point (Tiger Woods) doesn't constitute a correlation. People working manual labour jobs put in a lot of effort, but they create comparatively little value.
I suspect that leverage and value are highly correlated. If you have more leverage, you're probably going to create more value.
I resent the implication that we should beg to be paid what we're worth and be grateful to be made to do a jig in a tutu for scraps that fall off the table.
Managers of those engineers can make more plus they don't have to do technical interviews
Software engineering is an engineering discipline, not an art. Engineering is about applying the best known methodology to solve problems.
That does not mean there is no room for artistry and creativity.
But most jobs are looking for software engineers, not artists. To them it's more important to have a reliable ETA and get a robust product than for you to find new and creative ways to solve their problem.
Live out your need for creativity in your open source side projects.
Generally speaking: Be creating in WHAT your are doing, not HOW you are doing it. The more creative your methods are, the higher the likelihood of failure. Which is good if your goal was to learn something, but not so good if someone is paying you to solve their problem.
Also note that most software engineering is grunt work. That does not mean it can't be fulfilling, but it does mean you don't have to be a 10x engineer to do it. View software engineering as a great way to make money. Then tend to your needs in your side projects.
For most software projects including web development or CRUD applications, there is no known best methodology to solve problems. Despite how passionate some people are about extreme programming vs. pair programming vs. TDD vs. this vs. that, there is surprisingly little empirical evidence that one methodology is actually better than another. We do what we do out of imitation rather than out of solid and well researched engineering principles.
Other software engineering roles do involve a fair bit of creativity though, e.g. architects (designing the structures), computer scientists (study how to make better bricks), and perhaps also project managers (coordinate brick laying and manage bricklayers).
At any point of time, have two buckets of projects to work on.
#1 projects that lets you apply what you already know and ship fast while being useful in real world (typically dayjob takes this slot)
#2 projects that lets you learn new stuff and think creatively, while affordable to fail or ship slowly (usually side projects)
Following this gives you a balance and avoids burnouts.
and example might be a permissions feature that could be designed as adding a column to each row, or could be more generalized into a foreign table giving the ability to N:N, or create arbitrary new permissions etc.
It's a bubble of a specific type of engineer. Have you tried your hand at project Euler or Advent of code? I feel like those problems are like leet code( or hacker rank) problems but with a different bent, one thats more enjoyable and allows for greater level of creativity when solving for them.
I also want to affirm that yes, part of the reason for these tests is definitely to check that you are able and willing to jump through the hoops that a large organization sets up as it scales; it's no fun at all.
As someone who's done the grind myself, I would push back slightly and say that the skills I use to solve leetcode problems are ones I've used at my BigTech job, and that that can be fun and useful. Gaining that type of insight though, generally doesn't come from just grinding leetcodes over and over again, but also returning to study algorithms textbooks like CLRS. The insights you gain from understanding these techniques deeply can lead to some truly interesting solutions to real problems.
Best of luck.
a formal 400-level course in algorithms will go a long way, preferably at a good university with a good professor, but if you can't get that right now: https://ocw.mit.edu/courses/electrical-engineering-and-compu...
computer science is a discipline where people seem to think the education doesn't matter that much, but the truth is once you start to get even a little mathy it matters big time
I think when people say that education doesn't matter that much in our field; they are talking about formal education as offered in academia.
This is not to say that university education isn't valuable. But SE is unique among engineering disciplines because a) it is possible to learn everything relevant in self study and b) a lot of formal education in the area still teaches CS, when most people who attend the courses want to be engineers, not scientists.
On a personal note, I do believe LC has made me a better programmer. In my 3rd year of BTech, I was given a task to figure out splitwise (a bill splitting app) algorithm. I was quite proud to have written a modified version of Kruskal's which solved the problem. Last year, I saw the same problem on LC and it had a much cleaner and nicer solution to it. The solution opened up ways for me to think in different terms all together.
Similarly when I was in my 1st year, we used to play `Chain Reaction` a lot and I wanted to write a brute force A.I. for it. I had not been introduced to graphs, DFS or BFS algorithms. Hence, I had basically produced a recursion hell but working solution. Later when I had discovered DFS/BFS, I was ecstatic to say the least.
Thus, I believe LC helps/prepares/arms you with various techniques which you could leverage to solve certain problems in a more efficient (and also as a result, cleaner code) fashion.
Also, SWE is a highly movable profession, where being more than 5 years on the same place is unusual. So every ~5 years you have to polish your CV, grind LC and basically restart learning all computer science concepts you haven't used in those ~5 years, without feeling burnout or dismay.
How do you feel about puzzles in general?
I have a really strong antipathy towards 'solving' anything that I know is (a) already solved and (b) where the solution process is not interesting in and of itself. So I hate, hate, hate puzzles.
Your post made me wonder if there's a link between ADHD and finding explicitly pointless challenges unbearable. It feels kind of intuitively true that ADHD predisposes one to cut a lot of mental chaff in order to focus on stuff that's engaging and interesting; a puzzle is kind of explicitly chaff, it's something you have to manipulate in some way to get some predefined result.
The normal trick if you're up against this kind of intense, adhd-driven disinterest in something is to see if you can twist it in some way until it's interesting for you again. So instead of seeing the puzzle itself as the challenge, turn it into a training process for something for something you consider worthwhile.
I love puzzles though. They're short, they have a right and wrong answer. Optimization problems are especially satisfying because you can get a score, and improve on it over time when you come up with clever ideas.
I've never done any problems on leetcode, but thats absolutely my wheelhouse and I love that stuff. A few weeks ago I invented a new String (Rope[1]) class by combining skip lists and gap buffers. I don't know if anyone else has ever done that before. Its 3x faster than the next fastest library I could find. There's probably an academic paper in that, but that sounds really boring.
Maybe its useful for other people, but I think if you said "leetcode is a training process" to me, that'd make it more boring. For me the fun part is finding those puzzles in regular code. ("Sure this algorithm is simple but its n^2. I wonder if there's an O(n log n) approach out there somewhere..?")
[1] A rope is a "fat string" for text editors and things, where you want to insert / delete characters at arbitrary positions. My library is here - https://crates.io/crates/jumprope
But plenty of algorithmic ideas are broadly applicable and useful. Eg, b-trees, bloom filters and priority queues have some wild uses across a host of problems. Those tools strike my fancy.
I also find it unbearable to "solve" something I see the solution to, or can describe how to solve it. In fact, if I see the solution, I find myself unable to go through the steps to actually do it, especially if there is a time constraint involved.
The trick you have described was my way to do the problems in my spare time back when I hadn't seen them before, but the whole problem is that leetcode problems are designed for an incredibly narrow range of solutions.
Analytical solutions that have poor worst case run times, but incredibly good average case run times are not allowed and a lot of mathematical approaches involving matrices and exploiting vectorization aren't allowed either.
Leetcode-style problems force you to put your mind in a very narrow box and I simply can't do that. I've always had a very great need of orthogonalization in how I think and operate; i.e. if something doesn't stimulate me enough, I need another concurrent activity that is completely different to keep me motivated.
> This is also what Software Engineering has become: you memorize, regurgitate and participate in agile the masquerade. Creativity is shunned. Tried architectures/patterns are what is expected.
Compare https://sockpuppet.org/blog/2015/03/06/the-hiring-post/
See https://hn.algolia.com/?q=https%3A%2F%2Fsockpuppet.org%2Fblo...
I have in fact recently been doing a lot of Lichess puzzles, and what happens is I start to notice patterns. For example there have been several puzzles where the other side has just attacked one of my pieces, while I have one of their pieces attacked. So I can take theirs and they take mine, or I can move mine away and they can move theirs away, or I can do something else and let them decide whether to trade or disengage or leave that situation pending.
But wait! For that middle option--mutual disengagement--I see that I can move mine away to a square that gives check. They have to immediately deal with that check so they don't have time to mutually disengage. I'm winning a piece!
And now I've learned a pattern--if someone is depending on some sort of symmetry in a tactical situation that gives them matching moves they must play in response to mine, a forcing move such as check can break that symmetry.
For each puzzle where the answer is not an immediate application of some pattern I've already learned after solving it I step back a few moves before the puzzle position to see how it arose (Lichess puzzles are all drawn from actual games played on the site and include the score up to that point), identify why the move that set up the puzzle was bad, and see if there is some new pattern to learn from it.
Can someone with better understanding explain the negative sentiment around leet coding. Are most SWE just mediocre at coding or is there just some fundamental difference between leet coding and the skills needed to be a SWE?
At the risk of catching a lot of shit for this, I’m going to say yes to both of those.
A large amount of software development jobs involves taking various components big or small, and gluing them together with business logic of varying complexity and then trying to figure out what’s going wrong when one of the components or glues fails. Pretty much every job I’ve had personally has ended up being call some API / Query some DB and perform business logic on the results. There are a LOT of jobs like this out there, and a lot of them pay pretty good, by anyones standards who’s not into the whole tech culture. You perform at these just fine without hardly any knowledge of implementing many data structures or optimal algorithms.
I have also sunk weeks on algorithmic problems much more complicated and less clear-cut than anything in leetcode!
But yes, that kind of puzzles can be fun sometimes! (Back when I had no family and free time for such things).
But worst part is that the interview experience is entirely different from doing puzzles for fun at home. In an interview you need to present a carefully choreographed act where you:
- pretend to be quickly discovering the solution out of the blue (even though the original algorithm took some PhD multiple years to figure out)
- never solving any part too quickly, or they'll fail you for having seen it before (of course you've seen it before if you've done the requisite months of practice)
- never solving any part too slowly, or you'll be labeled "yet another who can't even write an if statement" (comment seen often on HN)
- maintain a running commentary to "show how you think", make it credible
- while doing all this, be writing syntax perfect code on a whiteboard
- while the interviewer makes derogatory comments about how much help you appear to need, alternates between browsing social media on their phone
You need the pocket Dijkstra, Kruskals, Union-find, Bellman-Ford, KMP, Kadanes (sliding window), LCS, DP (1-n dimensional), Topological Sorting, NP-hard heuristics (usually DP), BFS, DFS, Backtracking, Memoization (basically DP, but usually used in DFS), Prefix sums (DP as well), that weird palindrome-specific algorithm I can't remember, binary search, bisection (numerical anaylsis ftw!)
You also need tries, heaps, red-black trees, B-trees, DAGs, priority queues (heaps)
But wait.. there's more!
Euclidean algorithm, Josephus Problem, Sieve of Erastosthenes and all the number theory bullshit I can't remember and refuse to, because it has fuck all to do with daily engineering.
As an interviewer I learned that they don't tell me anything useful: people who show they can solve them just show that they spent months churning.
Most of the problems in Leetcode are related to CompSci theory (DP, DFS, efficient graph or tree reversal, etc). Reality in most software Engineering jobs couldn't be further away from the that. Even if you are working with C, you'll likely use Boost or a similar library to solve a problem that requires any of that (implementing your own low level libraries is a sign that you are a jr dev... I've seen lots of them trying to implement their email validation fn or similar).
Consider the interview question: "Write a function that can detect a cycle in a linked list."
> Between 1955 and 1967, the problem of “how do we determine if there is a cycle in a linked list without modifying the list or using an extra memory” was a essentially an open problem. Meaning, any number of PhD candidates in Mathematics or Computer Science could have written about it as part of their dissertation. With all of those hundreds and hundreds of minds, this problem remained open for 12 years.
> Do you honestly think you could, in a twenty minute interview, from scratch, come up with the solution to a problem that remained open in the field for 12 years, all under a pressure far more intense than any academic? Seems pretty damn unlikely, the only reason you think you could do so is that you’ve heard the answer before, and it seems obvious and simple in retrospect. In other words, “a-ha!”
https://www.nomachetejuggling.com/2014/06/24/the-worst-progr...
But that interest in the technical/algorithmic side of programming has turned into a paid job competition board ... I'm baffled.
If they can use what they learned to solve variations on the problems they previously solved it's probably a good signal of above average intelligence. That's also useful.
It immediately made him uncomfortable and I didn't get the job, because he didn't like the tortoise and hare solution not being as "tractable" as the set solution.
Damned if you do, damned if you don't.
For me, leetcode just helped with intuition for tools and approaches. When i see a problem, i think “ok what are the constraints? With this in mind, would it be better solved using graph structures or some recursion? Which would be cleaner? Which would be better for memory? What about speed? Etc.”, and from that point, it is just pure problem solving on the spot. Occasionally, i get those “oh, I remember solving a problem that wasnt quite like that at all, but it reminds me of it on fundamental level, and back then i remember using a recursive approach (though i dont even remember the problem at all anymore). What would happen if i approached this current problem the same way?”.
It just straight up helps me keep going and coming up with possible approaches to consider, as well as analyze and evaluate them, rather than being frozen on a problem for a while. And those “approaches” aren’t specific to a single unique problem, they apply on a fundamental level to a lot of other completely unrelated problems.
Yes, I’ve seen double nested for-loops in production code, which later became a performance bottleneck that had to be addressed. The issue is that “the problem” in that case was something that can be solved in linear time, and it would be a leetcode easy problem level of difficulty. It instantly jumped out to me wildly the second i saw that piece of code, but no original code reviewers were concerned. This is the kind of stuff leetcode is supposed to help with. Not with solving specific problems, but giving you a solid toolset and intuition on fundamental screwups and how to avoid them and spot them quickly in bajillion different situations that dont look the same at all.
Memorization won’t be your friend here, unless you possess one of those photographic memory brains that remembers the faces of every single person they’ve ever encountered. If you are going into leetcode with the mindset of “i am trying to memorize as many problem solutions as i can”, you are gonna have an awful time.
The more experience I have the harder they are for me to solve, as engineering problems tend to have very different mental models to reach the solution.
First thing you do is you ask people is that the problem they are actually need solving - most of the time refining the problem leads to there being something totally different that is requires. A process of asking people “why you want this hard to implement thing” and discovering that what they actually need is something smaller and more aligned with whats currently working. Leet code is the opposite usually - you see a simple problem but “there is a twist” that would be considered scope creep generally.
Then the implementation of the solution itself requires knowledge in your head, whereas years of experience has led me to put a lot of that knowledge out of my head and into “places I trust to find the answer” - google stack overflow, HN etc. And keep in my brain only the general abstractions of how to apply them. This allows for vastly more powerful solution making as you can stand on the shoulders of giants.
Example - see you have a leetcode puzzle. My first instinct is to use my google fu to find out what the best current solution is out there, understand it and either apply it or modify it a bit if it needs tweaking.
But that would be considered “cheating”. Leetcode: 1, Life skills: 0.
And there is the damn time pressure. Every time I’m pressed for time on my day job, its a signal something in tech or management has gone wrong, and I seek to optimize and fix that. Rushed engineers make poor, shortsighted decisions.
Each time I do an interview I feel out of sorts as all my instincts scream “something is really bad, you should _not_ be doing this solution this way it will bring pain in the future” But you have to power through. And I probably look way less impressive than someone who has the solution memorized.
The more experience I have the harder they are for me to solve, as engineering problems tend to have very different mental models to reach the solution.
That is what I think the true purpose of it is. It's poorly hidden age discrimination.The first camp is pretty “meh” about leet code interviews because for them you just study a bit and get a high paying job.
The second camp is pretty vocal about how bad leet code is because it’s somewhat of a personal attack on their abilities.
Personally I agree with the criticism that leet code can be learned with enough practice and so it’s not totally indicative of a positive hire. But then I also sorta feel like there’s enough examples out there that people should be able to ace these tests with practice.
Some SWE just write code, they wanna make features and build a product. They don’t care about this stuff because things are fast enough without the extra thought — and if they turn out not fast enough they can still fix the issue.
Other SWE are more careful with their code, performance, etc. this is more of a systems engineer personality. Writing C, managing memory, writing optimized code the first go round. Yah, being thoughtful and careful pays off here.
No one’s right or wrong imo, or one better than the other.
Should FAANG do leet code interviews? I dunno, there’s surely better ways to interview, but at the same time they’ve hired plenty of highly talented engineers so something’s working for them?
Should SWE’s just spend a few weeks on leet code and learn the tricks? Ya, it’s pretty easy. But if you don’t want the job then don’t do it?
All the endless criticism of leet code generally comes from people who fail it. Shrug.
LeetCode is just what you get when you ask Software Engineers to solve the interview problem - they like showing off their chops so that's what you get. It doesn't need to be that complicated though. I know with about 80% certainty whether someone will work out based on how they solve that "SimpleProblem". The other 20% - just fire them if they don't work out. It doesn't need to be that hard. You don't need 100% certainty for a hire, you'll never get there. Just fire the ones that don't work out. You don't even need to feel bad for them - in this market they'll find another job by the end of the month.
I would struggle with this problem, because it's difficult to read whether you want me to push back against the requirement itself and try to solve the real problem instead of shuffling chars, or perhaps you want me to talk about the edge cases you're likely to encounter while I write the naïve solution, or maybe you want to pretend it's the 80s and nothing outside your chosen charset could ever exist in real data.
It IS important that you understand the algorithms, but I think they are far less important than data modeling and systems design. In any application, you must be able to understand and design how you model business things, and where you put them, and how and when you access them. Also how you fit a small unit of business logic into the larger picture.
This is much harder to test for, since for a given problem there might be multiple, equally valid models and solutions. So obviously the kind of auto-verification leetcode sites do does not work. There must be a human evaluating the solution, which is much more expensive.
Here is the truth about leetcode, advent of code, codeforces, whatever similar problem site:
There is no memorization involved, just like you don't memorize every math problem on earth to map directly to a correct answer you instead derive the answer using the skills you have in math from experience solving problems before. Polya has a book for this, called 'How to Solve It' he just happens to have used math to teach problem solving but it's the exact same concept.
You have at your disposal problem solving strategies such as: complete search, dynamic programming, greedy and divide and conquer. You don't need to memorize any code to write a greedy search, you could ad-hoc hack that together just know what a greedy strategy is. You don't memorize all search algorithms throughout history ever invented.
There is no grind. People who haven't done it assume you sit there for hours daily writing brute force algorithms, no. Instead it's exactly like doing a crossword puzzle over a coffee and something you can do at your leisure where in a month or so you're now at leetcode medium/hard no problem.
In my limited experience, the difference between these problem solving sites and a job interview is after your hacky ad-hoc greedy search solution they will ask you to optimize it 'can we make this faster' so really for an interview you only need knowledge of the language you are using and it's built-in data structures what their complexity is. That doesn't require much memorization either just know how they are implemented looking at the standard library or documentation where hopefully somebody has explained the implementation 'this dynamic array has constant time access, but linear replication when full'. Only that level of knowledge, like knowing how to move something out of a loop so it's not repeatedly initializing or rewriting your solution in another data structure no insanely advanced algorithm analysis needed just practice using the language standard library or container libraries enough and this will be easy. People make this harder than it really is, tl;dr learn problem solving techniques either from logic philosophy texts, math or programming problems, learn the standard library of the language you want to use, that's it.And yes, LC problems do not deal with the day-to-day work of a software engineer. They are fun puzzles to do sometimes, if that's your thing. As a "hiring tool" I think they are abysmal. Fortunately, many companies don't use them. There is a bubble where it is prevalent, but again, people with experience can chose where they interview.
If you want Programming puzzles that are actually fun and correlate to problems an engineer actually encounters, I can strongly recommend https://www.codeabbey.com/
Hah! Not so.
I've been a dev for a long time, and my spouse a lawyer. Back when we were both fresh out of school I remember running her through quiz questions to help her prepare for her bar exam. We devs HAVE NO IDEA how much arcane archaic stuff lawyers have to pretend to know to get certified to do their jobs.
For example: "mortmain" (French for "dead hand"). What happens when property is bequeathed to a defunct institution? It's on the test. It's easy to come up with a logical answer. But to pass the bar exam would-be lawyers have to know the right answer, cold without looking it up, and why it's the right answer. Hint: it's not at all logical. And, will a working lawyer deal with that question? Maybe three times in her career if she's an estates-and-trusts specialist.
There are thousands of these things for lawyers.
Bar exams are hard because of protectionism -- low supply means high pay. The same is true of doctors and developers. Developer pay is high BECAUSE the exams are hard. The exams are hard BECAUSE developers want high pay.
It’ll land you a nice salary, to boot.
Note that I would never require leetcode during a job interview. However, a single LC question is a small-sized puzzle I can solve in a day (or a weekend). If I want to write a ray tracer, well... Good bye life for a week or two.
In other words, I have difficulties finding 50+ hours of large chunks of time to be unavailable to my family in my supposed off time. Leetcode I can do on a couch while my SO watches Games of Thrones.
Not necessarily! Maybe you just like puzzles? I don't.
>In other words, I have difficulties finding 50+ hours of large chunks of time to be unavailable to my family in my supposed off time.
If that's all that's stopping you from working on a ray-tracer, I think it's "just" a time-management problem. I work in increments ranging from 30 minutes to 2h. The trick is to schedule them, or at the very least, to have some kind of issue tracking system for yourself so that you can find an appropriately-sized chunk of work for those serendipitous 20 mins.
Lookup this book: Ray tracing in one weekend by Peter Shirley. You're in for a treat :-)
Meanwhile writing your own libraries, parsers, compilers, oh boi.
Additionally it gave me waaay more than LC stuff, especially when it comes to learning system modeling / proper OOP
None of that will help you pass an interview though!
I submit that you may be interviewing in the wrong places.
Obviously, it doesn't suffice to just point the decision-makers to your repos. You need to pick companies who would benefit from the expertise you acquired, and effectively pitch yourself to them.
Consider this problem: https://codingcompetitions.withgoogle.com/codejam/round/0000...
Several articles have been written about it, and the winning submissions all implement generic numerical integration in like 10 lines of code (a few even implement Simpson's rule), which is sort of neat it its own right. From reading solutions to other CodeJam/TC/SPOJ problems I've also come across similarly compact implementations of matrix inversion, linear optimization, etc. It sounds like your math chops are more than good enough, and these companies just want to test if you understand 80's computer science anyway. If you study interesting solutions to hard problems, you might stay interested and you might even improve more at boring LeetCode problems than you did after grinding. Chess puzzles help up to a point, but eventually to get better you have to start reading books, and that point comes before all chess puzzles are easy. Pushups help up to a point, but eventually to get stronger you have to switch to a barbell, and that point comes before you can do a million pushups.
Finally, I've given this advice in other comments, but if you're just posting this because you want to get hired, my experience is that it's better to focus on interviewing more than on LeetCode. Specifically: think of getting hired as a numbers game, and think of applying for a job as a sales process. That means having a funnel for companies, e.g. "discovered -> openings available -> resume drop -> recruiter screen -> interview round 1,2,3 -> offer". Make a spreadsheet and start filling it; don't just list companies you know about, start googling tech you're interested in to find more companies you can add. If certain types of interviews seem to go better, look for similar companies you can add, and wait to optimize your performance (e.g. with LeetCode) until you do notice a big drop-off in your funnel (e.g. recruiter screen, first round interview).
The nice thing is that there are lots of jobs out there that don't require leetcode skills. Sure, there are many jobs that do, too, but you can avoid them by looking at the job req.
Source: I too am bad at leetcode but have had many jobs in my career, including three different employers since 2019.
https://airtable.com/shr5TdnpVYVTpeRrN/tbluCbToxQ2knSLhh
Similar to the first link, as a github repo: https://github.com/poteto/hiring-without-whiteboards
Information related to companies, their culture/values, and hiring process: https://www.keyvalues.com/
Also, I've found that smaller companies and consulting companies tend to avoid leetcode style interviews. #anecdata
Alternatively check out my other post in this thread if you’re looking to target those non-LeetCode jobs specifically!
ask the first recruiter? put it in your emails? ask your friends about their employers?
I have failed candidates in the past, who have solved the LC problem, but could not reason tradeoffs and runtime complexities of the code. It was very apparent that, the solutions have been memorized from LC.
There seem to still be interviewers out there who focus on puzzle-like problems.
> This is also what Software Engineering has become: you memorize, regurgitate and participate in agile the masquerade. Creativity is shunned. Tried architectures/patterns are what is expected.
No, not really. Maybe some jobs are like that. Many are not. But even the jobs that are not like that will generally be gated by interviews that include Leetcode-style questions.
This happened in the software industry because credentials and experience often mean nothing, resume fraud is rampant, and the cost of hiring a bad engineer is very high.
How about a take-home assignment? Suggest that and many will respond, "I don't work for free" or "I don't have time to work after work, I have a family to take care of." How about just looking at prior experience, or credentials? Resume fraud prevents that, and a lot of companies prefer to hire generalists and find a team for them to work in, rather than hire specialists for a particular team. Outside of research-heavy fields like AI/ML, a university degree is no predictor of success.
So, we need to find a way to evaluate a candidate, in a short period of time, that gives a reasonable estimation of how they will do in the job. If there was a better way, and it was proved to be better, the industry would adopt it very quickly, and it would be a competitive advantage for the companies that realized it first. But that has not happened.
If you put aside the cheap cynicism that permeates threads about programming interviews, you'll realize it hasn't happened because none of the people who are hiring have figured out a more reliable way to hire, even though there are very smart people doing it and they have an enormous financial incentive to figure out how to do it better. A company that could find all the good programmers who can't Leetcode, and weed out the bad programmers who can't Leetcode, would get an enormous amount of talent that others overlooked.
This is just a hoop to jump through, and it's not nearly as difficult as getting a college degree or learning how to code in the first place. I'm not saying it's easy, I'm saying it's doable with time and practice. Most of your colleagues have done it at your current job and also at your future job. I can't do it at the drop of a hat either; I would need to practice like almost everyone else. You can do it too, if you approach it with the right mindset: you aren't supposed to enjoy it or find it intellectually interesting; it's just an obstacle to overcome and it's smaller than many other obstacles you've dealt with before.
The criticisms you mention about take-home tests apply equally to practicing Leetcode-style questions. It will filter out a ton of people who don’t have time or aren’t willing to spend it. In that sense it’s not better (and it’s probably why I see a lot more take-home coding tests lately).
But really neither of these is ok. They’re both ageist and sexist and lots of other things (older people and women disproportionately carry the burden of caring for others and many won’t have the time or energy to prep for Leetcode problems). Even if I’m willing to jump through those hoops, I don’t want to work at a place with a strongly ageist and sexist filter.
Lots of other careers don’t ask people to prove their skills before they get hired. They accept that some resume fraud will happen and deal with it. Bad hires are really bad and destructive, it’s true. But let’s not adopt solutions that are worse than the problem. Discrimination is not an ok price to pay. I’ve been working in this industry for almost 25 years now, and we did ok before Leetcode-style interviews. We can do it again.
There are many reasons why this could be the case, and it being the current best alternative is only one of them. Another that immediately comes to mind is survivorship bias.
If there was a better way to do this at the scale of the software industry, the incredible incentives to find out how to do it better would have resulted in something by now.
or better yet open your own high growth IT startup, raise few mills from VC and start hiring and see if you like leetcode interview or not.
Problem is, it's even easier to game the system by just memorizing LC questions. A metric that is known to be relevant beforehand and can be tackled by "learning for the test" is an almost surefire way of ensuring that a lot of people will do exactly that. There is an entire industry to prepare people for these tests, same as there is for standardized MC tests in eductional systems that rely on them.
It's not easy to detect resume fraud. But it's even harder to determine whether someone actually knows his stuff, or just spend time (and sometimes money) on just memorizing a lot of questions.
> If there was a better way
There is: Talking to people. Actually doing interviews.
https://www.linkedin.com/pulse/why-interview-coding-tests-mo...
However, to get to that point you need to get past the phone screen and that's usually a coding exercise. I'm not mad about that because I have seen firsthand that companies need to filter out all the ridiculously unqualified people who come their way, to ensure that time spent on interviewing (including conversation) is not wasted.
If you list a decent software job right now you will get hundreds, maybe even thousands, of applicants. Many will be outright liars, many will be junior people pretending to be senior, and many will be very good. You can't spend time on all of them. You need to have a way to decide who is worth your time, or you'll never have time to do anything else.
The "first filter" is what we have HR departments for. As you say, decent jobs get thousands of applicants. Whos going to do the phone interview on a thousand people?
The first filter is skimming the applications and checking basic credentials. Filter out resumes that don't check out, and looking for red flags. This already brings down the candidate pool to a manageable size.
If you can implement one of the memorised solutions on the spot, with tweaks, then you're probably good.
If I memorized how certain classes of problems are solved, and can derive an implementation from that, then yes, I am probably a good coder. I am then also someone who used LC et al. to learn about data structures and algorithms, aka. what these puzzles were originally intended to help people with.
If I memorized the question and its solution however, without understanding why and how this solution works then I am merely good at memorizing text and replaying it. This doesn't demonstrate my ability to solve problems or to code.
If you can improve upon either the space/time complexity or even the comprehensibility/maintainability of algorithms, the industry is your oyster.
The algorithms are supposed to be fun and deriving them a group exercise.
leetcode merely tests whether you have foundational education for a professional software engineer.
like when you hire accountant you would expect them to know debit, credit and other basic stuff, right?
But then again this is the same logic that gave us google doc coding interviews so I'm not sure why I'm expecting anything at all ...
So that's the one end. But on the other, this software I've built is already the biggest I've ever made. It combines SQL, the Go programming language, hexagonal architecture, REST, JSON, XML, some custom format like INI files, business logic, hundreds of different validation formats, models, fields, all in a very specialized three-letter-acronym-rich domain, and application that is / will be used by a small community that will end up serving millions if not billions of people (mobile networking technology)
So yeah, on the one side I'm a fucking idiot that can't get past day 3 of Advent of Code due to losing interest, on the other I am and have written applications for the masses.
I mean there was a time I worked on some iOS app, not on my own but a very small team. It had over two million installations some years down the line. And yet I didn't feel like this was my achievement, because others were involved and they all seemed to have more dedication, more 'talent', more intuition, more passion, and of course, more money.
Find joy in building something. Ignore the external pressure, slack at work if necessary, and use your free time to solve a problem you really care about.
Pros - I believe memorizing does help - If you do understand how things work - memorizing does make you fast - Leetcode did help me understand and appreciate pithy code - when I browse other's solutions - Leetcode did help me get inspired to learn new coding techniques - Leetcode did make me a better engineer who is quick to implement solutions which are already implemented - Leetcode did help me to learn libraries, functions, apis which i previously did not learn - Leetcode does bring needed positive peer pressure - sometimes helpful to get up and running and keep running
Cons - I believe it makes you run the rat race, you end up in another mill - running for someone else. - It doesn't foster creativity for the joy of programming - but rather it is motivated to clear interviews ( I wouldn't judge my skills based on leetcode alone | the gym is useful but it doesn't define me ) - I always adore super programmers like Fabrice Bellard - In programming, If I would want my skills to parallel someone, if not go beyond - it would be him. I am sure Leetcode wouldn't produce people like him. ( where would you have the time to dream and create if you use all the free time you have to leetcode ? )
1 - just try to think of a solution. Sometimes you'll just see it. 2 - what if you sort something? Sort the data and see if it helps to see a solution 3 - what if you stick all the data into a dictionary? Does that help? 4 - what if you stick all the data into a tree? Does that help?
Etc etc. You can make a nice long list of things to try. For 90% of the problems, doing one of the things on your list will lead you to a solution.
Software engineering also requires fairly strong communication skills - something Leetcode doesn't help with at all.
To me the really interesting part of engineering is educating Product people and customers about what computers are best suited to do and to rethink problems in systems of cheap tasks less than trying to fit arbitrary human centric processes (ie, a process that works for humans, but maybe isn't the best fit for a computer). Once we have a really clear agreement of the goal, it then fun to find a way to optimize a computer doing it.
A really simple analogy might be long division[1] -- if you implemented the long division algorithm on a computer you'd waste a ton of LoC, when you (usually, w/ certain caveats) can usually just use a division instruction. Sounds trite, but you'd be surprised how often I see product people, and even "Senior" engineers, just blindly copying a 10 to 100 step algorithm because that's how the humans do it, missing that the problem can be decomposed to a few general patterns and then iterated, recursed, map/reduced, faster when batched etc.
Often times these simpler computer centric algorithms also lead to much simpler code (for each do something simple), vs human centric algorithms often lead to big if/ifelse/else trees or code that does all of the tasks iteratively instead all of _one_ task for all items.
Stop applying to those companies.
Creativity is not scalable, even dangerous, and big companies strive to scale => they need obidient soldiers, playing by the rules and just smart enough to not f*ck up a critical project.
Hence the Leetcode. It's a perfect way to ensure obidience, just enough brains, patience and motivation to risk wasting few month of preparation to the interview for the chance to get in FAANG.
If you want to be creative — "go fund yourself"! :)
I mean it in a positive way, because I feel exactly like you, ready to dump my current well payed job for the risky chance to do whatever I myself feel interesting and meaningful.
Wish you best of luck finding your challenges, and don't be so hard on yourself, leetcode is not a big deal anymore. Besides, there are plenty of startups these days full of creative people without leetcode mindset.
Trust me that I know it feels horrible when you're bad at them. It does not mean you're a bad engineer by any means. It just means you're bad at Leetcode problems! Clearly, you still have strengths that have allowed you to accomplish what you have in your career. Those are strengths that should not be discounted by potential employers and certainly not by you.
But that doesn't discount the value of those problems either. You're right that you have to memorize the basic data structures and there is a certain pattern to these problems once you're good at them. But if there wasn't any art to these problems, then after 400+ problems wouldn't you have figured out the robotic algorithm to solve them? I argue that there is more to those problems than bullshit.
People who are good at these problems exist. I would not dismiss the strengths of these engineers either. These engineers may not even possess the same strengths you do! But just like you, there is a certain skill or talent that allows them to solve those problems. Those skills are valued by companies who want to run smart engineering teams.
It is not the only skill out there, it's just the easiest skill to empirically measure. You cannot run a large organization without a data-driven method. If you trust the human intuition of your hiring team, you will have a lot (more) variance in your hiring quality. Not to mention that your hiring will be biased against women and anyone of a different race than of your hiring team. This is true even if everybody is aware of their own internal biases. This is why large orgs give these problems.
Even if you do not share those skills, you might still be valuable as a good engineer. You just have to look for teams that are looking for asymmetric advantages: that is, those who can't afford to compete directly against the richer teams.
Copilot cannot "solve" these problems, it just knows the answer.
And for that exact reason, using LC as a hiring tool runs into the same problem as using standardized tests in colleges: Once people figure out that the tested metric isn't actually "understanding of the subject matter" but "test knowledge", and learning for the test is easier than understanding the subject, people start learning for the test.
The reason for the struggle is that, framed properly it tests a real world situation. Given this problem I've told you about in advance, how well did you prepare yourself to answer it?
I don't think it's fair to tell the candidate they could be asked about sorting, trees, lists, graphs, dp, lp so try and cram a 4/6 year CS degree(s) into the next two weeks. That said, telling the candidate, that they will potentially be asked to whiteboard a solution involving binary trees, sorting, or a linked list seems fair to me.
This.
That is, if you want to be a part of such company.
Because, yes, compensation is awesome, and you get the shares and what not, but there is more to life than that.
Scratch the surface a bit deeper, there are many different companies out there with different core values that will attract totally different group of people - while having all of the benefits of a "well known company"
So at least in India, from what I have encountered so far and I am yet to encounter a company that hasn't asked me those questions yet.
If you can, try to apply to companies in cities like Berlin, Vienna or Paris, but of course not everyone has that opportunity.
I recently interviewed somewhere where I did a leetcode interview, then a take-home and then it felt like they didn't care about the 6+ hour takehome and made me do another leetcode. Pretty frustrating!
Thanks for the thread, it's nice to vent! It's also good to learn how to be a better interviewer, and write better interview problems. My favorite is a debugging interview, where there are like 4 bugs in the program and we work with the interviewee to solve the 4 issues. I'm sure there are problems with this style too, but it's far more practical...
1. Team player. Modern development is a team sport. Bonus points if you've actually played a team sport so that you have an understanding of team dynamics and how to work with a team to achieve goals. A lot of people still think software development is a career for loners.
2. Good communicator. Developers interact with multiple business groups, multiple technical groups within the organization and multiple technical groups outside of the organization. You have to know how to communicate effectively with each of those groups - who all have varying technical backgrounds and understanding of what you're trying to accomplish. I'm not saying you have to be extroverted to be a modern software developer, but you can't be so introverted that interacting and engaging with others is difficult for you.
3. Big picture understanding (abstract thinking). A successful developer needs to be able to traverse several layers of abstraction. The people who can't do that well can't see the forest through the trees. They get lost in code and can't think about the abstract things the code is implementing and how those things interact with one another. They get lost.
You know what I don't care about? How well you do LeetCode exercises. I have some great people I've hired onto my team and I have no idea how well they can do LeetCode exercises because those aren't the problems we have to solve.
Same as for other professions, you would suffer in law for the first 5 years doing proof-reading (the grass is always greener).
But if you want creativity - why not just build your own stuff? You have a super power that majority of the planet does not have. Alternatively changing jobs to a different kind of company that structures this position differently?
It isn't. There is a bubble where it is prevalent, and there are lots of companies where people actually talk with candidates, eg. about software they have written, why and what they were excited about it, discuss the company product and what they are looking for in terms of contribution, etc.
leetcode is hands on demo of what you can do and how you think.
since big tech pays big $$ they can afford to set the bar higher than just talking
No, it's not.
Most of my non-SWE friends are from liberal arts circles. Interview process for their jobs had no "LeetCodes", no take-home assignments. Just a few steps of 1-on-1 conversations. The companies are also heavily relying on the trial period to accept/reject fresh hires.
Naturally, it's just my anecdata.
To get started, first understand that leetcode problems fall into different categories: graph problems, "dynamic programming", double-pointer techniques, etc. And within those broad categories, there are families of problems. So first, stop trying to solve random leetcode and pick one family. How about "Best time to buy and sells stock"? Start with the easiest one. It won't be that easy! Don't worry if you can't solve it. Turn to the discussion where people post solutions, or the official solutions page, pick one solution in a language familiar to you that looks understandable, and study it. It might take an hour or more to understand what it's doing, but stick with it! Make notes, whatever helps you. But get to the point where you absolutely understand how that solution works.
Now, try to write it out from scratch without looking at the solution. And then, try to do the next one in the family. Keep notes for yourself on what your learning. And eventually you'll have learned how to do some graph algorithms, some "dynamic programming" (it's a silly name and a bit hard to define but it's a category) etc. This will all take weeks / months. But that's fine -- your learning the material of a couple of semesters in an undergrad CS course.
It's fun if you enjoy programming and algorithms, in my opinion. If you cannot sit down and learn like that then it is possible that you don't have the sort of mindset that the companies who are employing these tests are looking for.
Algo solving comes down to knowing certain tricks or math properties. On competitive level it seems to be all about memorising solution classes and fitting problem to pattern, which I found boring.
I have 15 years of programming and I was better at algos as a kid as it was kinda fun to solve these back then. There's not much fun anymore, so I don't do it but programming I still enjoy somewhat but more inspired by RL/NLP progress but DeepMind won't hire me :/
> ETL with Spark
Lol, you do ETL with Spark and talk about creativity in the same sentence.
How about designing new platform, startup, game, NLP/vision application, solver, trading bot, search engine, programming language, operating system etc?
> This is also what Software Engineering has become: you memorize, regurgitate and participate in agile the masquerade. Creativity is shunned. Tried architectures/patterns are what is expected.
I mean that's kinda true in BigCo and many people are fine with that. They want low buss factor and good profit margin and not programming stars. The bright side is you work 9-5 for good salary. Just need correct attitude (I am so inclined to quote hustlers here ;). Express your creativity by paiting, dancing or writing poem and you will be better off and happier.
wanna try finding companies that dont go through this process ? then there payroll isn't nothing close to these leetcode-interview based companies ( factor of 2 to 3 times ) :(
I chose to pursue mathematics after school. I was into computers but for various reasons I didn't think I wanted to do programming as a career. I was good at maths in school and assumed I would make a good mathematician. Well, I was wrong. I didn't get on well with maths at all at university. I went from being top of the class to bottom and I didn't like it. I decided to switch to computer science despite a significant cost and was top of the class again.
Later I decided I wanted to stay in academia. Again, I was wrong and didn't get on well. So I switched to industry and I've never looked back.
Sometimes you just have to accept that you chose the wrong path. It's no big deal. That's life. You won't choose the right path every time.
> This is also what Software Engineering has become: you memorize, regurgitate and participate in agile the masquerade. Creativity is shunned. Tried architectures/patterns are what is expected.
Nah, that's not true. Even the leetcode problems can be solved in infinitely many ways. They don't require a particular data structure, they only require a particular time and/or memory complexity. But just like any field, there is an enormous amount that you won't be an expert in. When you encounter those parts, you use someone else's solution. That's part of the job. Nobody solves a problem from scratch in any field, ever. We stand on the shoulders of giants.
In the beginning, they just took grads from Stanford / MIT. Then, someone did a study and figured out that was a bad idea, so now they are doing this.
Is it a good idea? For a small startup, absolutely not. But they are at a size and scale where that doesn't really matter.
And I find a bit of contradiction in your post.
You both claim that you feel the problems are harder now and that they're all simple regurgitation. These both can't be true. If you recognize they're just simple recitation, then recite. You should be able to crush it with no problem.
I don't know if you've done any interviewing yet (it sounds like you're going in that direction), but one of the favorite follow up questions in FAANG interviews is: "and at scale?". And there you have to know how to go massively parallel.
Also, what's to prevent you from hanging your shingle and doing those creative/fun/whatever things?
It sounds like you've been on a job hunt for a few months and are getting frustrated and taking it out on the one thing you've done the most. Consider you're taking this attitude into everything you're doing. It will come through in your speech, your writing, everything.
And as to leetcode itself: What else is there? Hiring isn't broken per se, it's just really fucking hard. I've seen others mention a desire for a test they could give that could test for what employers want. That's what leetcode/whiteboarding is supposed to be. It's a skills assessment.
Then you have the people who claim that what they're doing at FAANG isn't that far off what others are doing on average. Let's say that is true. Let's say that 90% of software developers out there could do it. They still pay the most. Most people would still want to work there. So they'd have to filter somehow. This is just a filter that excluded you.
Engineering isn’t a linear track. Being able to consistently smash leetcode puzzles out the park will land you a $250k total comp FAANG graduate job, but the more experienced you are the less crucial the puzzle stuff becomes.
For a punk grad, being good at bubble sort is all they have. They have no engineering taste, no immune system trained to respond to dodgy design, and no discipline to evaluate when it would be effective to push back on something versus avoiding unnecessary drama.
I recently went through several rounds of interviews where the only code I wrote was on my own time, after I had outlined a solution to a practical problem in each of the interviews. I have landed my dream job at a business that’s just closed a series B. I was delighted to be treated like an adult whose technical ability wasn’t fundamentally questioned as part of the application process, but whose organisational maturity and approach to working with a team was.
The truth is out there.
If a take-home assignment is wished, I'm billing for it.
There are plenty of good jobs/projects - be pickier.
I agree, if you love coding, law would have made a better career; that's an industry where logic and reason still matter.
It seems like medicine is not good either nowadays for rational thinkers.
There's never been a better time to be an idiot. Idiots shall inherit the earth.
The only downside to these jobs is that they tend to pay less, despite them being very challenging.
Every job I see in these sort of areas are very senior level of staff/principal and want significant domain experience in whatever the hell it is they’re doing.
The exception being the lowest rung which always seem to exclusively target university pipelines.
But according to leetcode and the FAANG interview process, I am not worthy of employment at any of big tech companies, and I failed a lot of those interviews. I love coding and tech, but leetcode makes me hate it.
If I lacked self-esteem, I would not be in a good emotional state, which is something that does concern me - being rejected by many companies can take an emotional toll on a person's emotional health.
The good news for folks like me is that there are enough companies that will interview me on relevant skills and $200K-ish TC is enough to live well, especially with good work / life balance.
FAANGs and start-ups are shooting themselves in the foot with the interview process - they are effectively:
1. limiting their new-hire pool by having too high of a hiring bar, and
2. hiring candidates that may not have the expertise that they need bc they are not interviewing for that expertise (you might be desperate for AWS / cloud skills, but testing for dynamic programming will not help you find that candidate).
Big surprise - there is a hiring problem. This is a big enough problem that the tech companies are doing unusual things:
1. Amazon has been reaching out candidates that were given offers within the last year, and trying to entice them with higher offers, and
2. Apple (and Amazon will in April too, according to Blind) has been giving big pay increases (40% ish IIRC) to keep top performers from testing the market.
^^ There will be more anomalies bc the skills gap will get worse.
Good news, folks - likely we will all get paid more, leetcode or not.
1) They are generally not that hard, there is no 'trick' to the 1st order solution, maybe optimizations, yes, but there's always a straight forward 'brute force' solution.
2) There's 'just enough code' to see how they would basically organize a function or two.
3) Plenty of opportunities to talk about second order small stuff, get the interviewee talking and opportunities to express their insight.
Yes, it's hard to think when 'someone is watching you' or 'under time pressure' - I would tend to leave the room or go away and say 'don't worry about time, just ping me when you're done and ready to chat'.
But I would be reluctant to hire anyone who could not consistently bang out and solve medium level leetcode problems. Experienced devs should be able to knock them out one by one without too-too much time and few hangups.
Last time I interviewed (at ~5 YoE) I found that while Facebook and Google still have several "leetcode" style interviews, many other high-tier companies only do one interview of that type (e.g. Stripe, Dropbox). The rest are some combination of practical coding, discussing your experience, and working through design problems. And even the FB/Google interviews aren't as bad as they sound, because you often have an intelligent and engaged person on the other end who is trying to help you demonstrate your skill, unlike the relative vacuum of working through Leetcode problems by yourself.
You should be able to get really detailed information on the interview process up-front, either on Glassdoor or by talking to recruiters. Pick companies whose interview process emphasizes your strengths.
I feel like there is plenty of room for creativity in the high level solution and working with the customer/user. But it makes sense that when you get down to the nitty gritty, established patterns should be used. Without a doubt other engineers will come after you to work on the code, and the last thing they want to see is a super creative implementation that only you understand.
You might see a similar thing in architecture. A bridge architect might draw up a beautiful, flowing bridge...but at the end of the day the engineers will use the same techniques to make it structurally sound. So...maybe you might like software architecture more?
Sometimes the court jester speaks profound truth under an appealing layer of humor... in that spirit, if Leetcode is bothering you I very seriously propose that your best solution may be: https://www.youtube.com/watch?v=SlKao_Pox5A
I interview pretty regularly, move jobs every couple months. Probably receive 2-3 offers a month without doing any leetcode.
I always wondering about doing the latter. I get bored very quickly, but don’t want to risk hopping full time roles too quickly.
As for your perceived lack of something, consider that some part of you is smarter than you know and gives you cognitive issues just so you don't go down a path meant for people that are somewhat less well rounded, less integrated, have narrower talents or whatever. I mean, your judgements on the industry are spot on.
Since people will generally only call you a genius while profiting from your work, think of these tests as selecting the most exploitable.
Many people would kill to have the opportunity to study for 100 hours in order to secure a 2-3x increase in pay. That is only 2 hours a week for a year. If a SWE is making $150k and they can spend 100 hours grinding LC to get a job which pays $400k they are going to make $250k extra in their first year of the new job or $2500/hour spent grinding LC. The present value of an extra $250k/year for the next 20 years of your career at 3% interest is roughly 3.7 million dollars. So over the period of a 20 year career you will net $37k/hour spent grinding LC.
The fact is that so many SWEs — as seen in this thread — outright refuse to grind LC to get into a FAANG which is why not everyone is making boat loads of money at a FAANG. The process to get there is well known but many are not willing to put in the work to get through the process.
I do believe that LC filters don’t reflect a SWEs ability to develop software, but it is a reflection of their commitment to do what it takes over long periods of time to complete an objective, regardless of whether or not that objective has merit.
Leetcode is a race to the bottom. Be the change that you want to see: walk away from this nonsense. You should be keeping your blade sharp, but leetcode really isn't the way to do that. I enjoy programming talks on YouTube, maybe you might: cppcon, fosdem, linuxconf, rustconf, strange loop. You might find another way (OSS contribution is also great!).
Instead communication skills and a willingness to learn have been much bigger indicators. There are plenty of startups that will LOVE to have you. Focus on getting a job at earlier stage startups. Create your own projects as well. People like seeing those projects to show that you're passionate about coding.
The grass is always greener on the other side.
Sorry you’re going though that.
On the bright side, sounds like you’ve recognized the pattern to be successful at leet code. Add it to your tool belt and move on to things you find fulfilling.
There is a lot of power that comes from creatively applying those algs skills.
I wish I could have a fulfilling job. I don't know what that would look like anymore.
Yes
Even old school investment banks are joining the trend, which I find baffling because the comp package is nowhere near the above.
A mathematician can hate doing Sudoku.
Proficiency at these games is not really related to these professions, clearly.
Same with programming puzzles like these, until some MAMAA recruiter decides they will use Sudoku to screen candidates :(
Everything is so new and open to expirimentation
Check web3, Bitcoin lightning
Like, if you can complete leetcode, you're so in the in-group, if something happened to Earth tomorrow and humanity suddenly had to migrate to space, you'd definitely be on the shortlist of people $company would select to join the new colony, because you've been trialed by fire, the results have been locked in, and your value and worth will never be questioned again.
At least that's my take on the perspective I'm seeing.
Now, written out like that it almost seems like I'm belittling the view, but I'm caricaturizing it to call out an important distinction:
Ability to complete leetcode puzzles to acquire a job has absolutely no bearing on your *social inclusion* as a *person*, precisely because the initiative to mandate these tasks is coming from HR departments.
And what right does HR have to dictate whether you should feel socially included or not? For that matter, what right does a workplace have to tell you that you should feel small as a person?
Leetcode suffers from a sort of simplicity problem. The mental model of what leetcode implies (programming challenges) is virally straightforward to reason about both for programmers (compete! be the best! go to space one day!) and hiring managers (wow this tiny picket fence is the most effective thing I've ever been recognized for, I've made it!!). I mean that it's virally straightforward because it has a simplicity that makes it "click" for everyone in 5 seconds, which makes it easy for it to scale/spread like wildfire.
And in an industry where hiring is known-ungood and everyone is grasping at straws, you can kind of see why organizations everywhere (especially the well-known, large inefficient behemoths) have adopted this on a shoo-in basis: in those environments, its user experience is orders of magnitude better than what it replaced.
Here's the rub though. That simplicity I mentioned? Other comments here have talked about how leetcode only challenges a specific mindset, that it's extremely narrow. And indeed it is. It's like an IQ test. But there's something about it, a... single-minded, zen-like quality to it, like dance-pad or Tetris arcade games.
In a recent thread (https://news.ycombinator.com/item?id=29728892) showcasing a multiplayer online Tetris game a lot of people marveled at how fast some players can play (the author of the site linked https://www.youtube.com/watch?v=MJDz4-pr9J4, and my personal favorite (definitely watch the end) is https://youtube.com/watch?v=lE_UHhqAd1c). These people get good not solely because of inherent talent, but because there is a catnip-like attraction that draws everyone in, and these people just keep coming back.
I suspect the same is true for leetcode. People just do a Jon Skeet and keep coming back. Reminds me of "the unreasonable effectiveness of showing up every day" (https://news.ycombinator.com/item?id=27833064).
However, I think that in that overwhelming one-dimensional simplicity of "leetcode means X", these finer points are completely lost in translation and do not scale. Instead we're left with "<blah> passed leetcode and got a job" and "wow this is really hard" and lots and lots of "wow I feel terrible as a person" - where that latter bit turns into what feels like an insurmountable Mr Everest because this is hard for a *lot* of people, including both those in your immediate social circle and the like-minded individuals who hang out on the same forums that you do.
If you're pushing to complete these, IMHO the only context that makes sense is in an unexpected-interview-next-week sort of situation. Definitely immediate to short term. Generally speaking, if you're aiming to work somewhere this sort of thing will be valued... it doesn't really make sense to try and get your foot in the door of a marathon race by proving you can sprint, right?
That's not to say that most large corporate environments actually give you work that requires a significant cross-section of this sort of skillset. In that regard leetcode is the grown-up version of "I learned all this stuff in school that I'll never use". In practice whatever real work you take on will generally be paced somewhat more sustainably and you'll have ample time to familiarize yourself with the approaches a particular piece of code uses - if they're not already in your mental toolbelt already.
The simplicity of leetcode lends toward what might be described as a "false bigger picture" that describes some sort of idyllic scene where you're working on zen puzzles at work all day. You know that isn't going to happen, but it can be so easy to develop a mindset that looks at the world through leetcode glasses and says, well, what if everything I do all day does reduce down to zen puzzle solving? Yay, I get to do this forever! (Protip for ADHD hyperfocusers: observe red flag. Red flag bad. Red flag signal imminent core burnout. Hate job. Stressed out all day. Depression.)
In reality, the competitive target that leetcode represents can be overwhelmingly easy to extrapolate into a whole occupation of its own.
The fact that leetcode gets people jobs is 100% orthogonal to the fact that some people get stymyingly good at it like with competitive arcade games.
There's probably a notable separation/distinction between people who do leetcode all day and people in Actually Interesting Positions.
For example, you might've heard of the Oroboros Quine (https://github.com/mame/quine-relay), a program that emits source code in over 128 programming languages in successive steps (as you run each program, it outputs code in the next one's language) and when you finally reach the end you wind up with the original source. This person works at a Japanese company that maintains an online recipe dictionary/service. Is this a major tech company? Nope. And that's most likely the reason this person has the time to dedicate to this. They clearly have sane work-life balance. (Work isn't life, it merely sustains it.)
There was a post on here recently about making a supersonic trebuchet (https://news.ycombinator.com/item?id=29408127). The author made a point that he expresssly optimized for difficulty so he would be able to control for how much time the project took.
A very small pet-peeve of mine is when people say that they're passionate about working in field X or Y, as though being passionate is a critical step to solving problems. It can be, *but only if you are not emotionally investing in what you are not capable of*. The problem with passionate investment is that it can be kind of blind, like blind faith or trust - it's just, this is vaguely the right direction to go, put a moonshot amount of mental effort into it and have blind hope that something good WILL happen. (I'm reminded of a quote by a swimmer, who IIRC was asked how he won a marathon swim race. He said that he did not mentally spare any energy for the swim back.) While it is by definition pretty much impossible to have a proper cause-and-effect discussion about the efficacy of this approach, what can hold it back is being passionate about solving problems that you're fundamentally not able to just *do*. Things where you go "...wait that's actually a really interesting problem" and dwell on for hours or days or weeks because, deep down, to your brain it's not a solved problem and instead a Very Good Question.
Folding back to leetcode, if you're terminally stuck, firstly you need to both identify where you're investing in what you're not capable of, and figure out what that means. While just the first half of this sentence on paper, this step may end up being a multi-month (-year?) project. It may benefit from therapy/assistance to help work through. With that done, you then need to figure out how to optimize for difficulty, possibly sourcing help to assist fighting stubbornness to solve problems the hardest possible way ("if I learn to solve this I'll be a better programmer!" - no, stop bashing your head against the wall and look at all the tomato sauce you've already gotten all over the floor; you are fallible). Finally, remember that the Zen mindset/simplicity of leetcode describes 0.01% of real work. Now have a hard think about what sorts of positions you really want.
If you're saying "I don't know, something cool," then judging your abilities off of the back of leetcode is an especially significant liability, both for you (leetcode cannot provide authoritative direction about how you want to grow) and your employer (who cannot really discern any sense of what to expect from you as a person given leetcode's incredibly narrow focus as a catalyst). Seriously narrow down what you want to do - not just in terms of what sorts of programming you want to do, but what kind of environment you want.
Welp, not really sure how to continue this from here so I'll stop now. I think there's a bit of projection and misinterpretation in places - I know I was envisioning a "just left school" stereotype at the end there - but hopefully parts of this are useful.
> This is also what Software Engineering has become: you memorize, regurgitate and participate in agile the masquerade. Creativity is shunned. Tried architectures/patterns are what is expected.
Not necessarily. If it feels like this, you may be in the wrong bubble. And that bubble is going away, too, because these tasks are the first that will be replaced by AI-assisted code generation. In the meantime, you can always Google an algorithm if you know what to look for.
There is almost zero usefulness in an ability to regurgitate boilerplate patterns, but there is tremendous usefulness in executing good judgement, creative problem solving, and a solid understanding of fundamentals.
Programming is about solving problems that are interesting to you personally, in a way that satisfies you (and ideally your customers). The hard part is finding that niche.
> I used to think this job was a creative one, since writing frameworks and libraries for further use, documenting code and extreme programming made me think that I was building something new and useful.
You had it right the first time. If you enjoyed making these tools, that means there is still an internal drive in you to solve those kinds of problems. Even if those tools happen to be terrible, apply lessons learned and repeat! Spoiler alert, everyone else's tools also make trade-offs at the wrong points, even successful ones. Don't be fooled into thinking that the big things are already solved.
In the end it's about finding gainful employment doing something you enjoy. The good thing about programming is that you get to choose your environment and the nature of your work from a very broad spectrum.
> I wish I had practiced law for the past 7ish years instead, because at least all of my skills would still be relevant.
If you chased framework specifics and arcane patterns for the last few years, then yes, some of that work is not relevant anymore. Learn from that, stop chasing ephemera. You may be better served by doing deep work on a specific thing for a long time, as opposed to perpetually playing catch-up with JavaScript frameworks to impress the next fickle startup that thinks it'll change the world by selling ads.
I would advise anyone who doesn't absolutely need it for an interview to stop spending time on LeetCode and such sites. Instead, invest that time in a project that is relevant to you, and learn everything about a specific domain as deeply as you can. Pushing up a score counter on LeetCode doesn't compare to actually making something competently in the real world. ADHD can trick you into believing that solving artificially parceled-up and pre-defined problems for points in a few minutes at a time is progress, but it's not. Work on something meaningful that doesn't leave you with an empty feeling.
Yup -- brain fog, paralysis and negative performance are the sure-fire signs of burnout (as least as pertains to your capacity for grinding LC). Excellent preparation for the daily grind of actually working for companies that rely on these tests.
Leetcode isn't about fun and challenging things, it's about thinking in one particular way, spitting out solutions using the same exact data structures and jumping through hoops on command without philosophizing or creating anything that can be reused/extended.
Exactly. And these are apparently precisely the "skills" these companies are "desperately" seeking to find among the engineers they invite for an on-site interview.
And don't forget the strong "culture fit" signal indicated by the sheer willingness to grind, grind, grind.
You memorize, regurgitate and participate in the agile masquerade. Creativity is shunned. Tried architectures/patterns are what is expected.
That's ticket. This is exactly the mindset these companies are after. That's why they swear up and down on the efficacy of these tests.
On the bright side: at least you've been freed of any illusions, by this point, about the intrinsic value of your advanced hard science degree.
I've been delivering commercial products (that's the goal, no?) for over twenty years, regularly get high praise and top ranks in reviews, get promoted often including to "distinguished" and "chief" levels (always as a technical IC, not in management).
Yet.. no way I'd ever pass any of these leetcode style memorization interviews. I guess companies think that proves I can't develop? Funny. But sad. Our industry should not be like this.
Personally I feel lucky that this leetcode interview disease started after I was fairly senior already, so I'm getting hired based on track record and connections who love to hire me to deliver products. Hopefully, fingers crossed, that'll carry me to retirement.
But if I was in my 20s or early 30s, I'd be looking to leave tech entirely and go into something else where experience is actually appreciated and valued. None of my high school friends who went into medicine, law, finance, etc have this type of problem in their industries.
I'm in my 20s and think about this a lot although I already moved to management (with a lot of software development, still) as well.
There's a great article [1] analyzing this problem (quotes from the article: "Professionals with higher cognitive ability drop out of STEM careers earlier and faster", "High-ability workers are faster learners, in all jobs. However, the relative return to ability is higher in careers that change less, because learning gains accumulate").
Knowledge depreciates a lot faster in software development than many other fields. That's why I really think about going into finance or sales (still fast-paced), but attending expensive top business schools and starting as an analyst with a low salary again is pretty rough after already building my current skillset. Currently feel a bit stuck with my career options right now. Money's still good and the work is fun, but working in a field that is set up to be a grinding mill as an IC is not an entertaining thought. High-tech projects will still be fun, I guess, but still definitely something to consider. Specializing early on may mitigate this.
No.
Once a company grows to a sufficient size the goal stops being delivering products and starts being not ^&*£ing up the product that generates a lot of money. The aim is to hire people who won't get things wrong, either by making errors or by introducing new unproven ideas.
When I was young I also was pretty good at these interviews and loved doing coding contests and such for fun. However when I joined a big company I learned what really is hard about software "engineering".
It's dealing with legacy code, finding and fixing bugs in highly distributed systems, understanding tickets from customers, managing integration of different components, balancing tests to be enough but not to be too much.
In general the hard tasks are very rarely one specific well determined problem such as finding a node in a tree in the most performant way.
The problem is that this almost inevitably leads to a decline of the company.
I'd say it's more like a "Yes and no." But it's definitely not a binary. Your "No" characterization is partially valid. But only partially.
And what's a great what to introduce mistakes and fuck up an existing product or team? By being overly confident about one's binary "No" answers.
Oh look...a googler ;)
So… the industry is apparently working fine for you, right?
> But if I was in my 20s or early 30s, I'd be looking to leave tech entirely and go into something else where experience is actually appreciated and valued.
Yeah, sure. Not for everyone. It’s unfortunate.
The science degree was useful for when I did advanced math, before the finance industry figured it would just abandon complex math in favor of statistical learning.
Don't get me wrong, I burned out for other reasons, but if you're looking for a job writing math oriented software, they are out there. Maybe consider finding a new area. Maybe take a break first though :-)
I’m very happy with my current employer. They’re hiring. Want an intro?
What we do is a craft. Those things on lc are the foundations of our craft. I want to know everything about my craft, and a lifelong student of it, so I like sites like lc.
I’ll take it over trying read page after page of some big comp sci book.
Also lifelong student? Have you ever felt that everything you learn is just the industry moving in circles?
To bad engineers, I can see how it looks easy and that it is "moving in circles". It is still a relatively new discipline, and as such, still finding a lot of the process, tools, and techniques that other disciplines have developed. Plus Moore's Law and its ilk change things constantly.
Traditional engineers are generally doing the same-ish thing over and over, and the number of possible things they can do is severely limited in comparison to software. Safety is also not as big of a deal as cost. Any idiot engineer can create something with an insane factor of safety, it takes a good one to design something that is safe and cheap.
If you want to compare very complex/rigorous engineering projects like airplanes you should compare them to things like Google. Software and traditional engineering are both rigorous at the highest levels, though not in the same way since software is so much more flexible and has a larger problem space.
Obviously, some would consider it a waste of time. 90% of their colleagues would say, "I don't get paid to know unnecessary stuff about the bolts. I get paid to screw this to that according to this diagram." Which is what commercial software work is. Different thing from being a hobbyist.
This is incredibly dependant on your company, team and role. I’ve been knee deep in data structures and algorithms for the last year. When I was at (FAANG) years ago I worked with people who did this stuff full time. You’ll find roles which use these skills in AI, AAA game dev, finance, operating systems and so on.
But probably 95% of commercial work is styling and wiring buttons. Even at big tech companies most of the work is plumbing. The skills you learn on leetcode are completely irrelevant in those roles.
Nobody except you cares about your craft though.
They care if you can accomplish the things they need accomplished.
If your craft is 'building quality decks' - and they want a 'quality deck' - then great.
But if your craft is 'building byzantine window structures with 4 plane glass imported from Italy', well then, it's going to be hard to work on a house if that's all you care about.
Software Development is a skilled trade, it's more like Carpentry than it is academic, it just has some elements that can be very academic.
I recommend Introduction to Algorithms [1]. Books like that can be really dry and hard to read, and they usually are, but they contain fundamental knowledge about computation that is the only way to solve some hard problems (and there are many hard problems that remain open). Leetcode problems, if they're any good, will simply be exercises based on the concepts in such books. But you won't understand the concepts just by solving the exercises.
My experience is that I spent seven or eight years coding in Prolog (that's how I roll, OK? Don't judge!) and while I had become skilled at it, I didn't really understand how it worked until I started my PhD at which point I really had to sit my bum down and read a whole load of stuff I didn't even know existed.
You'll probably say "what do I care? I'm not in academia". Yes, but you think of programming as a craft, right? And a crafts-person is happy to constantly improve his or her craft. Well, a PhD is one way to do that, sticking with industry for many years, if you can find the right positions, is another. But one way or another you'll eventually find yourself at a point where just solving coding exercises doesn't give you anything new. That's when you turn to the books. If you don't, then you should be concerned: it means you're not really advancing, not getting better in your craft.
I'd have a lot more to say about programming as a craft. Instead, let me point to Peter Norvig's timeless essay:
Teach Yourself Programming in Ten Years
https://www.norvig.com/21-days.html
And to this book by George F. Luger who introduced me to the concept of the "Master programmer":
AI Algorithms, Data Structures, and Idioms in Prolog, Lisp, and Java
https://www.cs.fsu.edu/~cap5605/Luger_Supplementary_Text.pdf
I'm also linking those for anyone else interested in that kind of thing. Happy reading.
___________
[1] It's online here:
https://edutechlearners.com/download/Introduction_to_algorit...
No idea if that's a legit download or not.
But it's an extremely narrow slice of this "craft". Right?
But, is that it? In the US, at least, not a lot of employers will give a straight up test of general mental ability (IQ test), likely because they see it as potentially attracting lawsuits. This is because IQ tests show a well-documented racial disparity in scores, which has not been shown to be correlated with anything genetic. Rather, the problem is either traced back to differences in family socioeconomic status growing up, or cultural bias issues with the tests.
Everything in the previous paragraph can be verified in a few minutes of Googling, so, I'm not going to litter this comment with citations when the obvious keywords will produce the information mentioned here. But, everything else, including what's to follow this, should be considered pure speculation on my part.
Given all this context, I can only think of 2 obvious reasons companies resort to using LC or LC-style interviews:
1. As a proxy for a test of general mental ability, as previously mentioned, or
2. Cargo culting, as with the whole "How would you move Mt. Fuji?" phenomenon.
I don't personally have a great deal of insight into which it is, or, if there's a third explanation that I'm completely missing. I also don't know whether there's any research supporting or refuting the idea that LC puzzles provide a valid interview signal for software engineers. All I really know is that these type of problems exercise skills that are not what one uses on the job as a SWE, so, it seems rather illogical to use them as a main component of your hiring process.
Essentially I agree with you - most of the reason is cargo culting Google.
Assessing software engineers is hard. A couple decades ago, Google (which at the time was a tech darling, and the #1 place to work) had a saying of "A players hire A players. B players hire C players". Essentially they were terrified of hiring bad people, because they figured the company would inevitably go downhill if they did. Their hiring process was essentially an expression of this idea - it was based on the philosophy of "we're all A players, but are you as clever as us?". Interviewing at google at the time involved sitting about 6 back to back whiteboard interviews with programmers. Each person would spend ~20 minutes asking you their favorite puzzles and things, and seeing how you did. Nobody can say this because it would be illegal, but it was in many ways a programming themed IQ test. Good questions were the ones which filtered candidates out. And its easy to recommend against hiring someone if they couldn't reverse a binary tree on a whiteboard in 20 minutes. (I mean, thats easy for me! They must be a C player.)
Other companies followed suit. I mean, hiring is hard. Why not just copy Google's approach? Microsoft did something similar. Facebook was full of ex-googlers, etc etc.
The problem is that being able to reverse binary trees doesn't correlate with how well you can manage a database, style a form, fix a memory leak or talk to your team. And the people who only had those useful skills are unhireable. Oops!
In my opinion, the right way to interview programmers is to make a list of skills you want your programmers to have (coding, debugging, CS knowledge, communication skills, architecture, ...) and then find ways to assess each one. For example, to assess debugging you can give your candidate some pre-prepared code with failing test cases and see how many bugs they can fix within 30 minutes or so. But that requires preparation and test calibration. Most companies struggle to convince their engineers to interview someone for 20 minutes - let alone spend a few days putting together a problem like that.
Knowledge of data structures and algorithms is useful, and it is a positive signal about a candidate. But (depending on the role) I'd weight it below communication skills, raw coding skill and debugging. Those are all much more valuable. We need to start treating them as such.
That isn't true; the correlation is visible when you look at the scores of people with mixed ancestry.
I see someone at microsoft was a fan of The Shamen.
Remember those "thinking outside the box" skills we're supposed to have?
This is what we need to start using them on.
Don't forget that software engineering is often up to 100 people team sport. If every repo and every algorithm has a special snowflake unique flair put upon it, then you have to relearn everything each time you open someone else's repo... also you cannot directly hire for the work, instead you have to hire smart people who start nearly at zero to rapidly learn the nuance of each repo they work on. This is a young man's[2] game (before intelligence crystalizes and energy levels wane)
If there is a good amount of run of the mill computerscience/eng then you can hire people who can start fast(er) and they can build off assumption rather than on having a bunch of special code precariously "cached" in their working memory.
[1]: I'm speaking in generalities, yes some young people are tired/fixed mindset, yes some older people are energetic/flexible -- but afaik the psychology/science bears this difference out
For what it's worth IQ tests test for pattern recognition skills and learning ability, usually within a short timespan with little to no prior knowledge. A memorized pattern of answers to programming questions therefore does not constitute a IQ test. Anyone who says that is really just wanking off to how smart they think they are.
In the average programming job, most of the time is spent digging through documentation, trying to find the one method or configuration parameter you need among hundreds and hundreds of pages.
If someone solves a problem that doesn't exist or isn't a permutation of an existing problem it is a sign of higher IQ.
For example. Given a grid where each element is 1 or 0. Count the amount of donuts in the grid. A donut is a cluster of 1s with a cluster of 0s within it. Donuts can exist within donuts.
Extend this problem to 3D to count the amount of hollow shells in a 3D grid.
Given a grid where only a single cluster of 1s exist. Determine if that cluster forms a 3D donut.
These problems I just created from scratch. A person who solves it in an interview, I know he is smart because I know he never looked it up.
Here's the other thing. The skills involved in solving this problem is highly unrelated to the day to day tasks of a software engineer. Additionally I believe anyone can solve these problems (except for the last one) given enough time (and you certainly are given enough time on the job). The software interview is mainly testing for IQ based on how FAST you solve this problem. Either way, software engineering itself is easy, it doesn't need high IQ.
But make no mistake. A person who solves these problems and does so both quickly and without pattern matching the problem to an existing one he/she practiced for is demonstrating higher intelligence which is what most interviewers at FAANG are basically trying (and arguably sort of failing) to test for.