Leetcode - The Path to Enlightenment

Поділитися
Вставка
  • Опубліковано 21 гру 2024

КОМЕНТАРІ • 124

  • @matteostara
    @matteostara Рік тому +394

    Every learning process is twofold: memorizing the routine while understanding the concepts. You know it's .includes() or .toString() because you memorize them; you can use them correctly, because you get the concept.
    Memorizing for the sake of repeating can be counterproductive, but memorizing the repetitive patterns of complex concepts it's the only way to boost your confidence and knowledge to the next level, removing the unnecessary friction, giving space to more complex cognitive processes.

    • @JayShah910
      @JayShah910 Рік тому +1

      well said and very true

    • @unknownman1
      @unknownman1 Рік тому +2

      Yep, if you know how to do the 3sum problem, you can easily do the 3-sum closest problem. Vice-versa may not be true.

    • @7days280
      @7days280 Рік тому +2

      Got it.

    • @MultiversalGoat
      @MultiversalGoat Рік тому

      Yes, like memorizing math symbols and functions in math

  • @apschhokar
    @apschhokar Рік тому +166

    Bro you just nailed it. I take practice mock interview just to keep up with the trend. That's what the interviewer pointed out to me. Anybody can solve DFS who has experience in any coding language. But it's about capturing edge cases yourself and then covering it. Followed by optimization. The bar thesedays is really high.

    • @TheStickofWar
      @TheStickofWar Рік тому +29

      I promise you the jobs you want are not like this, I’m a senior engineer who cares about this kind of stuff personally. But it is not something I focus on when interviewing someone, ensuring the person is friendly, takes time to write tests, ensures their code is robust and has strong logic skills whilst being able to talk to technical and non technical people is really what gets you the job. Engineering as a career is a lot about communication with others, more so than any leetcoder wants you to think.

  • @kevincollazos9514
    @kevincollazos9514 Рік тому +65

    You've been a tremendous help in my programming journey. so far i've completed 130 out of the neetcode 150. It is clear now that before I get caught up in trying to memorize/solve these last 20 hard problems efficiently I need to take a step back and hit the easy questions until I can do them where the solution just comes naturally within a relatively short amount of time. Thank you for the enlightenment

  • @AnkitaNallana
    @AnkitaNallana 4 місяці тому +4

    He's right. Now I can solve backtracking problems and I'm like ...BRING IT ON I'M NO LONGER AFRAID. And, I recently faced an interview question where I derived a binary search for the solution and frankly, when that bulb lit up, it really really feels like enlightenment

  • @MyMattinthehat
    @MyMattinthehat Рік тому +10

    Explaining code was something I learned the hard way in undergrad. We had a large study group in one class and long story short a lot of ppl just copied my code thinking that changing a few variables was going to work. Well we got flagged for plagiarism and what was an easy A for me became a C but I talked with the professor and said let us each explain the code to show if we really know it. Since I wrote my code, trial and error and all, I was able to explain my code and even justify why I used a vector operation here vs some long drawn out process (that of which the professor showed me early on in the semester) and almost everyone else just took the L. I got my A and the professor decided not to escalate the plagiarism against the other students.
    I know that’s a block of text but being able to know what happens like the video says is so important. It’s a perfect interview question since you’ll be reading code base while onboarding anyway

  • @mistersir3185
    @mistersir3185 Рік тому +63

    I watched this while I was high and dude is right about enlightenment. Coding itself is an art. It's spiritual. It requires a different kind of mind. The kind of mind that's capable of turning ideas into reality and bring about real tangible products. Instead of just writing codes, actually be mindful and type it out like you're writing an essay on Word. This video inspired me to actually understand my own program and the code that makes it work. If you can fall in love with that, consider yourself enlightened.

    • @nagasaipurvaz4251
      @nagasaipurvaz4251 Рік тому

      i was high , when i was 20 i made betting app which let you bet on the number of people search certain term on google which made me 4 lakhs rupees but got taken down because it was not applicable for google terms and services

    • @jagi7976
      @jagi7976 Рік тому +17

      Pass the j bro

    • @mistersir3185
      @mistersir3185 Рік тому +2

      @@jagi7976 lmao I would love to bro. Get you one and try to learn something about coding or watch a podcast. You will soak in so much info I swear

    • @scrung
      @scrung Рік тому +1

      i wouldn't necessarily say it requires a different kind of mind. anyone can code if they feel like it, but maybe that 'feeling like it' requires you to be a certain kind of person. this could be said about anything though

    • @bennymountain1
      @bennymountain1 Рік тому +1

      This video also made me want to understand my own program, bc _I have no idea what I'm doing_

  • @YouTube_Staff
    @YouTube_Staff Рік тому +36

    Yes, after 6-700+ questions I have gotten to the point where I can breeze past the first 2 questions in a contest within 10 minutes but most of the time still can't get past the 4th/hard question. Sometimes it's still difficult to spot the pattern or know how to optimize it.

  • @tiger7858
    @tiger7858 Рік тому +55

    All the thumbnails on this channel are on another level, I am always forced to click on your videos. This is the best channel on UA-cam. Thanks for teaching me for free.

  • @Yo-sb9st
    @Yo-sb9st Рік тому +4

    I just want you to know that I tell all my friends who ask me how I got good at leet code about your channel. YOU are the goat, love u man.

  • @pallopbunnak9103
    @pallopbunnak9103 4 місяці тому +1

    You are the best teacher, my man. I need this kind of explanation and guideline all along after watch a couple of adjusting the mindset videos, much love from Thailand 🇹🇭

  • @IndellableHatesHandles
    @IndellableHatesHandles 10 днів тому

    He's right. I solved 1000 Leetcode problems and now I am a master at using every language and API. Any interviewer can ask any question and I can immediately think of it, and it's _only_ because of those Leetcode problems I did.
    Said no-one ever

  • @imb-alan-ced
    @imb-alan-ced Рік тому +14

    Totally agree with this. At first you are at a point where you know it's a for loop and you just implement the for loop, then you get to a point where you know it's a sliding window and you just implement a sliding window.
    Once these patterns have become second nature to implement, you should then understand them enough to know how to tweak/combine them just right to solve your problem.

  • @tlz124
    @tlz124 Рік тому +6

    Once i understood loops, i couldn't believe there was a point that i struggled with them. I learned them in Python and then they made sense in every other language

    • @soltomoon3620
      @soltomoon3620 Рік тому +1

      This ^^^^ I used to struggle so hard on my first ever programming assignments in my intro to programming course in python. Once I understand a for loop it’s like I unlocked the next level.

    • @tlz124
      @tlz124 Рік тому

      @@soltomoon3620 What was the next level you passed (I'm still searching)?

    • @soltomoon3620
      @soltomoon3620 Рік тому

      @@tlz124like you said of understanding loops, you understand in any language and it becomes second nature then you move on to understanding recursion.

  • @obnotikusk2936
    @obnotikusk2936 Рік тому +12

    I've recently realized this in my own studies - I've found an effective learning process for me is to first brute force memorize the solution and literally repeatedly type out the code until I can type it from memory. This in turn reduces the cognitive load of implementation and let's me think about and understand the actual solution.

  • @parlor3115
    @parlor3115 Рік тому +2

    For me, writing functions with the correct input and output (takes experience to get them right the first time), and leaving the body for later while still calling them in other parts helped me immensely with what otherwise be convoluted problems and especially code hygiene. And with ChatGPT, you can get most of the body written for you. You just have to unit test it and adjust the variable names and so on.

  • @Suspiciousguy124
    @Suspiciousguy124 Рік тому +7

    Do you suggest spaced repetition for all the problems we do? Spaced repetition(definition) - Spaced repetition is a method of reviewing material at systematic intervals. At the beginning of the learning process, the intervals are spaced closely together (for example, one hour; four hours, or one day). As the material is reviewed, the intervals become systematically longer (four days, one week; two weeks).

  • @mxwelljt
    @mxwelljt Рік тому +163

    but can you write out a segment tree without thinking about it?

    • @soumya6561
      @soumya6561 Рік тому +2

      Segment tree isn't hard tho

    • @mikelan9854
      @mikelan9854 Рік тому +34

      ​@@soumya6561nothing is DSA is hard if u have ample amount of time.

    • @dakshsingh5891
      @dakshsingh5891 Рік тому +3

      ​@@mikelan9854I agree, everything can be done at own pace. But we just don't have enough time.

    • @harrychen3523
      @harrychen3523 Рік тому +4

      Try balance a red and black tree without thinking about it

    • @BrownSloth0
      @BrownSloth0 Рік тому

      Can you write a quadtree spatial partitional data structure without thinking? My life's biggest flex is my own game engine.

  • @Tyler_Frenzy
    @Tyler_Frenzy Рік тому +6

    It's just reflexive action. It's so quick and effortless because you don't need to conciously think about it, instead your subconcious just calculates the most optimal sequence/play/whatever you wanna call it very quickly since concious thought slows things down a lot. Like you say, this can be easily achieved if one works on the basics, but most people are frankly too stupid to realize that they get their gains from doing things they can do rather than jumping into "complicated" things, which to them seem astounding and super high-level, since why wouldn't you be solving high-level problems if you wanna be high-level, right ? They fail to grasp that this "complicated" stuff is in reality just a lot of basic things stacked on top of one another, which then makes them that much worse since they are already trying the equivalent of juggling 3 balls when they can't even properly handle 1. A lot of people simply lack patience to milk the levels they find themselves in before adjusting their challenges to be a little harder.

  • @suvraneelsaha7857
    @suvraneelsaha7857 Рік тому +6

    repitation creates memorization and conceptual understanding comes from learning and understanding what's is done in those repitative drills , great video mate

  • @supinVerse
    @supinVerse Рік тому +4

    Practice makes perfect . Simple Basic but most important !

  • @andrewtitus6839
    @andrewtitus6839 9 місяців тому +1

    It will be a slow process at first, because to have deep understanding of what every line of code does takes time, but as you learn those concepts and they start to become second nature, you will get faster and faster.

  • @IsaacC20
    @IsaacC20 Рік тому

    It's not so simple for the simple fact that you don't know what you don't know. For example @2:08, if you weren't told that *nums* can potentially contain close to INT_MAX number of elements, line 6 can potentially fail that test case.
    In addition to knowing the typical implementation for an algo/ds, you have to be able to analyze and suggest changes to typical implementation (e.g., in binary search, there are two ways to compute Mid pointer). You also have to be able to analyze the code you've written against different cases to check for bugs (e.g., why your code might be buggy if you accidentally wrote "left < right" instead of "left

    • @IsaacC20
      @IsaacC20 Рік тому

      If you're struggling with language syntax, or struggling to understand the basic implementation -- it just makes it that much harder to think about them in the abstract. For example, if you had trouble knowing what English words meant, it'd be near impossible for you to understand the ideas, emotions, and drama in a Shakespeare play.

  • @devkumar9889
    @devkumar9889 Рік тому +3

    The fact is 100% correct that there is element of memorization everywhere

  • @aadil4236
    @aadil4236 Рік тому +3

    The thumbnail was good!

  • @floriankubiak7313
    @floriankubiak7313 Місяць тому

    These "basic questions" tend to be the hardest. I wouldn't think of "out-of-bounds-error", but what actually happens on OS and memory level. Then I get confused/overwhelmed and don't know how to answer xD

  • @ps-dn7ce
    @ps-dn7ce Рік тому +1

    Man, I agree 100% with this advice.

  • @samirpandit8899
    @samirpandit8899 Рік тому +1

    This is facts. I aspire to understand this shit like it’s my native language.

  • @playboycity
    @playboycity Рік тому

    I think this is all good advice apart from doing the same question or type of basic question day after day, all the learning research for the last 20 years has shown that interleaving is more effective for learning and retaining information over a long period of time

  • @curesnow6493
    @curesnow6493 Рік тому +1

    I need this kind of video.
    Thank you Neetcode

  • @ssuriset
    @ssuriset 6 місяців тому

    @NeetCodeIO I am planning to do the thing you said about repeating the basic stuff, but how do I find it's list? Should we do the Blind-75? Like should we get really really good at the blind 75 so that doing them would be like coding a for loop? And I agree with you because this is legit how brain works. I hope everyone realises this. Well, in medicine, everyone is different while common things are still common, but this is true. So, you said the Binary Search, Two Pointers, Depth First Search, and what else you said? I would like to know this list pleaseeeee.

  • @BlackHermit
    @BlackHermit Рік тому +1

    I will eternally become enlightened. 🙏

  • @SmoothCode
    @SmoothCode Рік тому

    Intuition is everything. If you dont have the intuition - you are not good enough yet.

  • @rockosmodernlife2984
    @rockosmodernlife2984 Рік тому +1

    never once had to write an algo like this in 3 years fte

  • @jiazhechen
    @jiazhechen Рік тому

    Wow I never know you could do out of range check like this. Thank you for the tip :D

  • @polycoder
    @polycoder 9 місяців тому

    thank you man,this is helpful. I take notes from your video.

  • @S3aw0lf
    @S3aw0lf Рік тому +1

    This is such a needed topic to discuss on. Thanx for the video❤

  • @sanketkumar_coder
    @sanketkumar_coder Рік тому

    I dont know how dfs works but if you remove those linese then it will not check the condition, probably like indexOutOfBound

  • @mikeorioles
    @mikeorioles 4 місяці тому

    Awesome video - love this!

  • @Andruarte-qq6fo
    @Andruarte-qq6fo Рік тому

    Nice video, understand what is written is very important regardless this difficulty involved in the concept. A physician, for example, don't expend time memorizing formulas, instead he/she understands the concepts that can lead to a formula

  • @Splend9
    @Splend9 5 місяців тому

    You are my hero!

  • @MylesTheGreat
    @MylesTheGreat Рік тому

    i can do this for tetris. one day maybe ill get to the same point with coding

  • @Rahul_1.618
    @Rahul_1.618 Рік тому

    What exactly are these basics, though? Does anyone have a comprehensive list of things that count as "basics" to get REALLY good at?

  • @paevents8064
    @paevents8064 4 місяці тому

    Looking forward to enter the level of enlightment

  • @atharvpal7038
    @atharvpal7038 Рік тому

    Great video dude. It's indeed a good take on learning and practicing DSA

  • @nang88
    @nang88 Рік тому

    fax

  • @dramdan1
    @dramdan1 4 місяці тому

    I like this advice. This bullshit about "just understand the concepts you don't need to memorize" in just wrong for 99.999999% of people.

  • @grandparick3176
    @grandparick3176 Рік тому +2

    I wish to become that wizard one day.

  • @debajyotimajumder472
    @debajyotimajumder472 Рік тому

    Dudddeeeeee!!! I was confused on the same. Thanks for the same!

  • @joseortiz_io
    @joseortiz_io Рік тому

    Damn you got this spot on. 👏

  • @shuvbhowmickbestin
    @shuvbhowmickbestin Рік тому

    strangely, not sure about the binary search but writing out mergesort and quicksort feels like writing a for loop for me at this point.

  • @jsoto3gaming
    @jsoto3gaming Рік тому

    Hey man. Im trying to change my career to be a software engineer. I started my journey learning python. Now, I am spending my time with javascript for web development so I can build my portfolio. I love python but I dont think I could get an entry job writing code in python.
    My question is: Do you think I should do leetcode problems in python and keep learning javascript and react for portfolio projects?
    I have a degree in Electrical Engineering but never worked as an engineer. Not going back to school for CS though. I am learning online.

    • @bcpr
      @bcpr Рік тому

      If you’re going into web dev, stick with js

  • @harshitsinghai1395
    @harshitsinghai1395 Рік тому

    thanks for teaching for free.

  • @nagasaipurvaz4251
    @nagasaipurvaz4251 Рік тому

    i became god when i first time wrote trie word search algorithm with out lookin at code , in heaven and on earth i alone am honored

  • @srijanraghavula
    @srijanraghavula 4 місяці тому

    Is it possible to achieve such enlightement before 30?

  • @Sudhanvapops
    @Sudhanvapops Рік тому +1

    HI sir i am really exited the way you teach just went to your website for buying the course of dsa and saw that it was in dollars can you consider my request for changing the price of corses in rupees in your course a little less maybe in your website 🙏🙏 btw big fan of yours

  • @dylanmrocks
    @dylanmrocks Рік тому

    This is good stuff

  • @darshantawte7435
    @darshantawte7435 Рік тому

    I personally thing the difficulty nowadays is extremely high as compared to 3-4 yrs ago for even a fresher SDE at any company, Something which even i have experienced. With the advent of AI its becoming more and more difficult to be good at this. Earlier it was easy to get your resume shortlisted with good profile in DSA and some projects on your resume. Skillset companies demand nowadays even for people with 0-2 yrs of exp is ridiculous. I mean i have been skimming thorough linkedin now for 1-2 weeks and in >70% of cases i have observed companies even for Entry level positions wanting 3-5 yrs of exp (I mean WTF). Which makes me think tech jobs are no more lucrative , unless and until you don't love the grind and your work don't come in. What the point of spending hours doing DSA and projects , when at the end of the day company can just discard you to maximize profits.

  • @TheBackendDeveloper-b6t
    @TheBackendDeveloper-b6t Рік тому

    Subarrays Distinct Element Sum of Squares II ....Can you do next video on this question . Please do this one .

  • @gnes04
    @gnes04 Рік тому

    I think I'm at this point where the basic algorithms are easy and code/syntax doesn't hold me back; but I still struggle to grasp the logic of a lot of medium level problems

  • @audioplatform6299
    @audioplatform6299 Рік тому

    Is for loop that easy?

  • @Joshuahendrix
    @Joshuahendrix Рік тому

    Enlightenment for me was when I could build a million dollar product without using stackoverflow

  • @chowtuk
    @chowtuk Рік тому

    yeah, when I solved enough dp question, I have the 2d grid in my brain and show how the grid filled

  • @aadityakiran_s
    @aadityakiran_s Рік тому

    People you've interviewed at Google can't tell you what would happen if you removed the lines that checked for within bounds in a DFS for a 2D matrix? Very hard to believe.

  • @anubhav8366
    @anubhav8366 Рік тому

    Amazing thumbnail

  • @sourabh_mandlik
    @sourabh_mandlik Рік тому

    But can you code in assembly

  • @mattf9076
    @mattf9076 Рік тому +1

    Waiting for the day when you are asked how many wpm you can type during an interview

  • @capybleppa47
    @capybleppa47 Рік тому +1

    you are that fcking guy who interviews people on algorithms they never gonna use in writing your e-commerce problem's solution. Perfect way to show a big ass redflag to your interviewee from the start

  • @riteshhhhh_01
    @riteshhhhh_01 11 місяців тому

    The comment section have the more knowledge than the whole video 😂

  • @sunsiyue618
    @sunsiyue618 Рік тому +1

    well fucking said

  • @mk17173n
    @mk17173n 10 місяців тому

    The question shouldnt be on how we should be doing Leetcode but why its necessary. Just because FANG companies decided to create these ridicioulous standards for acceptance now all companies do. The same companies that made billions and now are laying off thousands. If you want to study something like software engineering you should do it because you have a passion for it. Doing depth first search and memorizing leetcode questions doesnt make you a good developer. People act like there werent any real developers before this became an industry standard.

  • @ollicron7397
    @ollicron7397 Рік тому +1

    I think even if you get good at this, employers are still not going to bother hiring you. The competition is too fierce, if everyone is good then you're no longer unique and now have to fight hundreds of people in line in front of you. All you're doing is helping the company in the end, not really helping yourself.
    It's gotten so sad that you have people practicing mock interviews in the industry just to get a job because these corporate shlobs think you can't do the job. They begin to make you think you can't do the job, when in fact you can. A lot of practices in the realm of programming are highly unethical, and you should be careful about how much time in your life you spend in these companies as that's what they will steal from you in exchange for cash.

  • @sarthaknirgude
    @sarthaknirgude Рік тому

    1:08 i will

  • @aaaabb1666
    @aaaabb1666 Рік тому

    This is based AF

  • @xXHotaroXx
    @xXHotaroXx Місяць тому

    Its the same as doing math in school eithout knowing your timetables 🤦
    Leetcode easy problems = timetables.

  • @ParulShrivastava-k9w
    @ParulShrivastava-k9w 4 місяці тому

    Why did that end so abruptly

  • @Bobab0y
    @Bobab0y Рік тому

    Nope not there 😂 started studying last week

  • @Manhunternew
    @Manhunternew Рік тому

    Remember when you were a child and then just learned to walk? I know what you are trying to say, but I don't understand the world enlightenment. I would use a different word, it's called insight. Insight is what you get after studying/practicing something for a while. You can suddenly see deeper, understand better. The more insight you gain, the more sense everything makes. Insight is that moment when it clicks and you successfully understood something. This insight will make you able to see better. You suddenly gain a higher view, one that was hidden from you before. This higher view is what you meant with enlightenment, but that's not accurate IMO. I would use enlightenment for the sudden realization of reality as it is. Also I have a view that is even beyond your view

  • @davidvalle3068
    @davidvalle3068 6 місяців тому

    Im still trying to figure out two sum

  • @dubey1akash
    @dubey1akash Рік тому +1

    you are so positive to making this problem solving easier for everyone thku

  • @joereeve2569
    @joereeve2569 Рік тому

    Anyone else know two sum by heart now?😂

  • @simonr-vp4if
    @simonr-vp4if 11 місяців тому

    Hqhqhq qmqgine not just knowing where the A key is.

  • @qemmm11
    @qemmm11 Рік тому

    It looks like binary search code of Python language (Class+function)😊

  • @mrgyani
    @mrgyani Рік тому +1

    What's the point in the age of AI & ChatGPT? All this is going to be pointless, and written by AI soon..

  • @kerimalpalt
    @kerimalpalt Рік тому

    Yeah its gonna take 0.1 secs for chatgpt

  • @drakata27
    @drakata27 Рік тому

    To be honest I have to say

  • @IAmIndraTheGod
    @IAmIndraTheGod Рік тому

    Dude

  • @jwsw
    @jwsw Рік тому

    Next time just for fun you should pause and comment on this video

  • @cccc2740
    @cccc2740 Рік тому

    Stop doing all this dsa...ai is gonna take over all work

  • @RyuuOujiXS
    @RyuuOujiXS Рік тому +4

    This is so wrong. He thinks he's becoming skillful at coding when the reality is that he's just memorizing the function structure and spitting out a copy. Yes, it takes less cognitive energy, but it's not making you better at anything other than pasting. It means your mind only sees the function in 1 way and you have a natural limitation of expanding on the concept.

    • @tusharkumarraj6066
      @tusharkumarraj6066 8 місяців тому +7

      That's what learning is about, we are actually memorising alot more than we think. You need to get familiar to stuff and tbh getting familiar is memorisation. I learned this too late.

    • @nullplusplus6595
      @nullplusplus6595 2 місяці тому +3

      Disagree: he's learning by rote so he doesn't have to think about those details any more. It is the same reason we learn multiplication tables in school. It allows us to chunk bigger things in our short term memory so we can work on more complex problems.