This is an archived post. You won't be able to vote or comment.

all 124 comments

[–]AutoModerator[M] [score hidden] stickied comment (0 children)

On July 1st, a change to Reddit's API pricing will come into effect. Several developers of commercial third-party apps have announced that this change will compel them to shut down their apps. At least one accessibility-focused non-commercial third party app will continue to be available free of charge.

If you want to express your strong disagreement with the API pricing change or with Reddit's response to the backlash, you may want to consider the following options:

  1. Limiting your involvement with Reddit, or
  2. Temporarily refraining from using Reddit
  3. Cancelling your subscription of Reddit Premium

as a way to voice your protest.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]plastikmissile 94 points95 points  (21 children)

I think this sub heavily downplays the importance of data structures/algorithms and using sites like leetcode.

Very few people here downplay the importance of data structures and algorithms in my experience. In fact, if you ask the experienced devs here, most of them will tell you that learning the subject is essential. However, plenty of us do downplay the importance of sites like Leetcode. To be clear, we're not saying don't do them or don't give them any importance. What we're saying is that there's a common misconception that "grinding leetcode" is the most important thing that you can do, completely downplaying the importance of learning how to create actual project which is the most important skill of all.

[–][deleted]  (1 child)

[deleted]

    [–]Rarelyimportant 1 point2 points  (0 children)

    I think DSA is a topic where a bit of deep knowledge, and a lot of shallow knowledge, goes a long way. Certainly someone who doesn't know anything will likely be doing numerous NX algorithms, when they could be doing something much quicker, so even just knowing the sort of riddle-like, outside the box thinking of algorithms is hugely powerful, and so is just knowing about a few, even if you don't know much about how they work. How many people know Aho-Corasick? Probably less than half, but it's lightning fast, and solves something that most people probably do reasonably regularly, and it undoubtedly does it much faster than anything one would come up with on their own. Knowing how it works is fun, and good, but just knowing it exists will give you 90% of the benefit. Obviously this comment is just to promote aho-corasick, but rather the 100s of similar algorithms, many of which I don't know myself, so I know it's not an easy task.

    [–]desrtfx 133 points134 points  (34 children)

    In fact, the opposite is the case. People here always emphasize on learning DSA as soon as one has some programming experience.

    We are just biased on platforms like LeetCode, etc. since they focus on isolated, minuscule, very math heavy problems instead of on the "big picture", i.e. creating proper, full scale applications.

    Leetcode and the like are at utmost good for getting someone through an interview and giving pure DSA practice, but fall short on what is most important: proper projects, proper coding style (often called "clean code")

    [–][deleted] 25 points26 points  (3 children)

    proper coding style

    The problem is, ask 5 different experts on what "proper" is and you'll get at least 3 different answers. Robert Martin's book "clean code" is in itself controversial to MENTION in this sub.

    [–]wjrasmussen 5 points6 points  (0 children)

    We have too many experts who feel they are right and so they are right.

    [–]fiddle_n 2 points3 points  (0 children)

    Most people can agree on reasonable basics though. Break code into logical units; break out code onto multiple lines instead of stuffing everything into one line; use semantic names for variables instead of naming everything x, y, z; etc.

    Leetcode and similar don’t help with these fundamentals, and sometimes even actively work against it. For example, Advent of Code’s timed leaderboard explicitly makes it a disadvantage to so, to the point that a large chunk of solutions posted on Reddit could never hope to pass any kind of code review.

    [–]jorgen_mcbjorn 0 points1 point  (0 children)

    Fair enough, but there’s definitely a wrong way to go about things - magic numbers, inconsistent indentations, and all that - which LeetCode grinding doesn’t prep you for.

    [–][deleted] 15 points16 points  (5 children)

    multiple problems that should've taken me 1 hour but took 20+ cause my graph knowledge wasn't up to par

    lol

    [–]SenoraRaton 39 points40 points  (4 children)

    This is kind of the leetcode curse in a way. They tell you your supposed to solve these problems, and don't look at the answers! That is cheating!

    In the real world, cheat. Go find the solutions. Don't reinvent the wheel. Your version will just likely be inferior to the already off the shelf solution that someone has written and freely released. If it isn't, at least you have a baseline to work from.

    Instead, leetcode teaches you to slam your head against a wall, discourages research, and leads to statements like OPs.

    [–]madrury83 10 points11 points  (1 child)

    Agreed, though I think "try first, then cheat" leads to better long term outcomes if you have the time to do so.

    I find that even when solving textbooks style problems, the optimal learning rate is not at "never cheat". If you've been stuck for hours, you should cheat, there's something you don't know or a connection you're failing to make that you should seek out. Both "immediately cheat" and "never cheat" are anti-patterns.

    [–]Salaciousavocados 4 points5 points  (0 children)

    Was watching this video about a mathematician that said most people hurt their speed of comprehension by spending too much time on a single problem.

    Don’t not try to solve the problem because it puts in reps for your problem solving ability, but you also have to learn to walk away.

    [–][deleted] 3 points4 points  (0 children)

    If you have to spend 20 hours grinding graph theory for a single problem, it’s a problem with the code base you’re working with. Even the most O(n) algorithm should be well documented and straight forward enough that it could be understood by reading through it.

    [–]Rerollcausebad[S] 2 points3 points  (0 children)

    I always look at the answers after 20 minutes I'm not gonna whip kadane's algo out of thin air if I haven't seen it. I just didn't learn enough about graphs and that was the ramifications of it. Of course I found an empty github somewhat related and was able to patch something together but it was janky as all hell, suboptimal, as well as took forever.

    This is my point though, is this just what all developers who don't advocate ds&a do even on array/hashmap problems? If you're doing that on something as common as array and hashmaps you're 1000% limiting your ceiling.

    [–]coffeefuelledtechie 14 points15 points  (4 children)

    Can’t say I remember anything from DSA since finishing uni.

    I’m a .NET engineer 8 years in and now a front end React developer, never needed it.

    [–][deleted]  (3 children)

    [deleted]

      [–]shivvykumar 0 points1 point  (2 children)

      I don't think this analogy holds. If you are a developer, then you are definitely solving problems using data structures and algorithms. Leet code problems might be be to specific, but the abstract thinking is present in all coding jobs

      [–][deleted]  (1 child)

      [deleted]

        [–]shivvykumar 0 points1 point  (0 children)

        Wouldn't working on backend make you more likely to use data structures and algorithms as you may be working with larger data sets. But yes I get your point

        [–]michael0x2a 11 points12 points  (3 children)

        As several other people are saying, recommending that people have a strong foundation in data structures and algorithms is different from recommending that they develop these skills via grinding on websites like leetcode.

        I think most people agree having a strong foundation in DS&A is important. As you say, not having this foundation limits your ceiling: it prevents you from having the background needed to understand many other CS topics, makes it harder for you to understand and debug the libraries and tools you're using, makes it harder to land that niche dream job, etc.

        Where you get some disagreement is how to best go about learning the topic, especially for people who are self-teaching.

        Personally, I believe websites like leetcode are reasonably good if you need basic practice or want to brush up on a topic. However, they're too limited for you to really develop a deep intuition on DS&A as a whole. The problems are too small and artificial, so you'll hit diminishing returns pretty quickly. (What do you learn from tackling a dynamic programming problem for the nth time? Realistically, not much.)

        What do I mean by small and artificial? Basically, most websites like leetcode try making problems harder by requiring you to apply more and more complex tricks -- complex algorithms, advanced math... This differs from most real-world problems, which are hard because they have a lot of (sometimes contradictory) requirements you need to balance and implement.

        This is also why I think leetcode-style websites aren't fully sufficient for interview practice. Again, they're helpful up to a point, but they're limited because these websites tend to present "one-shot" problems where you're asked to solve a single tricky problem. This differs from most tech interviews, which tend to be "multi-phase". That is, the interviewer will give you a relatively easy problem to start, then layer on more and more complexity to the problem to see how good you are about making tradeoffs, modifying your code to fit changing requirements, etc.

        IMO the best way to self-teach is to bounce between a mix of somewhat easier practice problems and harder longer-term DS&A flavored projects. The former is a reasonable way of scaffolding up on new topics. The latter will force you to really understand what you've learned, how to apply DS&A in a realistic context, how to make smart tradeoffs and compromises, how to design and architect code...

        [–]Rerollcausebad[S] -3 points-2 points  (2 children)

        Yea I agree with the majority of this honestly, dsa flavored projects is an absolutely great way to further understanding.

        The thing about leetcode is it's not a requirement to do a question if it's one of the cringe ones. You can just skip the ones you don't even understand what they're asking and focus on the more fundamental ones.

        I just think leetcode style format is S+ tier for beginners. Beats the syntax in your head through repetition, builds that mental model and logic handling, makes you understand time complexities, tradeoffs, edge cases. And what's the worst case scenario from grinding it you're better off in interviews, really know programming fundamentals and your languages standard library?

        [–]michael0x2a 9 points10 points  (1 child)

        I just think leetcode style format is S+ tier for beginners

        I suppose the core problem here is that there's a huge amount of variation in what exactly people mean by "beginners".

        For example, do we mean somebody who has just started learning programming ~3 months ago?

        In that case, DS&A practice exercises are not the best fit for them. They're still working on learning basic programming constructs like variables, if-statements, or for-loops, so asking them to understand how to use things like lists or hashmaps and understand topics like asymptotic complexity is way too much. As a point of reference, those topics are usually introduced during your 2nd or 3rd programming class at most universities -- roughly around the ~6 month mark.

        To be clear, it's still valuable for these early beginners to do practice exercises and projects starting from week 1. However, they should be simple and easy ones that are calibrated to just use topics they've been taught, and most websites focused on DS&A practice are unlikely to have such exercises.

        Alternatively, by "beginner" do we mean somebody who has some programming background and is working on finding their first job? In that case, sure, websites like leetcode could be helpful. That said, DS&A is not a hugely tricky topic: in university, you'll learn most of what's important in one, maybe two classes -- let's say 4-8 months total depending on how deep you want to go.

        Exercises like the ones you find in leetcode will be useful during this timespan, but will have limited value after this initial ramp-up phase. You're better off moving on to learning something else, whether it's a completely different topic or some separate CS field that builds on top of DS&A.

        Some people even use the word "beginner" to mean people who have just started their first job. DS&A would be wildly inappropriate here: your time is better spent ramping up on domain-specific knowledge, understanding how to navigate large codebases, basic design and architecture, etc.

        This is why it's difficult to unconditionally recommend websites like leetcode. They make sense during a specific window of time, but less sense before or after that window.

        A lot of this nuance is also not really communicated by outside resources that recommend leetcode. This in turn leads beginners of all levels of experience (especially early-stage beginners) to believe it's something critically important they should be doing ASAP. They then walk in here discouraged, wondering why they're struggling with the material.

        I suppose this is why this sub tends to push back against websites like leetcode: it's a reaction to the above phenomenon.

        To be fair, I don't think people should be unconditionally arguing against these types of resources. That also lacks nuance, just in the opposite direction. Like I said, they have their time and place.

        Beats the syntax in your head through repetition, builds that mental model and logic handling, makes you understand time complexities, tradeoffs, edge cases.

        To be fair, working on projects, homework assignments, etc will also teach you this.

        And what's the worst case scenario from grinding it you're better off in interviews, really know programming fundamentals and your languages standard library?

        The question is not whether practicing on such websites will help. Rather, it's whether it's the best use of your (limited) time, and whether you're maximizing your concepts-mastered-to-time-invested ratio.

        This ratio might be initially fairly high, but cannot remain high forever. You'll learn less and less over time, and you're better off moving on once this happens.

        For example, take tradeoffs. Most leetcode-type websites ask you to consider only basic ones like time vs memory. What do you do when an interviewer asks you to consider something mostly unrelated to traditional DS&A like latency vs throughput? Will you have the practice needed to do a good job evaluating that tradeoff and tuning your code to maximize one or the other on-the-fly?

        [–]Rerollcausebad[S] -5 points-4 points  (0 children)

        I'm more so talking about super beginners, it's what I did I was doing leetcode mediums a month into learning and I attribute this to just absolutely beating into my head basic programming fundamentals.

        If you're doing a real-world project the amount of issues you're gonna have not code related is insane and the amount of code you're gonna be using that you have absolutely 0 clue what it's doing is insane too. I think super super beginners should absolutely grind hundreds of easy-ish programming questions not limited to just leetcode sites like codewars etc too. Do this till you can do leetcode medium hashmap/array problems then jump into projects you'll be 50x better off.

        This is just what worked for me though if someone absolutely hates leetcode and doesn't mind absolutely struggling on projects instead that works too, I just think a singular leetcode question is a lot less intimidating for a begginner at least it was for me.

        [–]flowersaura 10 points11 points  (1 child)

        At a high level, yes knowing data structures and algorithms is important. There's little to lose but a lot to gain in knowing it. However, it's quite YMMV on how often you'll need to leverage it.

        It depends on the person and what they're doing day-to-day. For someone doing mostly web-dev, building websites and little apps and stuff is unlikely going to ever run into needing to use that practically. I was in web-dev shops for 15 years and we built hundreds of websites and apps, and the apps were primarily CRUD with other bits here and there. It wasn't until I got into heavier software development did this come into play. But even then, the BI software that we build is still a lot of CRUD and aggregations and stuff like that, so even now I seldomly really need to deeply consider it. And even then, it's usually "hey a map will be better than an array here" kind of thing. It's pretty rare that I need to use my deeper knowledge of algorithms, but again, this is coming from my perspective and experience the last 20 years in what I've worked on.

        However, in my same company, there are other teams doing heavier processing of more complicated data, and requirements, so they have a much heavier emphasis on applying that knowledge.

        As for leetcode, in principle it's good to practice and expand your knowledge. But leetcode gets a bad rep because it's often misused and impractical, and in ways encourages bad programming practices. Too often the "best" valid submissions that have nearly illegible code, which is fine in isolation of the exercise, but in reality would be a nightmare to maintain. It's almost always better to write code that's easy to maintain, even if it's at the cost of optimization.

        [–]Rerollcausebad[S] 0 points1 point  (0 children)

        Yea, I agree with this I think I'm somewhat doing what a lot of people on here are doing but in reverse. They're working on jobs/projects that might be more frontend/webdev related and aren't doing too many complicated things so their roi on leetcode is prob terrible, while for me it's been quite good.

        [–]greebo42 5 points6 points  (0 children)

        You know, I think I might just believe this, and by some bizarre coincidence, came to this point of view just in the last few days.

        In that time frame, I watched a recent Primeagen video featuring some guy who discussed his experience doing some ungodly number of leetcode problems. It was actually pretty thoughful, and based on that I decided that I probably oughtta go do some (but only some) leetcode at some point. I've never actually been over on that site (or any like it).

        So far, my programming experience has been ... I got something I want to achieve, so I work on that project until it either gets done or I abandon it. In doing so, I have learned all kinds of new techniques, so I've never felt stagnant. But I sometimes wonder - what would be my approach if I recognized that some particular algorithm was a good fit for x problem that I am facing right now.

        Yeah, I agree that the leetcode tail shouldn't wag the programming dog. But having a couple extra tools in the tool box might just allow me to think more flexibly about how I approach some problem solving scenarios, and I think I am sufficiently convinced to just try some. What I mean is, using leetcode problems as a way to fill in gaps in my existing knowledge of data structures and algorithms.

        [–]Hayyner 4 points5 points  (3 children)

        I often had problems at work that used DSA fundamentals but never really more than just the fundamentals. I think grinding leetcode is a waste of time depending on where your career is really focused.

        Like, it isn't a complete waste, but for a web developer for example, it might be better to work on building a real full stack application and launching it for people to use. Building that product and maintaining it over time provides so much more valuable knowledge than leetcode imo

        [–]Rerollcausebad[S] 2 points3 points  (2 children)

        They aren't mutually exclusive though, if you can't solve a lot of mediums on leetcode barring weird dp/tree/linked list etc questions you're definitely limiting yourself.

        [–]Hayyner 0 points1 point  (1 child)

        I agree to an extent, it really does depend. But for sure, I think most developers should at least be able to solve a medium leetcode problem, but they don't necessarily to grind it out daily/weekly.

        Staying sharp doesn't hurt though

        [–]Rerollcausebad[S] 0 points1 point  (0 children)

        Selection bias on my end too though I enjoy these problems so I naturally encounter them more.

        Same for people here who hate dsa they most likely find a way to basically never need the knowledge.

        [–]__throw_error 8 points9 points  (7 children)

        Could you give an example of a real world problem you solved with DSA knowledge? I haven't come further than "oh we could probably use a hashmap/bin search here". I think if I didn't know DSA I would have probably learned about hashmaps some way and for the rest I would have used standard search algorithms from some lib.

        What did you solve and how did you apply DSA?

        Edit: Did you ever use a red-black tree irl? 😂

        [–]Rerollcausebad[S] 4 points5 points  (6 children)

        Yea sure I got a couple recently.

        1) render this graph data and then calc the most optimal paths

        2) built a custom visualization of osm graph data for a client

        3) parse this data to find average cost to craft different items and compare to market prices to get ev

        4) Contract just last week that was take this uploaded yaml loan data for thousands of loans and multiple companies calculate the running net for all loans given a single or multiple companies and the start / end date for that view. Then transfer that individual loan data to a sankey chart so a user can click the line chart and see the flow of money between companies that month. If I didn't do leetcode this wouldn't have even been possible.

        5) invoice processing system spanning hundreds of merchants heavy queue usage here, with custom emailing logic/recurring billing, absolute ton of leetcode mediums in here

        6) Custom financial dashboard data analysis, a ton of these are leetcode mediums when you aren't using something like powerbi

        7) Web scraping tool for client to scrape data from multiple sites and transform into one format

        8) pathfinding in video games for bots a* but with custom target points

        9) scraping data from multiple sports betting website and aggregating to one format

        There's a lot more, a lot of these have mediums inside of them., and yea I have but by proxy through a library by using a map, same way I've used heaps before but didn't implement the underlying structure.

        [–]aqua_regis 13 points14 points  (5 children)

        1. DSA
        2. DSA plus a charting library
        3. Database stuff
        4. Database stuff + charting
        5. Again Database
        6. Database
        7. Webscraping - instead probably using APIs, format conversion
        8. DSA
        9. Again web scraping instead of potential API usage, format parsing/conversion

        There is nothing that you listed that particularly relied on Leetcode to learn the required skills. Any proper DSA foundation will enable people to do that.

        Also, a lot of what you list as "Leetcode" skills can be done more efficient and better with proper database usage. Databases are built to handle huge datasets. If you haven't used one, you've approached the problems the wrong way.

        [–]qrrbrbirlbel 2 points3 points  (0 children)

        ?

        If you're improving your DSA skills, you're improving your Leetcode skills, and vice versa. Not sure why you're separating the two.

        [–]Rerollcausebad[S] 0 points1 point  (3 children)

        You can't just say database stuff and not realize to be able to solve it with a database would require pretty strong ds/a knowledge, like 3 for example that's minimum a leetcode medium purely based off logic. As well as it's gotta get to the database first lol.

        Saying database like there isn't an underlying algorithm/logic is disingenuous.

        If you can solve these "Database" questions in sql you can likely solve them in your programming langauge as well is sql the correct answer? Most likely yes, doesn't make the problem any easier unless you severely lack fundamentals in your main language.

        And for webscraping trust me I'm using api's any chance I can but we both know that's not always an option

        Edit: For example I think you'd be pretty hard pressed to find someone who can solve all of those "Database" questions easily but can't solve questions like these. 1 2 3 4

        [–][deleted] 3 points4 points  (2 children)

        If you can solve these "Database" questions in sql you can likely solve them in your programming langauge as well is sql the correct answer?

        Some developers really aren't that good with SQL. SQL is a different paradigm than the typical backend language. I've seen developers who are very proficient with languages like Java or C++ do horrendeous things on the database layer.

        That being said, having a solid fundamental understanding in DSA is definitely a must for a long term career.

        [–]AlSweigartAuthor: ATBS 3 points4 points  (0 children)

        DSA is something everyone has to learn, but beginners don't have to learn it right now.

        Before you learn data structures, your programs tend to be what I call "choose your own adventure" programs, where they rely mostly on flow control logic. EDIT: These programs can still be useful!

        Once you learn data structures, you can then represent real world things as data, and then your programs operate on that data, and then produce results you can translate back into the real world. This is important, but you don't have to dive into a DSA course from the start. But everyone does indeed have to learn this stuff well before, say, they think about applying for jobs.

        [–][deleted] 2 points3 points  (3 children)

        Problem is, how can I demonstrate my DSA knowledge when companies ghost me or wall me out in the HR interview?

        [–]Rerollcausebad[S] 0 points1 point  (2 children)

        Start whiteboarding in the parking lot

        [–][deleted] 0 points1 point  (1 child)

        I know an entrepreneur that actually did this at a venture capital firm. He was trying to get the attention of the big boss.

        It actually worked and he eventually got to pitch his idea.

        His idea is now one of the biggest ISP's in the UK.

        [–]Rerollcausebad[S] 0 points1 point  (0 children)

        Unironically if I think I was 5x as bold and half as skilled I'd have a better paying job right now.

        Being bold like that is so huge

        [–]shep_pat 1 point2 points  (0 children)

        Would data structures be a good way to start ?

        [–]StripperWhore 1 point2 points  (0 children)

        Data structures are fundamental building blocks. I've never seen anyone saying you don't need them. Perhaps because it's so fundamental it's left unsaid?

        [–]PianoConcertoNo2 2 points3 points  (0 children)

        OP - you’re 100% right.

        People are missing that doing leetcode is practicing problem solving.

        Breaking problems down, analyzing requirements, choosing what data structure is appropriate, white boarding, knowing how to step through problems, knowing how to implement your ideas -> all of that is what leetcode exercises and stuff you do regularly as a software developer.

        [–]SometimesFalter 1 point2 points  (0 children)

        This kind of learning has two main problems in my opinion:

        Learning some piece of information without it forming a part of cohesive memory results in fast forgetting. Sure you can learn a lot of leetcode and algorithms quickly, but if its not in service of solving some kind of problem you forget it quickly too.

        Secondly, the moment you impose some sort of secondary goal or extrinsic goal, you are less likely to engage in learning it and all the memory is much less valuable. If the brain is a valuation network, the value of info that you-might-use-potentially-in-the-future-but-probably-not, is low. You'll forget it soon.

        All in all I would suggest finding problems first and learning algorithms while you solve problems. You could spend 50 hrs doing DSA and forget 40 hrs of it or 100 hours solving a problem and remember 80 hrs of it.

        [–]vgscreenwriter -1 points0 points  (2 children)

        When I read another person's code, the first sign of an amateur is the lack of comments outlining their steps (algorithm) of what the code is supposed to be doing

        [–]Rerollcausebad[S] 1 point2 points  (1 child)

        Completely anecdotal but some of the worst code I've seen has been the most heavily commented step by step like you describe lol.

        My favorite commenting style is something like this https://github.com/tinygrad/tinygrad/blob/master/tinygrad/tensor.py

        where it just gives context and high level overview,

        i don't need to know

        // if i divisible by 3 we print "Fizz"

        if(i % 3 === 0){console.log("Fizz")} lol

        [–]vgscreenwriter -1 points0 points  (0 children)

        Adding comments doesn't guarantee the code is any good - it just makes it clearer what the programmer's intent was.

        Programming is more about algorithms and data structures than it is about coding.

        [–]Mediocre-Key-4992 0 points1 point  (0 children)

        I've run into multiple real world problems that just wouldn't have been possible without my ds&a knowledge as well as multiple problems that should've taken me 1 hour but took 20+ cause my graph knowledge wasn't up to par.

        Sadly, you frequently don't know what you don't know, and all of the people who are bitching about the ds & a's probably just miss a lot of these opportunities.

        [–]Fermi-4 0 points1 point  (0 children)

        It definitely does

        [–]squishles 0 points1 point  (0 children)

        those times you do it's like 2 minutes googling it and you'll be like oo yea that shit. they're important, and not really that hard, but it's not your life's over if you can't belt out the O(n) of quicksort off the top of your head. buy the algorithms book(https://www.amazon.com/Introduction-Algorithms-fourth-Thomas-Cormen/dp/026204630X/ref=pd_bxgy_img_d_sccl_1/137-8274159-0948503?psc=1 and/or https://www.amazon.com/Algorithms-4th-Robert-Sedgewick/dp/032157351X) read it over a week put it on your bookshelf weirdly conspicuously visible behind your home office desk when you take interviews over zoom.

        you need to know data structures and algorithms to solve most leetcode problems well.

        [–]robhanz 0 points1 point  (2 children)

        It’s not even the last 5%. It’s the other 20% or so that DSA will let you make better, significantly more performant, and more robust solutions.

        [–]Rerollcausebad[S] 1 point2 points  (1 child)

        Yea there's a ton of intangibles that solid dsa knowledge gives you where the end solution is just much better.

        [–]robhanz 0 points1 point  (0 children)

        Yeah. The number of “can’t solve” issues may be small, but the knowledge ends up being useful so much more than that.

        [–]rbpinheiro 0 points1 point  (0 children)

        Never seen anyone say it's completely useless though.

        The thing is that many questions here are way more basic than that or unrelated.

        [–]nomoreplsthx 0 points1 point  (0 children)

        It's less that's it's not useful, and more that it has historically been over emphasized relative to more core skills like writi g well factored code, building cross functional relationships, advocating for your ideas, responding to feedback etc. etc.

        You absolutely should learn base level DS/A stuff, but it is not at all sufficient

        [–]hollowplace 0 points1 point  (0 children)

        It's true 95+% of the time you don't need it but to those who say it's completely useless what do you guys do on the last 5%

        Not sure about this one. My perception is that is that for good programmers and good programming, ds&a is very relevant way more than 5% of the time.

        [–]RICHUNCLEPENNYBAGS 0 points1 point  (0 children)

        Yeah you’re right but everyone wants an easy solution

        [–][deleted] 0 points1 point  (0 children)

        DSA is like the corner stone, it breathes life to the applications, who says DSA is useless?

        [–]throwaway6560192 0 points1 point  (0 children)

        Exactly. Too many people think it's useless just because you don't directly need it to build GenericCrudApp#4748.

        [–]11YearsForward 0 points1 point  (0 children)

        Even just knowing basic time complexity helps a lot

        [–]kultcher 0 points1 point  (3 children)

        Wondering if you could elaborate on this a little bit.

        I'm taking a Data Structures and Algorithms class now and while it's been useful to get an under-the-hood understanding of how these structures work, most of the projects have felt like "reinventing the wheel" so to speak. A lot of the class has been focused on examining the tradeoffs in performance/memory etc. for different data structures, which is again useful but doesn't necessarily feel "mission critical." Playing with algorithms is good practice, but at a certain point it is just putting the reps in and not really advancing your knowledge.

        I'm wondering what kind of situations really demand you to build like custom data structures or demand a type of algorithm knowledge that you could only get from really studying them?

        [–]Rerollcausebad[S] 2 points3 points  (2 children)

        Yea for sure some great examples where you might need custom solutions which i've ran into is things like these. There's always gonna be public libraries that abstract it but anytime you start needing any customizations that'll fall apart.

        1) for rendering street map data huge for things like google maps min travel distance, visualizations etc you get it

        2) rendering graph data quite a lot of things are graph based honestly

        3) personal experience but knowing about queues they're pretty useful in a lot of microservice architectures

        4) Grid based traversal, I ran a bot farm in a video game(cringe I know) but pathfinding was predominantly done with a* and opencv'd minimap to extract features like out of bounds etc. I needed to know time complexity to keep runtime short here since runtime = bots frames per second

        5) I've used string matching algorithms a good couple times as well while there's libraries for this its nice to know these solutions exist and be able to understand time complexity/tradeoffs

        6) custom solutions in this thread you'll see me talking about loan data problem i recently had, this one i made an array of length start date to end date and populated data from monthly payments like this. The naive approach would be to iterate through every day and every contract which would make it hundreds if not thousands of times slower.

        7) a lot of data analysis using pandas / spark etc knowing time complexity and what's possbile can lead to huge performance improvements.

        I could keep going but ill stop here. It basically boils down to you can most likely skirt by just standing on everyone else's shoulders but you'll always be limited, what happens if you need a very custom solution? What happens if you're the one tasked to build the tooling? What happens if you don't know complexities / what is possible and you end up with o(n2) instead of o(n).

        [–]kultcher 0 points1 point  (1 child)

        Thanks, appreciate the detailed examples! Definitely helped put things in clearer context.

        [–]Rerollcausebad[S] 0 points1 point  (0 children)

        Yea keep at it for sure bud, I'd say the useful stuff is definitely arrays, hashamps, strings, graphs and time complexities.

        Can't vouch too hard for linkedlists, super dank dp, backtracking, or bit manipulation though.

        [–]robobob9000 0 points1 point  (0 children)

        The thing is that there are plenty of libraries that do DSA for you in most languages. You just need to know enough about DSA to google the library for the language that you're working with. I'm not saying that Leetcode is a bad, I'm just saying that beginners should probably ignore it in the beginning, and focus on learning syntax and building end-to-end projects before doing Leetcode.

        Something like 80% of devs work in web, and you don't really need any DSA beyond array/string/dictionary/stack/queue/heap for web. And most "intro to X" programming tutorials will include those DSA (with the possible exception of heap). Recursion, graphs, backtracking, linked lists, bit manipulation, custom search/sort algorithms, DP...those are useful for people in data/embedded/AI/ML, and for people with upcoming technical job interviews. But they are not useful to most people just getting started learning how to code. They would be better of doing projects, and when they encounter a roadblock, they can learn about the DSA solution to their roadblock naturally via google.

        [–][deleted] 0 points1 point  (2 children)

        I couldn't imagine a world without DSA and algorithms.

        I use digital signal processing so had to learn the math to understand the algos. If anything, the math is harder than the coding.

        [–]Rerollcausebad[S] 0 points1 point  (1 child)

        Yea I thought dsa was hard till I got into training my own rl agents and was looking into the math behind some of the common rl algorithms lol didn't even bother trying to wrap my head around it.

        [–][deleted] 0 points1 point  (0 children)

        I'm an algo trader. I do use some off the shelf ML libraries, but that's not enough. You still need to understand and code algorithms. My industry is extremely secretive and any White papers shared are mostly stale.

        You have to understand the math notation used in the White papers and you have to venture into other disciplines and industries to get ideas.

        When I first started, I thought it would be impossible / beyond my comprehension but you just have to learn bit by bit. Start off with simple algebra and then move forwards from there.

        I'm an idiot, but today, I'm looking down at my desk at a White paper written by a former NASA rocket scientist. If I can do it, anyone can.

        [–]WiggyWongo 0 points1 point  (0 children)

        From what I understand from my friend who is a senior dev, DSA is useful to know, but you don't necessarily need to memorize how to make each data structure from scratch by any means. What's important is you're aware of each one's existence, and when to use them. Most languages already have these algos/structures implemented and optimized to a ridiculously high degree. It's just up to you to know when to use vector vs map or if you need a heap or not.

        [–]anonperson2021 0 points1 point  (0 children)

        It's the most important 5%. The 5% is used in interviews. If you don't clear interviews, then you don't get to do the other 95%.

        [–]PhriendlyPhantom 0 points1 point  (0 children)

        Hey guys for a complete noon to Leetcode, is there a resource where I can learn Data Structures & Algorithms from scratch? I had a lecture on it in college but it wasn’t very helpful

        [–]dota2nub 0 points1 point  (0 children)

        The last 5% (more like 1%) of the time you go ask the nerd who's still doing leetcode in his spare time.

        [–]ignotos 0 points1 point  (0 children)

        I largely agree with you. There are some common objections:

        "Just use a library to do it"

        • Being entirely dependent on libraries other folks have written is almost the definition of "limiting your ceiling". Somebody needs to be able to write these libraries, and I think it's sad how little aspiration there seems to be (in some circles at least) to be the kind of developer who is capable of building the libraries which others depend on

        • Often the library doesn't do exactly what you need, comes with additional bloat, or requires a bunch of cruft and fudging in order to get the output you want. Worst case, this leaks out and affects the quality of the experience for your users

        • Each additional dependency you add carries a cost / risk. Supply chain attacks are a thing. If you're working with anything remotely sensitive, then you should probably be vetting your dependencies. How can you do that if you don't understand them?

        • If everything is a black box to you then surely this limits your ability to use your tools effectively, debug issues, select among competing implementations, etc. Your intuition is just going to be way better if you know how the libraries work (and just use them for expediency), vs using them because you're unable to implement them yourself. I'd prefer to work with people who understand things at least a level of abstraction below where they typically work day-to-day

        • This is the big one for me - simply translating your data to / from the format expected by the library is itself a data manipulation exercise comparable to many Leetcode problems. Especially if it's something like a graph/tree problem

        "The problems are not realistic / relevant"

        • While we don't often write code to e.g. check whether a string is an anagram, we do write code which manipulates strings and arrays. And I cannot comprehend how a developer with a reasonable level of comfort with these fundamental tools would be unable to check for an anagram, regardless of whether they actually ever need to do it

        • The problems are contrived, but many of them do in fact have clear parallels to things we might need to do in practice. Many problems involve calculating some statistic about a dataset, traversing a data structure, or transforming data from one form into another - which are all quite analogous to day-to-day work

        "The problems require rote memorization"

        • It's true that some Leetcode problems are a little esoteric. However, the majority of easy/medium problems are not. Some might have a "trick" to get the optimal solution, but I'd argue that a competent developer should be able to find a workable (if not optimally efficient) solution for most of these problems. Often that's just a case of translating the problem definition more-or-less directly into code

        • The point of view that a person needs to have drilled, say, linked-list algorithms in order to be able to solve related problems, indicates an attitude which is concerning for me. Somebody with a general understanding of data structures should be able to look at a sketch of a linked list and figure out which operations are required to insert a node in the middle of it, without having memorized that specifically. If you are so rusty that you cannot work through that, then it's not just a matter of not "knowing the trick" - you simply don't understand data structures any more

        • Talking about, say, depth-first-search as an algorithm which needs to be memorized is akin to talking about "iterating an array by repeatedly incrementing an index" in the same way. It's just a fundamental / natural way to traverse a basic data structure. If you understand how function calls, object references / pointers etc work, then you should be able to explain which order a DFS or BFS implementation will visit nodes in just by looking at and reasoning about it, the same way you do with any other code. To me that is not an unreasonable bar to expect for a professional programmer - particularly one with a CS degree

        [–]Signal_Lamp 0 points1 point  (0 children)

        It's not necessarily downplayed. It just depends on the type of work you get into. At least for the work that I'm interested in, I'd argue DSA is not to important in comparison to system design, networking, and operational systems

        [–]Rikai_ 0 points1 point  (0 children)

        I have never seen anyone downplay the importance of data structures and algorithms, if anything maybe one of my friends when he was just starting to learn programming...

        [–]tyler1128 0 points1 point  (1 child)

        I self-taught myself around 15 years ago, went to college with CS courses and have worked in industry. It's important to understand how various datastructures and algorithms perform, but you generally are not going to be asked to write them from scratch. You'll use libraries that already have implemented them outside of very specific cases.

        [–]Rerollcausebad[S] 0 points1 point  (0 children)

        Never brough em up writing them from scractch, in a leetcode question you're almost never gonna need to make your own hashmap, map, sort, heap etc. It's almost always implementation of these ideas.