u/Drkiller91

My perspective on "Why LeetCode?" from an employed SWE

Hey everyone, I figured I'd write a post about this because I see a lot of posts on this subreddit like "why leetcode?" Assuming most people are leetcoding to find a job, I thought maybe this answer from someone who has passed coding interviews, gotten offers, and works professionally as a SWE might give other folks some insights as to the why.

I'll preface that this is my opinion, and idk if it's a general opinion in the industry, so take it for what it's worth.

So why leetcode? I'll break up the answer into four pillars: Growth Mindset, Efficiency, Fairness, and The Job Itself.

1. Growth Mindset I'll start with what I think most of these tech companies are looking for in a candidate. At their core, they want most, if not all, of their employees to have a growth mindset vs a fixed mindset.

Assuming you're not just memorizing leetcode problems or cheating with AI and are actually trying to learn it yourself, one of two things happens when you fail to get the answer right or come up with the optimal solution:

  • Fixed Mindset: "I'm dumb, I'm not good enough to be a {insert whatever you're tryna be}. AI can solve this, why do I have to?"
  • Growth Mindset: "Ah, I approached the problem like this, and that's why I came to that conclusion. In the optimal solution, they approached it like this. I'll try that approach next time if I see a similar problem."

See the difference? Neither answered the problem optimally, but one person saw it as something wrong with them or complained, and the other just saw it as a learning opportunity to be better. If you continue to complain or vent about the problem and why this or that, then you're demonstrating all the traits of a fixed mindset person. This will make your learning much harder, and eventually, you will quit. And you just saved the company a bunch of time in vetting candidates.

2. Efficiency The second reason for "why leetcode?" is that it's incredibly efficient at weeding out people and finding the right people. Here are other popular types of coding screens I've been a part of:

  • Take-Home Project: "Here is a project, I need you to design and implement a system within these parameters and get back to me, and we will review it." Why is this inefficient? I have to wait 1-2 days minimum for the candidate to complete it. Then I have to review the code and come up with questions to ask the candidate about how they did the work. Then I have to actually schedule time with them and discuss why they did xyz.

Now, this is closer to how work gets done in a professional setting: we write code, open up an MR/PR, some technical leader asks questions to make sure we covered all tradeoffs and whatnot, provides feedback, iterates, and if everything is to everyone's liking, we ship it. But as an interviewer, you just spent a massive amount of time assessing one candidate when you could have assessed many candidates in that time for the same role.

  • Esoteric Tech Screens: The second form is still a coding screen, but you're going to code in something that looks like their specific environment or requires esoteric coding knowledge. This is worse than leetcode imo, because yes, you can still get similar signals, but you actually miss out on more qualified people than if you had just done the leetcode screen.

3. Fairness Going back to the previous point, needing esoteric coding knowledge is actually less fair than leetcode, and honestly, would you want to work in a place like that?

Computer Science is a vast and broad field, and focusing your study time on particular tech stacks might not be an efficient use of time. If most companies are likely to leetcode you, then you have a better chance of landing a job focusing on that universal curriculum. Leetcode is more fair because of all the resources at people's disposal to succeed in it. You just have to put in the work. You also have a structured toolset, vs going into those esoteric coding interviews where the toolset is company-specific, and if you don't know it, it's clear they aren't willing to invest in you to learn it.

Is it perfectly fair to experienced engineers who have heavy outside-of-work responsibilities and less free time to study than a college sophomore? No. But it is universally accessible, entirely stack-agnostic, and prevents you from being disqualified just because you haven't used a company's specific internal framework. I wasn't always good at leetcode, but I got better at it with time.

4. The Job Itself Why leetcode? Because learning how to be good at it requires a lot of the same behaviors needed to be a good software engineer. You will be given problems that at first are difficult and opaque. Your initial solutions might not be great, but over time, you continue to iterate and get to a place where you find the optimal solution. You find these solutions by studying, reading, learning from your peers, etc. And with time, if you keep it up, you become an expert in that system.

reddit.com
u/Drkiller91 — 17 days ago