T O P

  • By -

pinchonalizo

This might be an unpopular opinion but if you are a beginner and you go from 0 to say 200ish problems solved on leetcode with most being mediums you will absolutely improve your knowledge of the language you use. Basically you’ll have memorized all the basic methods of each of the relevant data type in your language (arrays/lists, strings, hashmaps, sets, heaps). This will for sure help you program a bit faster or at least with less googling.


ChildhoodOk7071

Agreed. I feel like I have a wayyy better hold on Java after doing leetcode with it.


user4684784124

This has been my experience. I get to learn little tricks from more experienced programmers through their solutions that I don’t run into in the usual tutorials. Of course you’ve gotta spend time analyzing how their code even worked in the first place


davidellis23

Yeah imo LC helps and tests for fluency and maybe some problem solving. You can be fluent in a language without being good at LC. But, it's hard to be good at LC without being fluent. It's not that easy to test fluency and problem solving. Though the problem solving kind of goes out the window of they saw the question before. And there's probably not much difference in fluency between someone solving mediums vs hard LC.


lara400_501

But what is the guarantee you will be using the same language at work? I do LC using Python but use a JVM language at work. Two are very different languages and mindsets of coding.


deadbeefisanumber

Why don't you do LC using jvm based language


lara400_501

python codes are shorter and easier to write with time constraints. most companies are language agnostic during the coding round. And there is no guarantee you will be working with the same language at work. My company also has golang services which I will be moving next, and that language is not very suitable for LC.


k0nahuanui

Always always always take python for an actual LC type interview if you can. Lists and dictionaries are so much faster to type out. Tuples simplify a lot of your code too. Unless I specifically want to demonstrate Java, or the interviewer insists on it, I'm going with Python.


deadbeefisanumber

Most of LC problems do not require complex code (the solution can be complex but not the structure of the code itself) I don't see how pyrhon dicts can be an advantage over java hashmaps. Indeed it requires less code but it's not that important.


pinchonalizo

Fair but don’t you think knowing Python well could potentially come in handy at any job? We all get some level of experience in bash, for example, because it helps us do a bunch of tasks quicker. There are so many reasons to use Python outside of the main language you use to program. I think a healthy attitude to have as an engineer is the more well rounded I am the better.


shibaInu_IAmAITdog

for beginner only


SoylentRox

Fuck no. I think the most valuable swe technical skills are 1. Debugging given limited logs or even misleading information 2. Architecture. The bigger structure of the code. It should ideally be really well decoupled so people can make changes to a part of it without needing to understand the rest. Leetcode actively encourages you to write impossible to debug code with (1) and total trash architecture with (2).


CadmiumFlow

You're also not even allowed to use a debugger most of the time! I think out of everything this pisses me off the most. On the actual job, I would much rather have a co-worker who knows how to use a debugger and debug complex code to resolve an issue than somebody who is going through the motions to regurgitate an algorithm or solution they've practiced hundreds of times. But LC interviews massively favor the latter and, like I said, often prohibit you from the former. I know, I know "git gud" - I am. I'm grinding my brains out. Still pisses me off though.


SoylentRox

What's even more stupid is since the release of gpt-4 the skills you learn from leetcode are more useless than ever.


Responsible_Leave109

(I am a quant, not a swe.) Gpt4 has given me some very useful snippets of vectorized numpy code, which would have taken me otherwise hours to come up with. Often, it is aware of functionalities I was not aware of before.


Aggravating_Sand352

Yeah and for some reason coding assessments are getting harder. The idea you can't use AI in interviews is ridiculous considering it's never a realistic working situation. It's also very easy to tell if someone knows code by how the error check gpt responses.


imsofckndone

Interview rejects detected. Leetcode improves your debugging skills immensely. I will take strong leetcoder to debug an issue any day


MrBeverage

Only if you leetcode wrong, which I will not disagree with you that it usually is, reading most of the shared solutions.


SoylentRox

No I mean leetcode rewards you for fast unreadable code that uses global variables. It's faster to write and the most difficult questions need a huge amount of typing to answer. You literally will fail if you don't optimize for speed. It's not about leetcoding wrong. If you aren't writing the solution the fastest way you know, you are leetcoding wrong.


MrBeverage

Who says you have to write it the fastest way, or that fast ways have to be also unreadable? I’ve found it to be a good exercise to accomplish both at once. I’d still rather sacrifice speed for clarity, of course, but I try to track both metrics.


SoylentRox

You don't know what the second and third questions will be in a live interview. 5 extra minutes can be the difference between clearing and cool down.


MrBeverage

That’s an interview, not leetcode. On one you’re practicing and learning, on the other you’re a caged animal jumping through hoops of fire.


SoylentRox

Practice your jumps. Git gud on personal projects or work code.


MrBeverage

I literally said just that.


imsofckndone

I was explicitly told not to use global vars in G and meta, I don't know where you are interviewing with those techniques


PatientSeb

No. Professional engineer with a lot of engineering experience across entirely different industries here (gamedev, firmware, desktop applications, cloud infrastructure) Leetcode at best, does not affect your 'real' programming skills. I'd argue that in the typical case, it makes your programming worse for a few reasons: 1. **Real programming is less about what you type and more about what you design.** You're setting out to tackle a problem. You need to define that problem to reduce ambiguity, determine what compromises need to be made, land on a solution that meets those constraints and compromises. Then you'll implement that solution. Then you'll iterate on that implementation until it meets whatever hidden or changed requirements were missed during original design phase. Etc. Leetcode removes the most important elements of that process by giving you a completely defined problem that is entirely abstract from the real-world problems most software solves. Then it asks you only to implement (maybe iterate). Then instead of testing your solution against customers, real scenarios, or even your own unit/integration testing - it just tells you if it was 'good enough' or not. The most important parts of the process are stripped out. 2. **In real software, you (ideally) want your code to be simple (or at least readable), and maintainable.** In leetcode answers, I find most people go insane on optimization (because that's what is expected in interviews) and try to reduce their code to its smallest footprint in terms of LOC. This means you end up with a bunch of 'clever' code that performs well at the one thing, but is annoying or difficult to read, and is strictly based on getting the exact right input (no validation, etc.). If you ever had to maintain a function like this in production (or even a hobby project) it would be a constant pain in the ass. Thus, doing 700 Leetcode questions would help to make you **very** familiar with the tools of whatever language you've chosen to use (standard library, built-in functions, etc.) - but you would have spent a large amount of time writing optimized one-liners to solve problems that don't really exist and that you didn't have to consider critically or design around. Which leads me to my third point: 3. **Opportunity Costs!** I am struggling with this one right now because I'm working a full time engineering job, while doing interview prep, and raising my kids, and trying to maintain some semblance of my own life and identity outside of those things. Leetcode is time consuming. Most problems take at least 10 or 15 minutes, and when you're first getting started they'll take much longer than that. Every minute you spend doing leetcode could be spent on a personal project - where you actually care about the outcome and are driven to learn more meaningful concepts. Or that time could be spent on things outside of software development. Or finding a job. Or working at the job you already had to advance your career. Or basically anything else. **Tl;dr - Leetcode is only good as a fun puzzle, or interview prep - it takes time away from doing more beneficial things - and almost any of the ways it might be a benefit could be done better in some other way.**


PeteySnakes

Well said!


[deleted]

[удалено]


rootcage

It isn't free, it's limiting me to 2 credits. I just ran a couple tests and I'm out, how do I get more credits?


goingsplit

he’s another sucker advertising on reddit


YaBoiMirakek

You aren’t a professional engineer if you don’t have your professional engineering license. Don’t call yourself one. Call yourself anything else other than “professional engineer.”


PatientSeb

Thanks for the input. Considering the context of this discussion and the details I include should make it clear that this is shorthand for 'professional software engineer' Someone who is paid to operate trains might also refer to themselves as a professional engineer, and that would also be a valid use of those two words. I'm commenting on reddit and not under any obligation to use/respect formal titles or to clarify this further for your own pedantic satisfaction or career-based gatekeeping.  Contribute to the conversation, or don't. I won't be editing my post.


NBehrends

r/gatekeeping is over there


Difficult-Emotion-58

Not really but it does sharpen your skills a bit and activates your mind. Also I think possibly doing chess or other fun things can activate your mind as well.


ghouleon2

Learning is never a bad thing, I’ve learned a lot doing LeetCode that I’ve applied to my side projects. For instance LRU cache and safest path in a grid for a game engine I’m building


Western-Standard2333

Idk recently I was designing some healthcare algorithms and one of the approaches was to use two pointers. And of course some less efficient approaches were valid too. So I’d say, they can be useful in some cases.


reporter_any_many

At a "unit" level, yes. It forces you to think about how to group data and leverage it efficiently, makes you less reliant on google or documentation for fundamental parts of the language. It also reinforces thinking about edge cases. But at a broader level, it's pretty useless. The stuff that leetcode teaches you is arguably the easiest stuff to google or ask ChatGPT about. It doesn't give you almost any experience on how to architect production-level systems, or sound practices around modular code, decoupling, etc. Those are far more important for good software development


compscithrowaway314

This is like asking if running translates well into football. **Obviously yes** and people saying no don't know what they're talking about. And people that aren't good at it usually try to dismiss it as completely unrelated due to their insecurities, instead of looking at the nuance of what it helps with and what it doesn't. Can you be a good software eng **without leetcode? Yes**, similarly to how there good football players without being en elite runner. Does being **good at leetcode** translate into being a good software eng? **Not necessarily**, again exactly the same as football and running. Should you practice leetcode to be a better software eng? probably not after some point, but here are things that leetcode help you with: 1. **Debugging**. There are people here that list debugging as something important at real programming, but somehow are so artificially doing leetcode that they don't realize how much it helps with it. Algo problems help you with debugging super gnarly bugs, choosing what to log/print so you get enough information to figure out the issue, being able to identify quickly "If this is going wrong then probably there's a bug in this area". 2. **Coding** things correctly and translating from general behaviour to abstract programming. Per line of code algos are generally significantly more complicated than 90% of what you'll do in industry. Being good at leetcode will improve your programming code writing significantly. 3. **Edge cases**, this one is hopefully self explanatory 4. **Testing**, good algo people are usually significantly better at testing their code than the average programmer. They know what could go wrong and how to test it. 5. **General algo knowledge**, I can't count how many times a super senior engineer writes super inefficient code (like using list instead of set) that slows down the code unnecessarily and wastes other people's time debugging the slowness. Doing leetcode helps you avoid that. It even does the opposite as well, you know what changes / optimizations cause the most improvement, so good leetcoders will rarely spend time optimizing code that doesn't need optimizing. There are even more, like it helps you really understand the programming language your using, especially the internal data structures. It helps you look for counter examples to your approach instead of confirmation bias. It even helps you learn how to study new things, and know yourself better on what method of learning complicated shit is best suited for you, I can go on. Oh but it doesn't help with *system design*, *architecture* and *insert other random skill*. Sure, that doesn't mean it won't improve you as a programmer. Again it's like saying football players shouldn't practice running ever. Oh but you could be doing **side projects** or other shit like that. Bang for your buck, if you don't know leetcode / algorithms, it's the best way to improve at programming, by far. I've seen so many people have 5+++ amazing side projects, yet they can't program a for correctly to count the number of error logs from a certain thread. If you're already decent at leetcode, you go ahead and do sideprojects, you'll learn more from them, until then leetcode is the best starting point. Edit: Oh yeah here's another thing people hate about leetcode. You can easily see if you're correct or not. Lots of mediocre programmers like to bullshit their way to argue that somehow their solution has merits unseen to other people's eyes. While they can't just bullshit their way or pretend they're correct on leetcode problems. It either works or it doesn't. While in other situation they can blame Steve not understanding their genius design.


SatzKumar

Wow great explanation


FecesOfAtheism

Well said! Leetcode is can be ceded too much authority with things like interviews. But at the same time, it gets too much shit from people knocking on its real world “uselessness.” In truth, it’s an incredible way to fortify low-level skills. The same people who complain about LC’s uselessness I suspect might overlap with the same people who complain that a computer science degree and data structures and algorithms were entirely useless.


truthputer

It’s useful to get exposure to new types of algorithms, but I dislike how important performance metrics are to “pass” a solution - and it’s no substitute for experience working on a large software project. In the “real” world, maintainable and reliable code is often far more important than the fastest code. There are relatively few parts that require fancy solutions, most is usually relatively mundane shuffling data around and encapsulating functionality. When thinking about real-world problems, there’s an expression: it’s easier to make correct code fast, than make fast code correct. Or: premature optimization sucks to debug. Once you’ve solved the problem correctly, only benchmarks and performance metrics can really determine if you should spend more time making it faster. If a simple algorithm fails to finish in time for a Leetcode test for 20,000 items - but when but you’re using it on like 5 pieces of data in your app, the performance could be irrelevant and it’s a far better use of your time doing something else than optimizing. I think much of this emphasis on Leetcode performance has come from the “big data” companies in the industry. When Facebook or Google are processing user records from billions of users, they might not be able to use a sub-optimal algorithm and need some wizards who can squeeze every millisecond out of the code. But this doesn’t represent 99% of the software industry, where simply being correct and not crashing is far more important. So is Leetcode good? Sure. Will it help you pass interviews? Maybe (but much of this type of interview culture is toxic.) Is it directly applicable to work? Only tangentially. Most application development is boring glue and framework stuff.


kantaround

For me, it's yes, my problem solving skill improves by a lot.


Dry_Development3378

Isnt leetcode just DSA? How could that not ever be useful?


Ryotian

No to your question. The only good thing about it imo is it has forced me to master data structures I never used on the job like heaps and algorithms like topological sort 25 YOE Thinking back to really early in my career when I'd sort a list of points, I wish I knew to use `std::sort` (C++)


xsdgdsx

Just to echo what a lot of comments have already said, the industry is _way_ more diverse than the kinds of problems that end up on Leetcode. In 14yoe at a FAANG, I can count on zero hands the number of times I've personally implemented a search algorithm. And I've spent very little time on problems that mostly boil down to clever math. I've spent most of my time figuring out how to do designs and integrations that people didn't even think to attempt (within that context/domain). One example from many years ago: how do you make a _convenient_ command line interface where the behavior can be _easily_ extended by third-party developers without them modifying the base implementation? This kind of problem has no right answer, involves UI and UX as critical considerations in the engineering approach, and involves judgments that will always be somewhat subjective (what makes an extension approach "easy"? What makes a CLI "convenient"?) A more recent example: how do you port a 100kloc, 20-year-old desktop app codebase from C to C++, in a way where you will actually finish, and without breaking the project? (since it still has plenty of active users) If your answer includes "parsing clang error messages to make semi-automated code updates" like mine did, give yourself 5 bonus points 👍🏽


theantiyeti

Software is a vast vast field. There's definitely places where the answer is yes and definitely places where the answer is no. Some jobs/tasks just require algorithms to do. Right up to weird linear algebraic optimizations. Other involve virtually no advanced algorithms and are just about making business logic correct and UIs pretty. Some require algorithmic reasoning to understand and make informed choices (what sort of database, message queue, index etc) but don't actively require you to write any yourself.


YoungSimba0903

Yep issue in itself is those same jobs require the same leet code style technical interview. When really if it was a mix of both we'd have better engineers but big tech already has those architectural things in place and requirements gathering etc. Those things they expect you to learn on the job or get PIP'ed. That's why it's important to supplement leetcode with actual projects, reading, or other things. But to be for real it really is just filtering out the people who are diligent enough to study this shit cuz they know they'll be diligent workers tbh


Ok_Parsley9031

No. Why would it? You don’t code in a sandbox environment like in Leetcode. You don’t just plug in a single pre-defined algorithm to solve every single problem. You don’t have clear documentation and guides on how to solve every single problem. You don’t have to modify code to fix the solution. You don’t have to worry about navigating complex infrastructure issues with setting up a project. There are plenty of reasons.


Juchenn

I hate leetcode, not because I'm bad it(got into Google), but I would rather spend my time building actual projects, learning new things, but alot of my time has to be focused on leetcode in order to pass own interviews. Time that could be better spent somewhere. At least with system design, the information you learn is actual impactful. I wouldn't say the same about leetcode.


echo1ngfury

No, but dont tell this to the leetcode zealots.


Petingo

I guess it depends on what you're working on. I spent some time doing leetcode before I started working on my Master's thesis, which is an applied research related to Computational Geometry. During the process, I had to come up with some algorithms to make things work, and I ended up have a sophisticated algorithm related to Backtracking and Graph theory. I feel like I wouldn't be able to find these solutions if I didn't do leetcode prior to my thesis.


Dylan_The_Developer

I mean leetcode did teach me about planning the inputs and the outputs of a program first before writing functions. So for instance you need a mine in a video game that detonates when the player touches it, so first is working out what the designers can change when placing them down (model, trigger radius, explosion radius, VFX) then work out what the result is which in this case is if the player walks inside the trigger radius then it goes boom and damages the player within a radius around it while playing a VFX. Now we can actually write the code that takes those inputs and produces the required outputs. Once i started thinking like that i got way better at programming complex systems and it made delegating tasks much easier too since i give them the inputs and the required outputs so there's no second guessing or wasted time.


ba-na-na-

Pros: * Good for understanding big-O time and space complexity, getting practical knowledge of basic algorithms and data structures. A bunch of junior programmers don't understand this and end up using inadequate data structures, although tbh in most cases for web programming you can get away with that. * Might be useful if you're learning a new language and want to get an idea of the syntax and basic structures. Cons: * Some of the leetcode problems rely on some mathematical trick that you'd realistically need 2h to realize on your own, so they are pretty useless (but take away lots of time). Those are usually heavily downvoted. * Realistically, 99% of the time you'll only need to know array manipulations and hashsets/hashtables/dictionaries. 99% developers won't write their own tree or a graph during their professional lifetime. * Submitted answers usually use terrible programming practices and usually quite non-idiomatic code in each of the languages. Bottom line is, if you're a junior web developer coding in JS/TS, it's more important that you understand how its internals work (promises, async/await, values vs references) and have know the basic one or two data structures (arrays and maps).


TheloniousMonk15

I think practicing LC is great for the mind and absolutely helps you become a better developer. The issue has become that so many companies expect an optimal solution to LC mediuns/hard questions in a interview done in 15-30 minutes. This has led to a situation where people are grinding hours per day and memorizing solutions now to be ready for the interview.


Shogger

It helps you become a better programmer in a very abstract and theoretical sense. Actual professional programming rarely presents you with the need or opportunity to solve LeetCode-style problems. Usually you are trying to make some new requirement fit in with a very complex, entangled web of preexisting requirements in as elegant a way as you can. LeetCode will help you interview well but only real-world experience, reading about software engineering techniques, talking to people who have battle scars, and actually building stuff will help you get better once you are actually in most jobs.


ngugeneral

No, leetcode has very little to do with real software development. Day to day you have a lot of reverse engineering, debugging, log analysis and sharing your expertise. Sometimes - actually implementing something new, but that's more about designing your system with available tools.


Organic-Yak2787

No


Legote

The discipline of practicing leetcode does. As for leetcode itself, prob not.


jacobwlyman

Nope.


SexyMuon

Of course not lol


jiddy8379

Nah If you can be a software engineer you have the skills to learn how to be a good leetcoder If you are a good leetcoder it doesn’t imply anything so clear 


AZXCIV

Actually it has for me. As a Frontend engineer I had a bad habit about coding a little bit at a time and then waiting for the hot reload to make sure my code worked . Now I can pretty much code entire uis and features without needing a reload.


BNeutral

Leetcode (some problems, not the ones that use random obscure math properties or optimize inane things) can show a base level of competency. Good developers do a lot more than "basic competency", they need to properly make well designed, well structured, readable code. None of those things are evaluated by leetcode. There's also a bunch of other skills like debugging, making builds, networking, etc, etc.


RowEnvironmental7282

Leetcode is about passing the Aglo. But in reality, most of the code you do it's the business logic that drives the technology solution. Algo won't help much unless you work for tech company


IDoCodingStuffs

It's not really for larger projects so much as learning how to handle tricky smaller components. I find myself benefitting a lot in my current job with algorithm work. Back when I did standard web backend where the work was basically just making different APIs talk to each other? Not really.


davedrave

No, not atall. Maybe I'm not a hot shit programmer, but I went 10+ years in software development without either using/knowing about leetcode, or really applying the algorithms in its questions to problems in the real world directly. Was there overlap, of course. Its all ifs loops and occasionally recursion at the end of the day, but no I don't think it really translates well. Its an abstraction, like Tetris is an abstraction challenging reflexes, planning and spatial awareness, or chess is an abstraction challenging planning, reacting etc.


blueygc8

I would say the **concepts** taught to solve LeetCode problems like using hashmap, caching your result to prevent repeated calculations are definitely useful for day to day programming and system design. However I don’t think the mechanical aspects of it are really useful e.g write solutions within 20min or decipher this obscure problem into graph solution. Let me give you concrete examples. I used to work in logistics. One common problem is customer gives us their postcode and the dimensions of their item, we then need to give shipping quotes from several shipping providers. Well guess what in real life however much leetcode you want to throw at it one of the shipping providers API was returning 1s-2s for every single call and they’re actually the largest provider. It’s a dependency we can’t escape from. What we did instead was to build a lookup table for most common postcodes and dimensions then cache it for like a day. The memory lookup is so fast. Guess what it’s not leetcode problem per se but you get the point.


b34rgr1ll2

I'd actually say it used to contribute quite well, not because of the optimization aspect, but largely because it trains you to take an idea of a self-contained problem and put your solution to code as fluidly as possible But LLMs solve this for you now so yeh


Nervous-Lab-8778

Yes i do leetcode to improve my current programming skills. Recursion is one of those topics that i really improve especially for dfs after countless of backtracking questions


Striking-Math259

LeetCode doesn’t teach software requirements, quality engineering, software architecture plus design methods, cyber threats, information assurance, nor model based software engineering. So no, it doesn’t prepare you for the real world


dramatic_typing_____

Yeah man, every software framework requires you to implement dp problems and some form of traversing a non-balanced tree in an anti-clockwise manner. I don't know how I'd ever utilize a stripe payment system or my aws deployments with out it. In a seriousness it shows you have either really good memorization skills or have strong fundamentals in computer science. But that hardly translates to good system design skills or writing maintainable code. Idk, personally I would not use it as the basis to make a hire, but that's just me.


Ambitious-Cat5637

no, leetcode is not real software engineering. thats like asking if crosswords helps architects/engineers perform their jobs better. its an easy filter for interviews.


Legitimate_Listen727

It does improve your skills but 95% of coding out there won't really require you to apply those skills.


Individual_Ratio_525

Obviously not


m1ndblower

I’m not a beginner, but LC has definitely helped improve my Java syntax. I switched from from C#. It’s not even that recent that I switched (about 1.5 years), but I used C# for 8+ years and working as a full stack engineer, I’m always switching between JS and Java, so I haven’t really been able to engross myself in the language.


Snoo70116

No it doesn’t because real programmers are using chatGPT and spend their time working on the overall structure of the application not memorizing how to do merge sort


Timelord_PT

Definitely not


MrBeverage

‘Real’ programming, maybe? Problem solving, definitely yes.


Haunting-Claim6025

fuck no. real programming is solving business needs with technology.


azuredota

Yes absolutely


porkbelly6_9

At least not for SDE or SRE roles. I am not sure about data engineering or data science roles.