My Notes: 1. Leetcode is hard, even for this guy. 2. Repetition is the key, really practice and keep repeating. 3. Internalize the fundamental algorithms(like bs, bfs, dfs, etc) so you have more brain capacity to analyze hard problems 4. Be creative and think hard on creative solutions/test cases 5. Even smart ppl won't get great at leetcode without practicing. That is such a relief to me knowing that I'm not the only poor kid struggle with leetcode to get a job in this market, thank you for the vid!
Summary: 1) Start with basics and Easy Questions. 2) Repetition is a key. 3) Get good with the algorithms first such as Binary Search, Sliding Window et cetera by doing it again and again and then apply it to the questions. 4) Ask Why while solving the questions - Why this approach or why this solution ? 5) Make notes or give comments.
Practice is the only thing that can make you pro at anything. Giving bare minimum can make you pass college exam, but not real life exam such as Interview.
Leetcode is about memorizing how to start a problem but not memorizing the lines of code. And just learning data structures and algorithms is not everything. EDIT: also know helpful builtin methods
@@zikorajoe7093understanding the problem first, and how to implement the corresponding algorithm/data structure for that specific case. If I give you a problem x and tell you that it can be solved with a basic hashmap You could know all the functions and characteristics that a hashmap has, but if you do not understand the problem and do not know how to use the tools that a hashmap offers you for that problem, you will never be able to solve it. You need to think.
@@zikorajoe7093i’m not that great with DSA (yet!) but I think it’s just a matter of being able to think of the problem at hand, figuring out what logic would be most appropriate for the problem, like recursion or loops or whatever, and going from there, implementing the algorithm that makes the most sense (or what may make the most sense to you at that point in time and doing it that way until over time, you become aware of better solutions)
Repetition is a powerful tool for mastery. You build a solid foundation by repeatedly implementing core algorithms-such as binary search, DFS (Depth-First Search), BFS (Breadth-First Search), and sliding window.
I'll ask more specifically. There are two tasks: "11. Container With Most Water" and "42. Trapping Rain Water". Having found out the solution the first problem, I was able to reproduce it 7 months later in 40 minutes (alas, I'm slow on the uptake). Having learned the solution to the second problem, I will not be able to reproduce it, because it is not obvious to me. Unfortunately, I don’t know how to convince the brain to understand what it can’t come up with.
@@UserSo4reUsu75ry try like understanding how the algorithm works completely then do it again going in blind is fine but like algorithms are not something you can learn with just the solutions or the videos solutions in leetcode u gotta search it up and understanding it via youtube, google, github copilot(recently my friend recommended this i havent tried but it is apparently better than chatgpt) just keep looking for information until you fully understand how to apply it
leetcode is worthless. you learn 10x faster by just making projects that utilize these algorithms than mindlessly grinding them like a monkey at the circus.
@@egg-mv7ef a projects does help but leetcode just help your problem solving skill imo idk ever since I tried leetcode I can definitely see the difference it is good for people who don't have super good problem solving skill to develop a more clear process of thinking when coding
I was lying on my bed and got up to leave a comment here, my laptop was on my desk... You literally transformed my developer life, in a perfect way. I started my career as a web developer 3 years ago. After three months, I took a new React project, since then, I have been working as a Frontend developer. Last year, I moved abroad and started to seek opportunities abroad. In my country, I already had my job and had network, I didn't worry that much to get a position, more like how much I could get or what company I worked for. One year ago, I started to apply for jobs and I got rejected by all companies I applied - Language may've been the biggest problem though as I started to talk in English since last year. I didn't want to miss opportunities if I got. I tried to solve leetcode several times but I didn't find any interest in it. Actually, I was the person thinking code test is not practical to apply real projects and maybe a waste of time. As a frontend developer, I may've focused on frontend technologies, builders, cloud platforms and stuff like that or better to study DS, and someday, your video came out on my youtube list. Thanks to the algorithm. I actually saw some of your videos early last year but I couldn't understand at all due to my Enlgish proficiency, and last Winter, when your video came out on mylist, I clicked it and I was able to understand a bit and watched your videos. It was an absolutely amazing moment. Your explanation was SO easy, after watching your videos, every problem felt easy to be solved. At around that time, there was a company I was supposed to join but the company asked me to withdraw the contract a couple of weeks before starting to work, they said budget problems but I don't think so. After that, I had to go back to my country, but I really didn't want to GIVE UP. On the first day, I came back to my country, I started to solve Top 150 problems with your videos. As I remember, I couldn't solve most of problems without your help. And at some point, I started to solve some problems by myself and I noticed changes inside me. I started to think first, and come up with some solutions. Like you said, sliding windows, dfs, bfs, some other stuff, while solving problems, I got used to those concepts. I don't need to think about how to implement those stuff. I could just use it as my tool. It's not about memorizing solutions. It's about how to define a problem, how to see a problem and how to apply knowledge I have to solve the problem. It's all about thinking. I also noticed that I apply the same way to solve leetcode problems, when I create UI components in React, write logics and approach errors. I'm still not goot at leetcode and still need to improve A LOT, I know but I felt the positive changes and now I know if I do it, I could do better as time goes, as I put more effort on it. Thank you very much. I'm still looking for a job now but it does not matter, I just do code, I like it and I like those changes. Once again, thank you very much for sharing your experience, knowledge and thought with us. Good night 👍
This is really inspiring but please use paragraphs; a wall of text is really difficult to take in... Other than that, it's really nice that you feel more confident in your abilities now, and I hope you soon land a job where you can thrive and be happy.
@@aiSage48 Oh, man. I didn't know this looks this mess. Something clicked in my head, and I just wrote everything I wanted to say and went to bed. Thanks for the comment and supportive words!
Having a good knowledge about stacks and queues will give you an edge on dfs and bfs, respectively. Recursion is a good thing to know, too. The problem is that some people jumping the gun, when they haven't grasped the underlying concept of dfs, and bfs? It's like how you know 456 if you don't know 1,2,3
this ^^ i was going in blind and i totally wasted my time had to go and start from hashmap, sliding windows.... realise i was going in without even understanding how to apply or how the solution works 💀wasted a lot of time
Leetcode is like going to the gym. If you hit the gym only a few times a year, you aren't going to make any gains. If you do a workout just once, then it's weeks before you do that workout again, you'll be right back where you started. You have to do it consistently and repeat the same types of problems over and over to make gains.
Same. I did pre-med. Now in CS. Leetcode def made pre-med seem like a breeze. Programming requires mathematical creativity. Thanks for this video, sir.
Leetcode is only "imporant" because some bigTech companies use it as a first screening tool. It only addresses a very tiny bit of what a software developer really need to be able to do. Most important are : 1) Be able to write readable/maintainable code. 2) Write unit testable code. 3) Do not optimize prematurely. 4) Be able to work in a team. In fact I would probably not hire most competitive coders, they learned a very low quality of coding and much of that kind of code wouldn't pass any decent codereview. So dear developers out there, being able to solve leetcode puzzles is only one (little) tool in your toolbox :)
Leetcode sums up everything u learned in a CS degree all in one assuming u know the syntax: How to think, the trade offs, then the actual programming part
how to think is a big factor when solving the problems ngl like i used to think super complex ideas realising it wont work the idea is to be familiarized with the code and how to manipulate before you try to fix a problem without proper understanding it is like trying to say something in broken english which u can understand but others wont understand
I’m a senior Dev but don’t want to be complacent. Want to keep grinding and will hopefully get into big tech soon. Your video showed up on my feed; will start my Leetcode journey again.
Just don't. Leetcode will NOT teach you any of the real important software engineering skills : Writing readable, maintainable, and unit testable code. Competitive coding should not even be called that... it is only about training problem solving skills (and not much of it really relates to things you will do in your software development career)
@@peregrin71 it does improve like the way u think when coding thou so maybe more efficient? since you have to pay attention to time complexity, algorithms and so on
@@peregrin71 Most corporate Code is just glueing things together, he is already a Senior Dev yet you are advising him to learn "real" important SWE Skills. Hilarious
Thank you for this video. I always keep this Bruce Lee quote close to my heart: "I fear not the man who has practiced 10,000 kicks once, but I fear the man who has practiced one kick 10,000 times." It's been a tough few months after layoff with job search and leetcode grinds on top of taking care of the family. But videos like yours keep reminding me to continue the grind and better prepare myself for the challenges ahead.
Algorithms and data structures, as required in technical interviews and as present in LeetCode, are the subject matter of master’s programs in computer science. Everything beyond a simple binary search is, indeed, not an easy topic at all; it is a very academic topic. What makes it even harder is the fact that the average software engineer, most often than not, has never even opened calculus (e.g., Stewart or Spivak) and algorithms (e.g., Cormen or Skiena) textbooks; it’s only natural that all those algorithms feel alien to someone seeing algorithms for the first time.
uh bro its not masters, if you want an internship within your first 2 years you need system design, leetcode mediums, and real work projects that arent basic projects. you're supposed to do calculus>discrete math>computer arch so you know how binary works on a motherboard before python. if you dont youre not an engineer at all youre a struggling self proclaimed coder theres a lot more to explain to become a full stack scalable dev that can design and lead sdlc and preferably have a few monetizable niches by year 4 but your comment is a big yikes
The coding assessment don't test you algo knowledge but primarily if you can practice and recall from memory when you need to apply algorithms. I come from a non-cs background but even i knew lot of ds and algos but i never faced any hard complicated puzzle that require more than 1 algorithm to solve until about mid-2010's. Once an interviewer asked me a fib series with memoization that allowed me to get past the first round. These days interviews specifically ask hard type problems to weed as many candidates as possible, it is not you but the market. And interviewers are also very impatient and hard to handle these days, if you make a tiny mistake your whole work experience will questioned. It is pathetic.
@@WoWUndad I got my first internship through networking at my CS club and applying my skills to 2 projects, the technical interview was simple and they spent more time asking me about my projects and walking through my though process and challenges. Humble yourself, your attitude is common amongst a certain type of CS student that always translate to a negative person to work with when you enter the workforce. You still have time to correct this as I'm assuming your still in college
@@WoWUndad Aren't you proving what he said? You said someone needs calculus in order to do well, that's exactly what he said. You said someone needs a rigorous academic background in order to do well, that's also what he said. You're literally repeating the same thing in different words and then saying his comment was "a big yikes". I don't get you at all
I'd recommend starting with Exercism, as the problems are much more manageable and you'll learn your language and problem-solving skills in a step-by-step manner. Personally, I followed this approach and had never attempted LeetCode before watching this video. Yet, I was able to solve the median array problem in just 20 minutes. I think this is a great way to develop your problem-solving skills.
I feel the struggle. Monotonic stacks are especially tricky, in particular some problems on leetcode. It does get better over time, but even after doing like 30 problems I'm still not fully comfortable with them. Similar to DP in that regard.
Subtle thing to add here. 1. Master your language and then master how to use it in a Leetcode environment. There are many functions and things you would never write in production code but if speed is required, you better now how to initialize a 2D matrix with -1's, or maybe a set. How to join arrays of arrays. Neetcode is correct anytime you lose time on the "basics", it will be distracting and will take away time from solving the edge case or deriving the unique trick in that problem. 2. This is job security, especially in this market. Until the industry does not use this as some type of IQ test, keep yourself up to date. Try to do 2 a week AFTER you get a job. That comes out to about 104 questions a year. This is one of the biggest things I see people not do, so they end up restarting and feeling hopeless again because they stop practicing.
Algebraic geometry is intuitive once you study prerequisite mathematics enough. No amount of fundamental data structures and algorithms prepares you for the type of mind bending solution path that leetcode sends you down 😂
16:22 examples! yes! one of my high school teachers (science? maths?) taught me to always test what you're doing with seven samples: the min and max "correct" values, the "middle" (or expected) value, values that are halfway between the middle and min/max, and finally values that are a little past the min and a little past the max (outside the "correct" range). this advice has helped me immensely over the years with many many things, even in daily life. for example: if i'm lerping an input value between two target values 50 and 125, i'd estimate (guessing *at a glance* without calculating) that the values would be 45, 50, 70, 90, 110, 125, 130 to ensure everything is working correctly, i'd input 0.0, 0.5, 1.0 etc and see if the outputs are as expected. if i see a 200, a 0, or a -50 show up, i instantly know something went very very wrong with the input or how it is processed.
Your points does makes sense. I tried Leetcode many times and gave up eventually, maybe in future I will try again keeping these things in mind. Nice content.
starting looking into discrete math and algorithms really helps a ton and make sure u know python concepts up to OOP u should be good to try leetcode again should be faster in thinking up the ideas also try like doing more brain stimulating activities keep thinking i realise this makes a huge difference in how you think like just try looking for mistakes in other people's code etc. keep it running
@@Anonymous-ri4mk leetcode is worthless. you learn 10x faster by just making projects that utilize these algorithms than mindlessly grinding them like a monkey at the circus.
The older i get the more I realise that this really is the approach you need to life. I practice guitar everyday in order to improve and yet I failed to see how the same concept applies to pretty much anything you want to get good at. Thanks for the wake up call :)
This is something that I have concluded too. I have been doing LC on and off since the last few years, but I took a concept and did a lot of questions about it. Now I feel I have a good grasp on it. I think people blindly start the NeetCode 150 or Bland 75 lists without first grasping the fundamental concepts properly first.
Thanks for expending the community of competitive programming/leetcode/whatever-this-thing-is-called. I recall finding Euler Project in 2019 and wanting to complete it. But I was just starting to coding back then and didn't really gone into it. Now that I graduated and applying to jobs. I discovered that I am awful and neither creative at applying DSA. I am filling the all these gaps with your service and planning to get really great with it. This does feel like a nice hobby to keep-to while also doing development full time.
I'm once again preparing for a job switch and I am now unable to solve the problems I have already done previously 2-3 years ago. All the basic algos have disappeared from my head now I'm starting from zero once more.
answering questions really goes down to following these steps: 1. Walk through test cases to clarify the problem and what it is doing. 2. Ask clarifying questions, especially about edge cases (a unique/unclear way to handle problem) 3. Pattern Cognition: Big-O Notation (time/space complexity), DSA and identify what to use - Check constraints 4. Implementation: practice the patterns 5. tackle ways to debug (is it a syntax or implementation error?)
this was surprisingly optimistic. Sometimes it's a nice reminder that what we're learning is hard but if we walk through it enough times it'll get easier just like everything else we've learned.
Reminds of the Woodpecker method for chess training. Spaced repetition of the same problems to drill core patterns into your head. I’m surprised it’s not talked about more for programming
Because none of these methods with chess training actually work (as far as what people want). The reality is, your innate talent is gonna cap anybody who wants to get good. Everyone plateaus around some natural limit, for 99.99% of people who get into chess, that limit is gonna be around 1600-2000, however when someone reaches that level they're gonna want to become a master (2200) which is a far more significant leap than what came before. And if/when anyone becomes a master (again, already extremely few players out of the general population of players), 95% or more won't be able to get much stronger than that. Even just a jump as simple as CM to FM is massively hard for many, and going to IM is huge too. When you reach IM, it feels like GM is within reach, but again it's a massively wide gap which most do not ever manage to cross. But to be honest, even many people who train chess won't even make 2000, which isn't that high anyway. Most who did not play from childhood are going to cap out around 1400-1800, which again is far below where anyone who gets into chess would want (although in online rating they can hit much higher due to the volatility there). Bottomline is, no chess training method is going to be widely or generally used for other fields, because in most cases, it won't even work for chess the way its users want it to.
@@joedorben3504 What complete nonsense lol. The woodpecker method doesn’t work? I’ve personally used it with amazing results. Thousands of others (including GMs. Christopher Yoo big example) with amazing results
you're right it's all about pattern recognition you see the problem, realize its a bfs/dfs/dp ...etc and solve it it's not like your expected to come up with a new algorithm and even if you are its probably just a combination of the popular ones, you just need consistency
This is some solid advice. One thing I'd add is to try hard solving a problem yourself before looking at the solution. It much improves the understanding of the problem even if you don't end up coming up with a solution. The process is frustrating and uncomfortable though :)
Just What I needed after not being able to solve basic problems .....correct me if I missed something : - Major Learnings from this video :- 1) Work On Basics 2) Have a methodology 3) If you learn from a solution ....just practice the same code next day 4) Repeat and Keep practicing 5) those questions day in and day out 5) This will only take you to a certain level above which you need to have a curiosity to know why a particular way code was written .
Advice on how to tackle leetcode . leetcode - system , methodologies , process 3:04 , Steps : Do bunch of repetition like - when you used to practices maths multiplication . many times . first target : practices core algo - like binary search , dfs , sliding - implement 5 times 10 times over a period of month second target : why somethings works ? why algo works ? - spend a little bit time think , curious about it . walkl thorough an example using paper and pen . using creative solution , using edge cases . important thing that was done when you were kid - handwritten notes . explainig your thought process , repetition , boring repetition like math enough times . Structures like one hour for english , 1 hour for maths works .
the reason why people don’t practice leetcode for months is because you literally don’t have time. as you get older you have friends, family, consulting work, hobbies, art/music, etc etc. imagine sacrificing all of that just to memorize DFS. now flip that around: do you really want to work for a company that expects you to give up everything worthwhile in life just to pass an interview? it gets worse when you hit senior/staff/manager levels, because all leadership skills require life experience and high EQ, which can only be gained by doing all of the things that you sacrificed to study DFS.
I took a job around 8 years ago that paid 20-25% less than continue job hunting that required leetcoding or just plain silly tests, which even after I solve wouldn't land me the job. It gave me time to pursue a lot of my interests, explore relationships, and all that kind of stuff that makes me human. Meanwhile, I even learned Rust. I was and I am still ready to work hard, but the thought of spending hours a day to crack leetcode gives me anxiety unlike doing 'regular' coding, which often puts me into flow. This is important especially as I am entering the second half of my life, and how I invest each moment is going to be very precious. If working hard means losing my emotional health, which in turn will affect physical health, then what do I gain by trying to crack leetcode? But I am willing to try 15 minutes a day that Neetcode suggests to see what happens, but still not that super motivated about it. It may have something to do with what Taleb saysa long these lines: some people often need a purpose to engage your intelligence. It's more likely when it's part of directly solving a problem you are engaged with, rather than something abstract or part of monkeying your way through an interview for better money.
This video did it for me. I have been writing software programs for 6+ years now for small startups and DSA has been the impediment to breaking into big companies because I just go blank whenever I get DSA questions. Saw this video some weeks ago and started practicing DSA fundamentals repeatedly and I can see my confidence level growing and have gotten a little bit better than before. I can't believe I blindly thought I would be good at something without practising it regularly. Thank you NEETCODE
To a lesser extent, this advice reminds me of my Theory of Computation class. When you’re asked to build a NFA or PDA that recognizes a certain language, the first step is knowing all the basic patterns like how a machine keeps track of even / odd characters, how it detects a substring, how it counts a certain amount of characters. Only after knowing these basic patterns are you able to build more complex machines. And with anyone of these problems, it’s best to write some strings that are in the language and some that are not, along with some edge cases that could break the machine Hopefully someone else can relate and hopefully apply it to their leetcode grind, good luck :)
It is also important to understand the "Leetcode mindset". It is similar to when you are trying to understand what your teacher wants you to learn and how to write the "correct answers"
This actually makes sense. Currently struggling with some “easy” multi pointer problems and feeling stupid. But when it comes to reversing or even MERGING a linked list, no problem! Cuz I know Linked Lists well. It’s trivial.
In high school I was taking an Algebra 2 matrixes test and ran out of time. My teacher chided me for being smart enough to answer the questions I did properly but not practicing my homework enough to do the test assignments fast enough. I think the same lesson is mentioned here. If you want to be able to solve medium questions faster, you need to be practiced at the easy questions that you can get the assignment done faster in a 45 minute interview where you only have 20-30 min to code. And, in a job, it's not so bad to also be able to do fundamentals quickly either. Even if you're not frequently using binary search in your day-to-day, it's still helpful to be able to do a lot of coding tasks quicker because the fundamentals are fresh.
This is great, thank you. I learned binary search once and then moved onto the next algo. I didn't realize the trick was to grind it until it's burned into my brain so I can focus fully on the rest of the problem. Now I'm going to work on implementing those algos in every language I'm comfortable with(C++, Go, Python, and JS) until the algos are second nature to me. Then I'll move on and see what other algos people are recommending.
I also play chess and do chess puzzles for fun. There is a method there called "woodpecker method". You solve a chess problem, and then you redo it 10 times before moving to the next ( refreshing the table so you don't see the moves ). It works especially well when the puzzle is longer and has more moves, because when you redo it, you really have to understand it before attempting again.
I am bad at leetcode but we all need to get away from the mindset that it is useless to grind. It starts instilling this framework in your mind that can start identifying patterns not just here but also in your daily coding work. Now can companies stop using this as the gold standard to judge coding capability. Yes absolutely!
This is so true, Most programmers teach themselves and it is challenging because you don't know where to start and where to go after that. It is important to understand the basic algorithms before we attempt to solve a real life or close to real life problems.
The reason people bash on leetcode or doing/learning DSA is because we depend mostly on libraries people have built. Many atime, depending on the problem/work one is depending, you will still need to develop an algorithm to solve a problem, and the efficient the algorithm is, the better it is for the software you are working on. Improving my DSA knowledge, trying leetcode problems and studying leetcode solutions have been impactful on me. The few engineers i have met that i consider to be amazing are good at DSA (and applying it). They are usually able to build automation tools and make things much more efficient. In summary, DSA and practicing how to apply them are very important for building softwares and tools. Many enginers/evelopers these days hate putting in enough to be better or build better solutions
Anyone who says that leetcoding is useless is not a real programmer.. You are literally practicing coding and learning new ways to solve different problems, that is a core of what you do on a daily basis as an engineer... SOLVING PROBLEMS!! 👀
I am greatful to have come across this video and as you mentioned about the habits we had as a kid can make so much difference if you countinue to do so as an adult, it was a video I needed most and covered the points why I am lacking as a leetcoder. I was doing well in math and physics like you but find coding very hard and boring, the thing I forget here is that as a child I used to practice a lot and thought of myself as a talented indivisual cause I was able to solve problems related to math and physics, so the "I am talented" mindset took me nowhere in my coding journey but they say better late than never so I will surely follow your advice :). Also wanted to add a point that if you are really good with basics then only you will question the reality of things as to why do things work that way and if you are struggling with basics then you tend to pounder over it and stop working on it was can be due to bordem of not getting to understand those thing.
I think also leetcode is hard because you have to think about all the test cases possible and make a general solution that works for all of them , coming up with an unexpected test case is so hard for me
The 'mistakes' you discussed here perfectly described my current approach to LC. You provided such a quick and concise way of fixing it too, thanks a lot Neetcode!
"It's that a lot of the things you did as a kid and maybe you stopped doing as an adult that were very, very useful to you, like taking handwritten notes, explaining your thought process, repetition, even boring repetition" This.
Love your stuff. One thought I had about this was that other subjects such as math are taught when you are very young. Learning things while young is simply easier. Also, to be honest I've learned - and then forgotten - most of the algos because I just never used them on my work. I've been a professional software engineer for almost 30 years. I wrote my first programs 43 years ago.
What got me back into this was actually using DFS in a real world design of building unique paths through a visual drag/drop graph. I'd really pay for something that did this with real projects. Here's some that ended up being real for me: 1. Build a graphical UI that calculates paths through the nodes via the edges and executes a predefined action on each node. 2. Compare the contents of two files. If a line is present in the second file but not the first, treat it as an insert operation. If it is not present in the second but is in the first, treat it as a delete operation. If it is present in both but any values after the first in the csv line are different, treat it as a modification.
Thanks Neetcode, now i know where i was lacking, and i thought i cracked jee with 97.6 percentile, in top 3% of students and thought leetcode would be easy game but when i am not able to solve questions and my peer solved easily i thought my iq is low, but now i get to know where i was lacking... thanks mate i will aply this method from now onwards
Notes : Leetcode is like math, the more you practice, the easier it gets. No Shortcuts Approach : Look at the problem and I should solve it asap ❌, instead focus on mastering the core algorithms like Binary search,dfs,bfs,sliding window. Hard questions : Find why the solution works, so it can be used else where in other qs
I don't care what anyone says, I love algorithms, I love leetcoding. It makes me a better problem solver. I don't memorize. I focus on techniques and patterns
Another thing that needs to be discussed is practicing the basic algorithms' variants. At some point, everybody knows how to write Binary Search, BFS, DFS, etc., but knowing the variants of each of these algorithms is equally important.
Immanuel from Uganda hia I like the way you've talked about the repetition and the learning of basics before you grind LeetCode part of it I gat U.......
There are some topics that require a deep understanding and a repetition along won’t help unless something “clicked” in your brain. I tried to solve a “Subsets” problem recently and I couldn’t do it. Then I went to “submissions” section and saw that I solved it a like a 15 times a year ago:) Backtracking is just so hard for me, but I guess I’m starting to get it…
Okay break time over. Time to do more neetcode. But seriously..this is all true. Been grinding for a little over a month now and I'm starting to build confidence since I'm able to complete mediums by myself more frequently. Not every single time, but more than last month. Pen and paper + writing out my own examples helped a lot. Hopefully within the month some offers are at my desk.
I think the thing with maths is for most problems you know what you should do , meaning you are already told in the question what to do. In the problems where you develop problem solving skills, there is still a finite amount of things you can do. In Leetcode, unless you are explicitly told or somehow found out by yourself that certain problems are always done in more or less the same way, it will be really hard to come up with an idea
Software engineer and musician. Repetition is good, boring but good. A session musician can recognise a song structure and read the music in one go because they've spent hours at home practising scales and intervals. Training their ears to recognise patterns. Coding has many similarities. Instead we are training our brains to recognise problems and connect solutions to those problems. Algorithms, Datastructures and Patterns are our scale and interval study equivalent. Do them enough and itll become second nature. I was reviewing a team members code the other day and immediately recognised he was using DFS to solve a problem.
My Notes:
1. Leetcode is hard, even for this guy.
2. Repetition is the key, really practice and keep repeating.
3. Internalize the fundamental algorithms(like bs, bfs, dfs, etc) so you have more brain capacity to analyze hard problems
4. Be creative and think hard on creative solutions/test cases
5. Even smart ppl won't get great at leetcode without practicing.
That is such a relief to me knowing that I'm not the only poor kid struggle with leetcode to get a job in this market, thank you for the vid!
thx
Nice summary , save a lot tk time 🎉
if you can add 6. suggestion ,
that’s greater
can you tell me all the fundamental algorithms to practice?
Nibba I can't even do 2sum after like the 20th tutorial
Watching Neetcode talk about Leetcode > Actually Leetcoding
😂😂
definately true...
Real
my procrastination spotted
Accurate
Summary:
1) Start with basics and Easy Questions.
2) Repetition is a key.
3) Get good with the algorithms first such as Binary Search, Sliding Window et cetera by doing it again and again and then apply it to the questions.
4) Ask Why while solving the questions - Why this approach or why this solution ?
5) Make notes or give comments.
Practice is the only thing that can make you pro at anything. Giving bare minimum can make you pass college exam, but not real life exam such as Interview.
Practice doesn't make perfect. Practice makes permanent
why did this hit different
this resonates, but i also feel you are giving the professional world a bit too much credit
When I read those comments the only thing I can think off is "what college you went to??".
My work is definitely much more easier.
@@programmingloop7atleast it takes u somewhere better then u are at right now😊
Leetcode is about memorizing how to start a problem but not memorizing the lines of code. And just learning data structures and algorithms is not everything. EDIT: also know helpful builtin methods
So how do you start problems
@@zikorajoe7093understanding the problem first, and how to implement the corresponding algorithm/data structure for that specific case. If I give you a problem x and tell you that it can be solved with a basic hashmap You could know all the functions and characteristics that a hashmap has, but if you do not understand the problem and do not know how to use the tools that a hashmap offers you for that problem, you will never be able to solve it. You need to think.
@@zikorajoe7093 identify the potential usage of ds or algorithms for the problems.
@@zikorajoe7093i’m not that great with DSA (yet!) but I think it’s just a matter of being able to think of the problem at hand, figuring out what logic would be most appropriate for the problem, like recursion or loops or whatever, and going from there, implementing the algorithm that makes the most sense (or what may make the most sense to you at that point in time and doing it that way until over time, you become aware of better solutions)
could you also mention a few built in methods that we should know. It would be very helpful, thanks!
Repetition is a powerful tool for mastery. You build a solid foundation by repeatedly implementing core algorithms-such as binary search, DFS (Depth-First Search), BFS (Breadth-First Search), and sliding window.
I'll ask more specifically.
There are two tasks: "11. Container With Most Water" and "42. Trapping Rain Water". Having found out the solution the first problem, I was able to reproduce it 7 months later in 40 minutes (alas, I'm slow on the uptake). Having learned the solution to the second problem, I will not be able to reproduce it, because it is not obvious to me. Unfortunately, I don’t know how to convince the brain to understand what it can’t come up with.
I'm fine with those but dynamic programming is fucking me up.
@@UserSo4reUsu75ry try like understanding how the algorithm works completely then do it again going in blind is fine but like algorithms are not something you can learn with just the solutions or the videos solutions in leetcode u gotta search it up and understanding it via youtube, google, github copilot(recently my friend recommended this i havent tried but it is apparently better than chatgpt) just keep looking for information until you fully understand how to apply it
leetcode is worthless. you learn 10x faster by just making projects that utilize these algorithms than mindlessly grinding them like a monkey at the circus.
@@egg-mv7ef a projects does help but leetcode just help your problem solving skill imo idk ever since I tried leetcode I can definitely see the difference it is good for people who don't have super good problem solving skill to develop a more clear process of thinking when coding
I was lying on my bed and got up to leave a comment here, my laptop was on my desk... You literally transformed my developer life, in a perfect way.
I started my career as a web developer 3 years ago. After three months, I took a new React project, since then, I have been working as a Frontend developer.
Last year, I moved abroad and started to seek opportunities abroad.
In my country, I already had my job and had network, I didn't worry that much to get a position, more like how much I could get or what company I worked for.
One year ago, I started to apply for jobs and I got rejected by all companies I applied - Language may've been the biggest problem though as I started to talk in English since last year.
I didn't want to miss opportunities if I got. I tried to solve leetcode several times but I didn't find any interest in it.
Actually, I was the person thinking code test is not practical to apply real projects and maybe a waste of time.
As a frontend developer, I may've focused on frontend technologies, builders, cloud platforms and stuff like that or better to study DS, and someday, your video came out on my youtube list.
Thanks to the algorithm. I actually saw some of your videos early last year but I couldn't understand at all due to my Enlgish proficiency, and last Winter, when your video came out on mylist, I clicked it and I was able to understand a bit and watched your videos.
It was an absolutely amazing moment. Your explanation was SO easy, after watching your videos, every problem felt easy to be solved.
At around that time, there was a company I was supposed to join but the company asked me to withdraw the contract a couple of weeks before starting to work, they said budget problems but I don't think so. After that, I had to go back to my country, but I really didn't want to GIVE UP.
On the first day, I came back to my country, I started to solve Top 150 problems with your videos. As I remember, I couldn't solve most of problems without your help. And at some point, I started to solve some problems by myself and I noticed changes inside me.
I started to think first, and come up with some solutions. Like you said, sliding windows, dfs, bfs, some other stuff, while solving problems, I got used to those concepts.
I don't need to think about how to implement those stuff. I could just use it as my tool. It's not about memorizing solutions.
It's about how to define a problem, how to see a problem and how to apply knowledge I have to solve the problem. It's all about thinking.
I also noticed that I apply the same way to solve leetcode problems, when I create UI components in React, write logics and approach errors.
I'm still not goot at leetcode and still need to improve A LOT, I know but I felt the positive changes and now I know if I do it, I could do better as time goes, as I put more effort on it.
Thank you very much. I'm still looking for a job now but it does not matter, I just do code, I like it and I like those changes.
Once again, thank you very much for sharing your experience, knowledge and thought with us. Good night 👍
What country are you from and where did you go to?
This is really inspiring but please use paragraphs; a wall of text is really difficult to take in...
Other than that, it's really nice that you feel more confident in your abilities now, and I hope you soon land a job where you can thrive and be happy.
@@ozgurpeynirci4586 I'm from South Korea and I was in Germany last year. The company I got the final offer from was based in Vienna.
@@aiSage48 Oh, man. I didn't know this looks this mess. Something clicked in my head, and I just wrote everything I wanted to say and went to bed. Thanks for the comment and supportive words!
Ah Man i really was hoping by the end of your message that you landed a job at Google or something.. anyway best of luck
Having a good knowledge about stacks and queues will give you an edge on dfs and bfs, respectively.
Recursion is a good thing to know, too.
The problem is that some people jumping the gun, when they haven't grasped the underlying concept of dfs, and bfs?
It's like how you know 456 if you don't know 1,2,3
You know 456 if you loop in reverse
Use python and other functional supported languages to understand recursion better
@@samuraijosh1595 master merge sort
Yess...Jumping to DP without knowing backtracking.... I done that mistake before
this ^^ i was going in blind and i totally wasted my time had to go and start from hashmap, sliding windows.... realise i was going in without even understanding how to apply or how the solution works 💀wasted a lot of time
Leetcode is like going to the gym. If you hit the gym only a few times a year, you aren't going to make any gains. If you do a workout just once, then it's weeks before you do that workout again, you'll be right back where you started. You have to do it consistently and repeat the same types of problems over and over to make gains.
Same. I did pre-med. Now in CS. Leetcode def made pre-med seem like a breeze.
Programming requires mathematical creativity.
Thanks for this video, sir.
Leetcode is hard. Copying fireship thumbnails is easy.
Daym
This should be pined 😂
I thought on one notice this
I thought this video was by fireship. I realised later.
Leetcode is only "imporant" because some bigTech companies use it as a first screening tool. It only addresses a very tiny bit of what a software developer really need to be able to do. Most important are : 1) Be able to write readable/maintainable code. 2) Write unit testable code. 3) Do not optimize prematurely. 4) Be able to work in a team. In fact I would probably not hire most competitive coders, they learned a very low quality of coding and much of that kind of code wouldn't pass any decent codereview. So dear developers out there, being able to solve leetcode puzzles is only one (little) tool in your toolbox :)
Do u think it’s not that important ? I am really bad at it and i feel miserable
@@sondosahmed4870its very important for getting and passing interviews. Although soft skills are equally as important
Leetcode sums up everything u learned in a CS degree all in one assuming u know the syntax: How to think, the trade offs, then the actual programming part
how to think is a big factor when solving the problems ngl like i used to think super complex ideas realising it wont work the idea is to be familiarized with the code and how to manipulate before you try to fix a problem without proper understanding it is like trying to say something in broken english which u can understand but others wont understand
I’m a senior Dev but don’t want to be complacent. Want to keep grinding and will hopefully get into big tech soon. Your video showed up on my feed; will start my Leetcode journey again.
Just don't. Leetcode will NOT teach you any of the real important software engineering skills : Writing readable, maintainable, and unit testable code. Competitive coding should not even be called that... it is only about training problem solving skills (and not much of it really relates to things you will do in your software development career)
@@peregrin71 it does improve like the way u think when coding thou so maybe more efficient? since you have to pay attention to time complexity, algorithms and so on
@@peregrin71 Most corporate Code is just glueing things together, he is already a Senior Dev yet you are advising him to learn "real" important SWE Skills. Hilarious
Thank you for this video. I always keep this Bruce Lee quote close to my heart:
"I fear not the man who has practiced 10,000 kicks once, but I fear the man who has practiced one kick 10,000 times."
It's been a tough few months after layoff with job search and leetcode grinds on top of taking care of the family. But videos like yours keep reminding me to continue the grind and better prepare myself for the challenges ahead.
Algorithms and data structures, as required in technical interviews and as present in LeetCode, are the subject matter of master’s programs in computer science. Everything beyond a simple binary search is, indeed, not an easy topic at all; it is a very academic topic. What makes it even harder is the fact that the average software engineer, most often than not, has never even opened calculus (e.g., Stewart or Spivak) and algorithms (e.g., Cormen or Skiena) textbooks; it’s only natural that all those algorithms feel alien to someone seeing algorithms for the first time.
uh bro its not masters, if you want an internship within your first 2 years you need system design, leetcode mediums, and real work projects that arent basic projects. you're supposed to do calculus>discrete math>computer arch so you know how binary works on a motherboard before python. if you dont youre not an engineer at all youre a struggling self proclaimed coder
theres a lot more to explain to become a full stack scalable dev that can design and lead sdlc and preferably have a few monetizable niches by year 4 but your comment is a big yikes
@@WoWUndad wth are you on about
The coding assessment don't test you algo knowledge but primarily if you can practice and recall from memory when you need to apply algorithms. I come from a non-cs background but even i knew lot of ds and algos but i never faced any hard complicated puzzle that require more than 1 algorithm to solve until about mid-2010's. Once an interviewer asked me a fib series with memoization that allowed me to get past the first round. These days interviews specifically ask hard type problems to weed as many candidates as possible, it is not you but the market. And interviewers are also very impatient and hard to handle these days, if you make a tiny mistake your whole work experience will questioned. It is pathetic.
@@WoWUndad I got my first internship through networking at my CS club and applying my skills to 2 projects, the technical interview was simple and they spent more time asking me about my projects and walking through my though process and challenges.
Humble yourself, your attitude is common amongst a certain type of CS student that always translate to a negative person to work with when you enter the workforce.
You still have time to correct this as I'm assuming your still in college
@@WoWUndad Aren't you proving what he said? You said someone needs calculus in order to do well, that's exactly what he said. You said someone needs a rigorous academic background in order to do well, that's also what he said. You're literally repeating the same thing in different words and then saying his comment was "a big yikes". I don't get you at all
I'd recommend starting with Exercism, as the problems are much more manageable and you'll learn your language and problem-solving skills in a step-by-step manner.
Personally, I followed this approach and had never attempted LeetCode before watching this video. Yet, I was able to solve the median array problem in just 20 minutes.
I think this is a great way to develop your problem-solving skills.
Exercism is so good. I love that platform and their RUclips channel. NeetCode & Exercism should do a collab.
I'm really struggling with so many monotonic stack problems and needed to hear this. Thanks!
bro what a coincidence i am in the same situation
I feel the struggle. Monotonic stacks are especially tricky, in particular some problems on leetcode. It does get better over time, but even after doing like 30 problems I'm still not fully comfortable with them. Similar to DP in that regard.
Words of wisdom from a pro leetcoder. 18 mins of priceless advice. Thanks
Subtle thing to add here.
1. Master your language and then master how to use it in a Leetcode environment. There are many functions and things you would never write in production code but if speed is required, you better now how to initialize a 2D matrix with -1's, or maybe a set. How to join arrays of arrays.
Neetcode is correct anytime you lose time on the "basics", it will be distracting and will take away time from solving the edge case or deriving the unique trick in that problem.
2. This is job security, especially in this market. Until the industry does not use this as some type of IQ test, keep yourself up to date. Try to do 2 a week AFTER you get a job. That comes out to about 104 questions a year. This is one of the biggest things I see people not do, so they end up restarting and feeling hopeless again because they stop practicing.
For me leetcode is harder than algebraic geometry
it definitely is
Algebraic geometry is intuitive once you study prerequisite mathematics enough. No amount of fundamental data structures and algorithms prepares you for the type of mind bending solution path that leetcode sends you down 😂
For me no. Maybe bcz I never seriously studied algebraic geo lol
What is algebraic geometry? I mostly use trig and calculus
it's an upper level pure math course, most people never study it.
16:22 examples! yes!
one of my high school teachers (science? maths?) taught me to always test what you're doing with seven samples:
the min and max "correct" values, the "middle" (or expected) value, values that are halfway between the middle and min/max, and finally values that are a little past the min and a little past the max (outside the "correct" range).
this advice has helped me immensely over the years with many many things, even in daily life.
for example: if i'm lerping an input value between two target values 50 and 125, i'd estimate (guessing *at a glance* without calculating) that the values would be 45, 50, 70, 90, 110, 125, 130
to ensure everything is working correctly, i'd input 0.0, 0.5, 1.0 etc and see if the outputs are as expected.
if i see a 200, a 0, or a -50 show up, i instantly know something went very very wrong with the input or how it is processed.
Your points does makes sense. I tried Leetcode many times and gave up eventually, maybe in future I will try again keeping these things in mind. Nice content.
starting looking into discrete math and algorithms really helps a ton and make sure u know python concepts up to OOP u should be good to try leetcode again should be faster in thinking up the ideas also try like doing more brain stimulating activities keep thinking i realise this makes a huge difference in how you think like just try looking for mistakes in other people's code etc. keep it running
@@Anonymous-ri4mk leetcode is worthless. you learn 10x faster by just making projects that utilize these algorithms than mindlessly grinding them like a monkey at the circus.
Thank you so much for posting this. This is something that I need. You don’t need Leetcode to KEEP your job, but you do need it to GET a job.
you exactly pointed what I was lacking and have been doing. thank you so so much for this video.
The older i get the more I realise that this really is the approach you need to life. I practice guitar everyday in order to improve and yet I failed to see how the same concept applies to pretty much anything you want to get good at. Thanks for the wake up call :)
with leetcode its more like having to spend the time learning guitar in order to become a pianist
@@miramar-103 yep pretty much, prove how good you are at guitar so you are allowed to be paid to play piano 😭
4:22 "back in the old day, 2019" damn
That hit me hard, bruh, it was only a few years ago
This is something that I have concluded too. I have been doing LC on and off since the last few years, but I took a concept and did a lot of questions about it. Now I feel I have a good grasp on it. I think people blindly start the NeetCode 150 or Bland 75 lists without first grasping the fundamental concepts properly first.
Same😊
This was an absolute bombshell of growth advice.
Absolutely phenomenal! Thank you so much
Thanks for expending the community of competitive programming/leetcode/whatever-this-thing-is-called.
I recall finding Euler Project in 2019 and wanting to complete it. But I was just starting to coding back then and didn't really gone into it. Now that I graduated and applying to jobs. I discovered that I am awful and neither creative at applying DSA.
I am filling the all these gaps with your service and planning to get really great with it. This does feel like a nice hobby to keep-to while also doing development full time.
I'm once again preparing for a job switch and I am now unable to solve the problems I have already done previously 2-3 years ago. All the basic algos have disappeared from my head now I'm starting from zero once more.
"I fear not the man who has practiced 10,000 leetcode problems once, but I fear the man who has practiced one problem 10,000 times." @Neet Lee
answering questions really goes down to following these steps:
1. Walk through test cases to clarify the problem and what it is doing.
2. Ask clarifying questions, especially about edge cases (a unique/unclear way to handle problem)
3. Pattern Cognition: Big-O Notation (time/space complexity), DSA and identify what to use
- Check constraints
4. Implementation: practice the patterns
5. tackle ways to debug (is it a syntax or implementation error?)
this was surprisingly optimistic. Sometimes it's a nice reminder that what we're learning is hard but if we walk through it enough times it'll get easier just like everything else we've learned.
If you leave RUclips I'm quitting programming. Bravo for explaining how to approach the actual learning. Thank you.
Reminds of the Woodpecker method for chess training.
Spaced repetition of the same problems to drill core patterns into your head. I’m surprised it’s not talked about more for programming
Because none of these methods with chess training actually work (as far as what people want). The reality is, your innate talent is gonna cap anybody who wants to get good. Everyone plateaus around some natural limit, for 99.99% of people who get into chess, that limit is gonna be around 1600-2000, however when someone reaches that level they're gonna want to become a master (2200) which is a far more significant leap than what came before. And if/when anyone becomes a master (again, already extremely few players out of the general population of players), 95% or more won't be able to get much stronger than that. Even just a jump as simple as CM to FM is massively hard for many, and going to IM is huge too. When you reach IM, it feels like GM is within reach, but again it's a massively wide gap which most do not ever manage to cross. But to be honest, even many people who train chess won't even make 2000, which isn't that high anyway. Most who did not play from childhood are going to cap out around 1400-1800, which again is far below where anyone who gets into chess would want (although in online rating they can hit much higher due to the volatility there). Bottomline is, no chess training method is going to be widely or generally used for other fields, because in most cases, it won't even work for chess the way its users want it to.
@@joedorben3504 What complete nonsense lol. The woodpecker method doesn’t work? I’ve personally used it with amazing results. Thousands of others (including GMs. Christopher Yoo big example) with amazing results
you're right it's all about pattern recognition you see the problem, realize its a bfs/dfs/dp ...etc and solve it it's not like your expected to come up with a new algorithm and even if you are its probably just a combination of the popular ones, you just need consistency
That's why you do codeforces, cuz problems aren't that repetitive there
@@zanies6288 do you mean contests ?
Dude, you are the man. This is such invaluable and helpful wisdom. Thanks for sharing.
This is some solid advice. One thing I'd add is to try hard solving a problem yourself before looking at the solution. It much improves the understanding of the problem even if you don't end up coming up with a solution. The process is frustrating and uncomfortable though :)
One of the most important videos I've ever seen on this subject. Thanks man!
Лучшее обучение, поддерживаю Смоука!😈
Just What I needed after not being able to solve basic problems .....correct me if I missed something : - Major Learnings from this video :- 1) Work On Basics 2) Have a methodology 3) If you learn from a solution ....just practice the same code next day 4) Repeat and Keep practicing 5) those questions day in and day out 5) This will only take you to a certain level above which you need to have a curiosity to know why a particular way code was written .
Advice on how to tackle leetcode .
leetcode - system , methodologies , process 3:04 ,
Steps : Do bunch of repetition like - when you used to practices maths multiplication . many times .
first target : practices core algo - like binary search , dfs , sliding - implement 5 times 10 times over a period of month
second target : why somethings works ? why algo works ? - spend a little bit time think , curious about it .
walkl thorough an example using paper and pen . using creative solution , using edge cases .
important thing that was done when you were kid - handwritten notes . explainig your thought process , repetition , boring repetition like math enough times . Structures like one hour for english , 1 hour for maths works .
the reason why people don’t practice leetcode for months is because you literally don’t have time. as you get older you have friends, family, consulting work, hobbies, art/music, etc etc. imagine sacrificing all of that just to memorize DFS. now flip that around: do you really want to work for a company that expects you to give up everything worthwhile in life just to pass an interview? it gets worse when you hit senior/staff/manager levels, because all leadership skills require life experience and high EQ, which can only be gained by doing all of the things that you sacrificed to study DFS.
Ironic
I took a job around 8 years ago that paid 20-25% less than continue job hunting that required leetcoding or just plain silly tests, which even after I solve wouldn't land me the job.
It gave me time to pursue a lot of my interests, explore relationships, and all that kind of stuff that makes me human. Meanwhile, I even learned Rust.
I was and I am still ready to work hard, but the thought of spending hours a day to crack leetcode gives me anxiety unlike doing 'regular' coding, which often puts me into flow. This is important especially as I am entering the second half of my life, and how I invest each moment is going to be very precious. If working hard means losing my emotional health, which in turn will affect physical health, then what do I gain by trying to crack leetcode?
But I am willing to try 15 minutes a day that Neetcode suggests to see what happens, but still not that super motivated about it. It may have something to do with what Taleb saysa long these lines: some people often need a purpose to engage your intelligence. It's more likely when it's part of directly solving a problem you are engaged with, rather than something abstract or part of monkeying your way through an interview for better money.
@@drstalone hey do you suggest this for young people as well, your advice of putting emotional health first really put things into perspective
This video did it for me. I have been writing software programs for 6+ years now for small startups and DSA has been the impediment to breaking into big companies because I just go blank whenever I get DSA questions. Saw this video some weeks ago and started practicing DSA fundamentals repeatedly and I can see my confidence level growing and have gotten a little bit better than before. I can't believe I blindly thought I would be good at something without practising it regularly. Thank you NEETCODE
Neetcode's videos literally helped me get a job in FAANG in 2022. Listen to him and Git Gud!😄
I also like the way you enunciate. Your clear explanations become even better when you speak clearly.
Thanks so much for posting this. Definitely gives hope ❤
To a lesser extent, this advice reminds me of my Theory of Computation class.
When you’re asked to build a NFA or PDA that recognizes a certain language, the first step is knowing all the basic patterns like how a machine keeps track of even / odd characters, how it detects a substring, how it counts a certain amount of characters.
Only after knowing these basic patterns are you able to build more complex machines. And with anyone of these problems, it’s best to write some strings that are in the language and some that are not, along with some edge cases that could break the machine
Hopefully someone else can relate and hopefully apply it to their leetcode grind, good luck :)
Similar to me my TOC which requires null transition and regular expression later in CD the parsing technique sucks great.
Thank You Singh sahab. I have been thinking about the why myself lately, and once the why is clear, it is just fun all along.
It is also important to understand the "Leetcode mindset". It is similar to when you are trying to understand what your teacher wants you to learn and how to write the "correct answers"
This actually makes sense. Currently struggling with some “easy” multi pointer problems and feeling stupid.
But when it comes to reversing or even MERGING a linked list, no problem! Cuz I know Linked Lists well. It’s trivial.
As said by many people 100000 times before also, "Practice makes a man perfect". It's actually true buddy.
I just started Leetcode. I was humbled so much lol.
Summary : Practice, repetitions
Useless video unlike almost all his other vids
In high school I was taking an Algebra 2 matrixes test and ran out of time. My teacher chided me for being smart enough to answer the questions I did properly but not practicing my homework enough to do the test assignments fast enough.
I think the same lesson is mentioned here. If you want to be able to solve medium questions faster, you need to be practiced at the easy questions that you can get the assignment done faster in a 45 minute interview where you only have 20-30 min to code.
And, in a job, it's not so bad to also be able to do fundamentals quickly either. Even if you're not frequently using binary search in your day-to-day, it's still helpful to be able to do a lot of coding tasks quicker because the fundamentals are fresh.
Very raw. Great advice. I've done about 100 leetcode questions now and even I still hit a brick wall
This is great, thank you. I learned binary search once and then moved onto the next algo. I didn't realize the trick was to grind it until it's burned into my brain so I can focus fully on the rest of the problem. Now I'm going to work on implementing those algos in every language I'm comfortable with(C++, Go, Python, and JS) until the algos are second nature to me. Then I'll move on and see what other algos people are recommending.
Damn that reply to someone in the intro was everything I needed to hear after couple of my friends said the same things to me😂...
Best reply ever...
Today we have to be good in competitive programming, core DSA(leetcode), development, cs fundamentals, experience everything to land a job.
Hey there! Did u completed neetcode 150?
I also play chess and do chess puzzles for fun. There is a method there called "woodpecker method". You solve a chess problem, and then you redo it 10 times before moving to the next ( refreshing the table so you don't see the moves ). It works especially well when the puzzle is longer and has more moves, because when you redo it, you really have to understand it before attempting again.
"I'm not afraid of someone who studies 10,000 different strikes. I'm afraid of the one who studies one blow 10,000 times."
- Bruce Lee
I am bad at leetcode but we all need to get away from the mindset that it is useless to grind. It starts instilling this framework in your mind that can start identifying patterns not just here but also in your daily coding work. Now can companies stop using this as the gold standard to judge
coding capability. Yes absolutely!
Thanks man. This video is truly a gem. I get your ideas and will act accordingly.
This is so true, Most programmers teach themselves and it is challenging because you don't know where to start and where to go after that. It is important to understand the basic algorithms before we attempt to solve a real life or close to real life problems.
The reason people bash on leetcode or doing/learning DSA is because we depend mostly on libraries people have built. Many atime, depending on the problem/work one is depending, you will still need to develop an algorithm to solve a problem, and the efficient the algorithm is, the better it is for the software you are working on. Improving my DSA knowledge, trying leetcode problems and studying leetcode solutions have been impactful on me. The few engineers i have met that i consider to be amazing are good at DSA (and applying it). They are usually able to build automation tools and make things much more efficient.
In summary, DSA and practicing how to apply them are very important for building softwares and tools. Many enginers/evelopers these days hate putting in enough to be better or build better solutions
Anyone who says that leetcoding is useless is not a real programmer.. You are literally practicing coding and learning new ways to solve different problems, that is a core of what you do on a daily basis as an engineer... SOLVING PROBLEMS!! 👀
The most useful advice/observation(s) happens at 17:20 onwards
I am greatful to have come across this video and as you mentioned about the habits we had as a kid can make so much difference if you countinue to do so as an adult, it was a video I needed most and covered the points why I am lacking as a leetcoder. I was doing well in math and physics like you but find coding very hard and boring, the thing I forget here is that as a child I used to practice a lot and thought of myself as a talented indivisual cause I was able to solve problems related to math and physics, so the "I am talented" mindset took me nowhere in my coding journey but they say better late than never so I will surely follow your advice :). Also wanted to add a point that if you are really good with basics then only you will question the reality of things as to why do things work that way and if you are struggling with basics then you tend to pounder over it and stop working on it was can be due to bordem of not getting to understand those thing.
You're really good at articulating your thoughts clearly. That's a skill not easily taught unfortunately
I think also leetcode is hard because you have to think about all the test cases possible and make a general solution that works for all of them , coming up with an unexpected test case is so hard for me
The 'mistakes' you discussed here perfectly described my current approach to LC. You provided such a quick and concise way of fixing it too, thanks a lot Neetcode!
So encouraging and makes sense. Thanks for sharing!
I'm just glad someone brought up leetcode is 😶🌫️😶🌫️😶🌫️ draining hard, I thought there are genius and here is me
"It's that a lot of the things you did as a kid and maybe you stopped doing as an adult that were very, very useful to you, like taking handwritten notes, explaining your thought process, repetition, even boring repetition"
This.
Love your stuff. One thought I had about this was that other subjects such as math are taught when you are very young. Learning things while young is simply easier. Also, to be honest I've learned - and then forgotten - most of the algos because I just never used them on my work. I've been a professional software engineer for almost 30 years. I wrote my first programs 43 years ago.
What got me back into this was actually using DFS in a real world design of building unique paths through a visual drag/drop graph. I'd really pay for something that did this with real projects. Here's some that ended up being real for me:
1. Build a graphical UI that calculates paths through the nodes via the edges and executes a predefined action on each node.
2. Compare the contents of two files. If a line is present in the second file but not the first, treat it as an insert operation. If it is not present in the second but is in the first, treat it as a delete operation. If it is present in both but any values after the first in the csv line are different, treat it as a modification.
Consistency and practice is something we often ignore, it was really good watching u explain all that in such detail. 💯
Thanks Neetcode, now i know where i was lacking, and i thought i cracked jee with 97.6 percentile, in top 3% of students and thought leetcode would be easy game but when i am not able to solve questions and my peer solved easily i thought my iq is low, but now i get to know where i was lacking... thanks mate i will aply this method from now onwards
Thanks for sharing!!. At the end of the day, only practicing and repetition can help to level up and get good at Leetcoding
This is the first video I watched from you. And I just wanna say. So fuxxing true
Notes :
Leetcode is like math, the more you practice, the easier it gets. No Shortcuts
Approach : Look at the problem and I should solve it asap ❌, instead focus on mastering the core algorithms like Binary search,dfs,bfs,sliding window.
Hard questions : Find why the solution works, so it can be used else where in other qs
Mate, you are really good in finding these common principles of working with Leetcode. Thank you.
Felt good when u said "its not your fault"
thanks man helpfull insights 🤙🏻
I don't care what anyone says, I love algorithms, I love leetcoding. It makes me a better problem solver. I don't memorize. I focus on techniques and patterns
Actually, all you're doing is memorizing the patterns.
But dont forget to Memoize :)
You don't memorize? 🤨
@@jaserogers997 bruh 🤣
@@Blackoutfor10days sure, but it doesn't help with stuff you haven't memorized.
Another thing that needs to be discussed is practicing the basic algorithms' variants. At some point, everybody knows how to write Binary Search, BFS, DFS, etc., but knowing the variants of each of these algorithms is equally important.
Thank you for making this video. Helped me confirming I'm on the right path.
Immanuel from Uganda hia
I like the way you've talked about the repetition and the learning of basics before you grind LeetCode part of it
I gat U.......
You sir, are a hero. Thank you.
Bro casually dropped the best advice on learning
you unlocked my thinking regarding this ! Thanks bro
One of the best videos explaining Leetcode complexity.
Hooah! This video motivated me to go back to basics!
Awesome and I am watching it for the third time without any skipping
There are some topics that require a deep understanding and a repetition along won’t help unless something “clicked” in your brain. I tried to solve a “Subsets” problem recently and I couldn’t do it. Then I went to “submissions” section and saw that I solved it a like a 15 times a year ago:)
Backtracking is just so hard for me, but I guess I’m starting to get it…
+1 exactly the same, suggest if you are following any methodologies to understand it.
Backtracking becomes easier after you start solving dp problems
Okay break time over. Time to do more neetcode.
But seriously..this is all true. Been grinding for a little over a month now and I'm starting to build confidence since I'm able to complete mediums by myself more frequently. Not every single time, but more than last month. Pen and paper + writing out my own examples helped a lot. Hopefully within the month some offers are at my desk.
I think the thing with maths is for most problems you know what you should do , meaning you are already told in the question what to do. In the problems where you develop problem solving skills, there is still a finite amount of things you can do. In Leetcode, unless you are explicitly told or somehow found out by yourself that certain problems are always done in more or less the same way, it will be really hard to come up with an idea
Woah... holy "come to an end really quick" on this one! This was in another tab and I thought I'd lost internet lol
Leetcode is pretty useful to become an overall better programmer. The day to day dev programming can be monotonous and easy and not help improve
Summary of Video:
- It’s about systems
- repetition
- understand core algos
- binary search
- dfs
- bfs
- sliding
- create your own example use cases
Software engineer and musician. Repetition is good, boring but good. A session musician can recognise a song structure and read the music in one go because they've spent hours at home practising scales and intervals. Training their ears to recognise patterns. Coding has many similarities. Instead we are training our brains to recognise problems and connect solutions to those problems. Algorithms, Datastructures and Patterns are our scale and interval study equivalent. Do them enough and itll become second nature. I was reviewing a team members code the other day and immediately recognised he was using DFS to solve a problem.