Top 5 Dynamic Programming Patterns for Coding Interviews - For Beginners

  Рет қаралды 302,731

NeetCode

NeetCode

Күн бұрын

🚀 neetcode.io/ - A better way to prepare for Coding Interviews
🐦 Twitter: / neetcode1
🥷 Discord: / discord
🐮 Support the channel: / neetcode
Top 5 DP Patterns Spreadsheet - docs.google.com/spreadsheets/...
Twitter: / neetcode1
Discord: / discord
⭐ BLIND-75 PLAYLIST: • Two Sum - Leetcode 1 -...
💡 CODING SOLUTIONS: • Coding Interview Solut...
💡 DYNAMIC PROGRAMMING PLAYLIST: • House Robber - Leetco...
🌲 TREE PLAYLIST: • Invert Binary Tree - D...
💡 GRAPH PLAYLIST: • Course Schedule - Grap...
💡 BACKTRACKING PLAYLIST: • Word Search - Backtrac...
💡 LINKED LIST PLAYLIST: • Reverse Linked List - ...
💡 BINARY SEARCH PLAYLIST: • Binary Search
0:00 - Intro
1:11 - 1. Fibonacci Numbers
6:45 - 2. Zero One Knapsack
13:07 - 3. Unbounded Knapsack
16:51 - 4. Longest Common Subsequence
23:30 - 5. Palindromes
#dynamic #programming #python
Disclosure: Some of the links above may be affiliate links, from which I may earn a small commission.

Пікірлер: 121
@NeetCode
@NeetCode 2 жыл бұрын
🚀 neetcode.io/ - A better way to prepare for Coding Interviews
@fightmeonclubpenguin7748
@fightmeonclubpenguin7748 2 жыл бұрын
This channel is such a great find. I just wish there were more videos haha
@tabeebyeamin9986
@tabeebyeamin9986 2 жыл бұрын
These are good and makes me realize what a great CS curriculum I had that covered all 5 of these lol. I would also study 6. DFS + memoization (Longest Increasing Path in a Matrix, Path Sum III) 7. Backtracking + memoization (Regex/Wildcard, Partition to K Equal Sum Subsets) 8. State Machine (Best Time to Buy & Sell Stock variations)
@dj1984x
@dj1984x 11 ай бұрын
are dfs + memoization & backtracking + memoization the same? at least in neetcode's videos, he uses dfs algo for any backtracking problem
@alexruan5639
@alexruan5639 8 ай бұрын
​@@dj1984x DFS is not just backtracking, but backtracking is always DFS.
@ranitchatterjee5552
@ranitchatterjee5552 2 жыл бұрын
I want to thank Neetcode. The videos were great resource to learn coding and crack tech interviews. I'm very thankful to this channel. Hope your channel grows more and more. ❤️
@susmi51910
@susmi51910 2 жыл бұрын
This is truly life saving! Please make more of this type of videos for other topics.
@davidespinosa1910
@davidespinosa1910 2 жыл бұрын
DP = recursion + memoization. Then, if you want to memoize using an array instead of a hash map, you can optimize that after. So it's no harder than recursion. But DP often uses a variable number of subproblems, while more straightforward recursions use only one or two subproblems.
@imj3nny
@imj3nny 2 жыл бұрын
Thank you! This is so helpful! I look forward to more of this type pf high level overview :)
@alexeysubbota
@alexeysubbota Жыл бұрын
Guy, you really helped me a lot! After watching Climbing Stairs video I did solve Maximum Alternating Subsequence Sum problem not only using DP but using bottom up approach!
@miettoisdev
@miettoisdev Жыл бұрын
some real quality content here. interview material is usually bloated with edgy-cleverish stuff, not structured according to problem's domain of knowledge and not prioritized correctly. you, sir, have managed to sort all that out. thank 🤜🤛
@varunrajput8083
@varunrajput8083 2 жыл бұрын
This is perfect. Thank you. Can you please make similar lists for other topics as well? That will be extremely helpful because while solving the problem it's good to have an idea about general approach you'll be following..
@dinhnhobao
@dinhnhobao 2 жыл бұрын
Great stuff! I have learned a lot from your videos. Please do more of these!
@whileminseok5110
@whileminseok5110 2 жыл бұрын
this is so AWESOME!!! thanks for sharing your knowledge :)
@homi.mp3
@homi.mp3 2 жыл бұрын
Brilliant explanation, your videos are extremely helpful, thank you for doing all the good work :)
@panggrayta
@panggrayta 2 жыл бұрын
very clear explanation. good job NeetCode. keep up to date your videos . thanks
@max3446
@max3446 2 жыл бұрын
Easily the best LC channel, thank you :)
@janailtongoncalvesdesouza4160
@janailtongoncalvesdesouza4160 7 ай бұрын
The way you explain CS is awesome, bro! Keep doing the good job!
@venkatasriharsha4227
@venkatasriharsha4227 2 жыл бұрын
The best Python Leetcode problem solver. Love u brother ❤️
@kirillzlobin7135
@kirillzlobin7135 4 ай бұрын
This style of videos is very informative. It helps to structure and categorize the information related to DP problems and allows to come to the solution faster.
@arnabganguly4962
@arnabganguly4962 2 жыл бұрын
Thanks for sharing this approach.
@kartikhakim4674
@kartikhakim4674 2 жыл бұрын
Please make and share more videos / spreadsheets like this They are really helpful for practice 🙏
@jinny5025
@jinny5025 2 жыл бұрын
I'm not confident with dp problems. But this spreadsheet is awesome!! Thank you as always. And congrats you've gained 10k subscribers so far :) You deserve more.
@TokyoWasTaken
@TokyoWasTaken Жыл бұрын
damn so he got 200k within year
@deathbombs
@deathbombs Жыл бұрын
damnnn 250k now
@liz.1328
@liz.1328 10 ай бұрын
516k now
@johnnycochicken
@johnnycochicken 8 ай бұрын
another 30k in a month dayum@@liz.1328
@knanzeynalov7133
@knanzeynalov7133 Ай бұрын
@@liz.1328 700k+ now
@YasirYSR
@YasirYSR 2 жыл бұрын
amazing, please keep doing this wonderful work.
@shresthgupta6875
@shresthgupta6875 2 жыл бұрын
Thanks for this spreadsheet.
@anishdeshmukh4690
@anishdeshmukh4690 2 жыл бұрын
Thanks a lot! You're the best
@AnkitYadav-tf1ww
@AnkitYadav-tf1ww Жыл бұрын
Very Important for understanding core concepts of dynamic programming.
@marioa.castresana6946
@marioa.castresana6946 2 жыл бұрын
Awesome video! thank you so much
@victormacgrath
@victormacgrath 2 жыл бұрын
Really helpful, thank you very much
@deathbombs
@deathbombs Жыл бұрын
I've been doing DP for a while so not exactly a beginner, but this is still helpful way to see things
@benjaminkeene5444
@benjaminkeene5444 Жыл бұрын
Love the videos. SMALL EDIT: For the “Unbounded Knapsack”, we do not need 2D array. We only need to know MIN(coinsUsed) at each position. Since we can use any coin at each position, we do not need to track type of coins used.
@buddyreg234
@buddyreg234 9 ай бұрын
The feeling that the athor somehow bullshittin us huh ? 😀
@subhendurana6457
@subhendurana6457 Жыл бұрын
You are just saviour in my battle-hour!
@dongni1106
@dongni1106 Жыл бұрын
very good video! thanks so much.
@algorithmo134
@algorithmo134 2 жыл бұрын
Looking forward for this
@mahmudurrahman1170
@mahmudurrahman1170 2 жыл бұрын
U are just awesome. thanks a lot
@karthik829
@karthik829 2 жыл бұрын
Your videos are really helpful. Just a suggestion, it would be really nice if you could create a video on when we should do backtracking vs dynamic programming. As some seems to fall on both with different runtime and people use different solutions
@wongwong7479
@wongwong7479 Жыл бұрын
actually, i think both backtracking and dp is bruteforce which try all combination, but if one can build an optimal structure and a DAG , then definitely we should use dp to reduce from exponential time (backtracking/dfs)
@AdilProgramming
@AdilProgramming Жыл бұрын
We use dp when their are overlapping sub-problems, here in this problem their is not any sub-problem(part of problem we have already solved)
@another14edits74
@another14edits74 2 жыл бұрын
Can you please make videos on fundamental DP questions (such as the ones you listed in this video) and solve them with multiple solutions describing how you build intuition to build the Brute Force way and optimized it in Top-Bottom/Bottom-Up fashion and finally optimized it with constant space. I understand you have explained the approaches in a your videos but can you go in a bit more depth as to how you came up with the Brute Force approach and how you thought that I can optimize it in this way. Your videos have been of great help, Thank you.
@eddiej204
@eddiej204 2 жыл бұрын
The best Leetcode channel ever
@d4c98
@d4c98 2 жыл бұрын
Finally I finish all the exercises listed in the dp spreadsheet. It has been a lot of help, thank u. wish there are more summary videos like this.
@hoyinli7462
@hoyinli7462 2 жыл бұрын
thx for your work!
@netraamrale3850
@netraamrale3850 2 жыл бұрын
Thanks alot . Too good....!!!
@DaniyaalKhan2000
@DaniyaalKhan2000 2 жыл бұрын
Are you spying on me? This is literally what I was searching for! xD
@user-zp5zg8py5s
@user-zp5zg8py5s 10 ай бұрын
not he, it is goo...
@elleech6885
@elleech6885 2 жыл бұрын
man i just so love you!!
@director8656
@director8656 2 жыл бұрын
Great Video!!!!, are you a faang employee??
@annabellesun4719
@annabellesun4719 2 жыл бұрын
you are the god !! thank you
@dhruvsakariya3129
@dhruvsakariya3129 11 ай бұрын
Thank you neetcode
@piyushaggarwal5984
@piyushaggarwal5984 2 жыл бұрын
Could you please add the 'Matrix Chain Multiplication' category to this sheet?
@JTNewby
@JTNewby Жыл бұрын
You're my hero.
@river.
@river. 10 ай бұрын
you are the best teacher
@kamauwaweru4991
@kamauwaweru4991 5 ай бұрын
very clear
@AK09037
@AK09037 2 жыл бұрын
Omg ily so much. I think you are missing Matrix Chain Multiplication pattern and DP on trees. But still ILY!!
@ChocolateMilkCultLeader
@ChocolateMilkCultLeader 2 жыл бұрын
Fantastic video
@tawakulislamia9637
@tawakulislamia9637 2 жыл бұрын
You got the subscriber💕💕
@HusainDalal
@HusainDalal 2 жыл бұрын
Thanks!
@RandomShowerThoughts
@RandomShowerThoughts 2 ай бұрын
I think this is really good, though I think we should motivate recursion way more. The grid is fine, but it makes more sense doing that
@VivekMishrathetraveller
@VivekMishrathetraveller 2 жыл бұрын
Can you make a video on Critical connections?
@linhdinh136
@linhdinh136 2 жыл бұрын
Could you please do a video on "Longest Palindromic Subsequence"?
@whonayem01
@whonayem01 2 жыл бұрын
Thanks. You just made it clear. fear---;
@anujonthemove
@anujonthemove Жыл бұрын
From your Dynamic Programming Patterns sheet, I think Fibonacci Number is kind of Linear DP problem whereas House Robber is more of a Decision Making kind of problem so they should not be falling in the same bucket in case you are categorizing them. Any thoughts?
@mithun532
@mithun532 2 жыл бұрын
Thanks a lot ! But after seeing this video i was trying to solve the 1/0 knapsack problem type - equal partition based on tabular method rather than your solution video of the same. Unfortunately I am not able to solve the same can you please create video how tabular method works for the same question ?
@dandyyu0220
@dandyyu0220 Жыл бұрын
I'm just wondering what your adivce would be on how much and what algorithms in terms of coding I should know if I wanna apply for Amazon data scientist role? Thank you!
@Lamya1111
@Lamya1111 2 жыл бұрын
Ace video, mate.
@rajeev_nair
@rajeev_nair 2 жыл бұрын
I don't think 0/1 in 0/1 Knapsack refer to finite/infinite number of the item - its more about if the item put in the knapsack can be fractional or not. 0/1 means either it exists in the knapsack or it does not - in fractional knapsack, you can pick fraction of some item as well -- which would be represented as .someDecimalValue, not 0/1.
@ashishkulkarni2350
@ashishkulkarni2350 3 ай бұрын
Yes correct, this falls in the category of unbounded knapsack where you are not confined to use the element only once.
@yoyo8293
@yoyo8293 2 жыл бұрын
I think Longest Increasing Subsequences (LIS) type problems deserve its own category ... Also Maximum Sum Subarray (Kadanes Algo)
@tabeebyeamin9986
@tabeebyeamin9986 2 жыл бұрын
Yeah LIS is pretty big, you have problems like Russian Doll Envelopes & Box Stacking.
@chiraagpala3243
@chiraagpala3243 2 жыл бұрын
What does for beginners mean? Are there more patterns?
@camiiii272
@camiiii272 2 жыл бұрын
Just what I was looking for, ty! Just a thought maybe you could extend this to other types of leetcode problems?
@NeetCode
@NeetCode 2 жыл бұрын
Good idea, I definitely will try to work on that!
@huangshufen2211
@huangshufen2211 2 жыл бұрын
what is the device / software thatdraws on the screen? very interesting
@aniruddhahehim3616
@aniruddhahehim3616 2 жыл бұрын
Low-key thanks.
@akhilbaktha5609
@akhilbaktha5609 2 жыл бұрын
After i suggested neetcode to my friend’s My friends: should we bow ? Me: Yeah, he’s a king. Really love the content, keep going 🔥
@ChiaDai
@ChiaDai 2 жыл бұрын
Curious what device and software you use to present like this.
@angelosguan6782
@angelosguan6782 Жыл бұрын
Another category that might be helpful here is probably matrix/maze problems
@Grimreap191
@Grimreap191 2 жыл бұрын
KING
@billyfung
@billyfung Жыл бұрын
Amazing
@pemcodegame4918
@pemcodegame4918 10 күн бұрын
What's the whiteboarding software? Do you just use a mouse or some sort of pen tablet?
@MotoDumpling
@MotoDumpling Жыл бұрын
Love it~
@JulianBoilen
@JulianBoilen 2 жыл бұрын
Do you think it okay to solve DP problems with recursion with memoization? It's often much easier for me to conceptualize the recursive implementation than the iterative one. Theoretically it should be the same, but with the use of the call stack.
@arsenypogosov7206
@arsenypogosov7206 2 жыл бұрын
It's slower but it's ok.
@brycechung4460
@brycechung4460 Ай бұрын
This is probably a long shot but can someone explain how the palindrome solutions are DP? Ive seen the individual problem solutions and they all use the expand from center trick which isn't really memoization thus not really DP(at least how I understand it). On LC, I see solutions of more standard DP approaches that use a 2d array to memoize a string from any 2 start&end points.
@avetiqasatryan1540
@avetiqasatryan1540 Жыл бұрын
why you don't use Binet equation for fibonacci ?
@ericc8097
@ericc8097 2 жыл бұрын
right
@hannahruan2764
@hannahruan2764 2 жыл бұрын
how to get the spreedsheet
@subha1818
@subha1818 2 жыл бұрын
Is this the same guy who posts daily dose of internet?
@yilmazbingol4838
@yilmazbingol4838 2 жыл бұрын
Mr. Neet Code. I wanna make a request for 935. Knight Dialer if you struggle to choose a question. it is asked by Facebook and there is no explanation on youtube.
@shivambaghel9668
@shivambaghel9668 2 жыл бұрын
why you don't put this video a the first place in this dp series
@adesuryaramadhan7565
@adesuryaramadhan7565 2 жыл бұрын
can i get the spreedsheet?
@NeetCode
@NeetCode 2 жыл бұрын
Link should be in the description (let me know if its not working)
@sidhartheleswarapu
@sidhartheleswarapu 3 ай бұрын
You're one the rare examples of someone with an American accent who pronounces "new" like "nyoo" instead of "noo"
@Su_Has
@Su_Has Жыл бұрын
Where is the speadsheet?
@NeetCode
@NeetCode Жыл бұрын
Did you check the description?
@Su_Has
@Su_Has Жыл бұрын
@@NeetCode oops thanks
@luxurylifestyle3804
@luxurylifestyle3804 2 жыл бұрын
Binary tree cameras leetcode
@ayush7518
@ayush7518 2 жыл бұрын
Can u please reduce the number of adds it's too much irritating
@exploringnaturalbeauty2102
@exploringnaturalbeauty2102 2 жыл бұрын
5:25
@chilly2171
@chilly2171 2 жыл бұрын
You seem to make things harder with explanation and graphs. You should explain with a datastructure, like in an array or hashmap, etc or say a for-loop etc for context to make it easier to understand.
@20x20
@20x20 Жыл бұрын
the "right?" is pretty distracting
@Bromon655
@Bromon655 11 ай бұрын
I feel so stupid watching these videos.
@EranM
@EranM 2 ай бұрын
n33tc0de, I love u bruh
@angrychick7543
@angrychick7543 Жыл бұрын
Thanks!
@bifidoc
@bifidoc Жыл бұрын
Thanks!
@xyz-abc-free
@xyz-abc-free Жыл бұрын
Thanks!
@Pogibakayo
@Pogibakayo 2 жыл бұрын
Thanks!
@NeetCode
@NeetCode 2 жыл бұрын
Thank you so much Alex!!!
@TerryFrenchy
@TerryFrenchy 2 жыл бұрын
Thanks!
@NeetCode
@NeetCode 2 жыл бұрын
Thank you so much, I really appreciate it! 😊
Top 5 Most Common Graph Algorithms for Coding Interviews
13:01
How I Failed the Google Coding Interview (and lessons I learned)
14:24
Cute Barbie Gadget 🥰 #gadgets
01:00
FLIP FLOP Hacks
Рет қаралды 61 МЛН
1❤️#thankyou #shorts
00:21
あみか部
Рет қаралды 88 МЛН
Mastering Dynamic Programming - How to solve any interview problem (Part 1)
19:41
I quit Amazon after two months
10:09
NeetCode
Рет қаралды 569 М.
5 Simple Steps for Solving Dynamic Programming Problems
21:27
Reducible
Рет қаралды 1 МЛН
Python for Coding Interviews - Everything you need to Know
26:18
How I would learn Leetcode if I could start over
18:03
NeetCodeIO
Рет қаралды 230 М.
Top 8 Data Structures for Coding Interviews
14:00
NeetCode
Рет қаралды 147 М.
The purest coding style, where bugs are near impossible
10:25
Coderized
Рет қаралды 888 М.
How to NOT Fail a Technical Interview
8:26
Fireship
Рет қаралды 1,3 МЛН
The 0/1 Knapsack Problem (Demystifying Dynamic Programming)
20:30
Back To Back SWE
Рет қаралды 201 М.
iPhone 12 socket cleaning #fixit
0:30
Tamar DB (mt)
Рет қаралды 42 МЛН
i like you subscriber ♥️♥️ #trending #iphone #apple #iphonefold
0:14
ВЫ ЧЕ СДЕЛАЛИ С iOS 18?
22:40
Overtake lab
Рет қаралды 127 М.
Купил этот ваш VR.
37:21
Ремонтяш
Рет қаралды 256 М.
Ждёшь обновление IOS 18? #ios #ios18 #айоэс #apple #iphone #айфон
0:57
Bluetooth Desert Eagle
0:27
ts blur
Рет қаралды 8 МЛН