🎯 Key Takeaways for quick navigation: 00:00 📚 *Introduction to Common Algorithms in Coding Interviews* - Overview of frequently asked algorithms in tech company interviews. - Emphasis on the 80-20 rule in algorithm knowledge for interviews. 00:30 💡 *"Top k Elements" Algorithm* - Explanation of the "top k elements" algorithm and its application. - Use of heap data structure for efficiency in finding k largest elements. 01:52 🖥️ *"Sliding Window" Algorithm* - Introduction to the "Sliding Window" algorithm for various problems. - Example using Largest Substring without repeating characters. 03:17 🔙 *Backtracking Method* - Concept of backtracking explored with the Combination Sum problem. - Use of recursion in backtracking algorithms. 05:07 🧮 *Dynamic Programming Approach* - Differences between backtracking and dynamic programming. - Application of dynamic programming in solving the Combination Sum problem. 07:02 🌐 *Graph Traversal: BFS and DFS* - Explanation of Breadth First Search (BFS) and Depth First Search (DFS). - Comparison of BFS and DFS in graph traversal, and their respective data structures. Made with HARPA AI
I was taught all these in university, but never told how, why or where they are used. I have started to use these in my personal projects after watching your video. Thanks a bunch for spreading this valuable knowledge. And of course I do plan to use this info for coding interviews in the future apart from my projects 😅
Jesus christ you are an absolute beast at this, best educational content I've seen I think! Concise, informative, simple but not superficial.. Thank you so much!
If you don't need to return the elements in order, Top k elements can be optimised even further with quickselect to Time complexity of O(n + k) => O(n) AND bringing down the space complexity to O(1) too. Quickselect has a worse time complexity of O(n^2), but picking the pivot randomly each time gives O(n). The chances of always picking a bad pivot that would make it O(n^2) with a random pivot is so small, that papers assume it never happens.
Just a question: You can do one for loop to get the largest let -> n Another one to remove that won’t -> n Repeat it 2 times so we get too 3 elts ->O(5n) = O(n) Am I correct ? If it’s too 3 elts, but I see that a heap might be better if we want the top k elts and if K is very large
I like how you explain recursion - I always draw a stack and dive into each step but that's just cost a lot of time. And 127 interviews is just impressive! Keep up the good work power couple! 🙌💪
For k largest/smallest elements we can do heapify which works in O(n) and then take k element in constant time. Second option is counting sort which works in O(n +k)
Even with heapify in linear time, taking k elements is still klogk since when the top element is removed, the heap moves the last element to the top to replace it and sifts down, which is log k operation
Whenever I am getting demotivated u just create a video and it makes me think dsa is easy. I dont know whether your calming voice or the way you explain. Thanks a lot .
Sahil, amazing Video. Loved the way you explained the problem with an animation. Highly recommend you launching a course in DSA using Python with similar explanation 🙏
IIt's impressive to hear about your experience with 127 interviews and the algorithms they focused on. However, I'm curious about the circumstances that led to such a high number of interviews. Do you think there are specific factors or challenges that contributed to this? It would be really insightful to hear your thoughts on how to efficiently navigate the job market, especially for those who might find themselves in a similar situation.
Very good explication. There are algorithms here I've never heard of or for that matter never had any use for in my developer career but it's nice to broading your knowledge of things. Thank you for sharing.
I'm a computer science student, I'm doing cloud computing now, I'm bad at networking and I hate it, but I'm in love with programming, please help me !!! Especially professional persons give me advices, roadmap anything to make me in the right way
Wow, Nice explication even for someone who do not speak english I understand everything, Nice video editing everything was perfect, thanks for sharing your knowledge :)
0:44, just out of curiosity, what's the name of the serie/movie, please. Also, thank you so much for all the time, effort and quality behind your content, it really helps the brazillian intern making about US$3.34/h in a 30h/week job (Real is not at it's best), going night in and out learning new things and getting better at those I already know, hoping for better days where I will no longer have to tell my 5y daughter that 'today daddy doesn't have cash for sweets'. Love from Brazil. ❤
@@sahilandsarra Thank you, and thank you so much for the support! Being a single dad is no easy task, and her mom is not that present in her life as she once was, so she really looks at all my efforts day 'n night and shows her pride by trying to copy me, get's one of her story books, sits next to me, opens it half way like a laptop, and stars typing on the page while saying: "Look! I'm working, just like you dad!" My 76y old mom also needs my attention, since she has many health problems, and the home office in my actual job position made it possible for me to take care of both my mom and my daughter, so I'm already happy to be a full stack intern (Java/Spring, React/TypeScript) even if payment is not that good at the start. Every day is a struggle to even put food on the table, but I'm more than certain that every effort I put on to this, will one day, sooner or latter, payoff and all of that will be just a shadow in the past. To end this comment on a positive note, today I've received the new that I'm one of 25 people, in a long process with almost 8k submissions in the first stage of it, for a course in DevOps with a great company called "Nuclea CIP SA". At any moment of the course (btw, the course is 100% that's free of charge), they can hire one of us based on our advances. So, crossed fingers. (maybe one day I'll be a Full Cycle Dev, who knows?!)
Asking candidates about algorithms is a bit stupid because knowing algorithms doesn't make you a good programmer. The key to be a good programmer is understanding the concepts like refactoring, design, clean code, objects and interfaces, SOLID principles and unit tests...
@@danschey390 the best programmers know a lot of useful principles and patterns by heart and not so many useful algorithms beyond the basic algorithms for most common problems.
"Algorithms + Data Structures = Programs" was a 1976 book by Wirth, the designer of the Pascal programming language. Algorithms were all the rage in computing 50 years ago. Train yards and queuing in the 1960's, sorting, traversal and scheduling in the 1970's for Operations Research, an entire field that shortly disappeared. Then the focus turned to symbolic processing and other problems because algorithms were largely solved and available by calling libraries. While worthy of study for students, algorithms as questions in interviews for professional jobs shows a complete misunderstanding of solving real world problems and what a healthy code base should look like.
I'm always surprised when an interviewer doesn't follow with questions on how I'd implement in production code since, as you point out, most langauges have optimized solutions for us to leverage. However... DS-Algo challenges are the best way to determine candidate understanding of the computer science behind implementation choices. It's the best way to differentiate real coders from script-kiddies.
@@feroast1My first developer question is always "has any of your code made into a production environment?" Most people actually answer no. I have no idea what people do all day.
Pretty much. No one is writing algorithms by hand. That would be a colossal waste of time. Guess it sorta explains why FAANG employ so many people though.
Thank You for doing this. I subscribed to your channel as I love your videos. Can you recommend a best site that is good for learning and practicing these algorithms to pass most coding interview questions. Reply highly appreciated.
What company is asking you dynamic programming questions? Those are really hard to answer fast in a 45 min interview and teams and companies I've interviewed do not like asking them.
How long in average should take for a person to master all of these algorithms? As many things the answer is always it depends, but I would like to you from you who is reading this comment, how long did it take to you to master these algorithms? 😮
@@aliiucer you are considering the best case scenario, mostly folks talk about worst case complexity & average case complexity when talking about an algorithm.
1. Practically yes, most companies filter candidates by DSA online test. 2. For DSA don't use Java as it is very verbose so it is takes more time in time constraint environment. I personally use python, javascript should be fine as well.
Try my free email crash course to crush technical interviews: instabyte.io/
1. Top-k Largest Elements
2. Sliding Window
3. Backtracking
4. Dynamic Programming
5. DFS and BFS
Vice versa
Bonus Algorithms at the end of video:
6. Topological Sort
7. Dijkstra's Algorithm
@@muneebzubair8443 8. Tree
Copied
@@muneebzubair8443😅
1. Top-k Largest Elements(from array)
2. Sliding Window(longest substring without repeating characters)
3. Backtracking(combination/target sum, word ladder, permutation, sudoku solver)
4. Dynamic Programming(combination/target sum)
5. DFS(implemented using stack(LIFO)) and BFS(implemented using queue(FIFO))
ex-Dijkstra's Algorithm, Topological sort
🎯 Key Takeaways for quick navigation:
00:00 📚 *Introduction to Common Algorithms in Coding Interviews*
- Overview of frequently asked algorithms in tech company interviews.
- Emphasis on the 80-20 rule in algorithm knowledge for interviews.
00:30 💡 *"Top k Elements" Algorithm*
- Explanation of the "top k elements" algorithm and its application.
- Use of heap data structure for efficiency in finding k largest elements.
01:52 🖥️ *"Sliding Window" Algorithm*
- Introduction to the "Sliding Window" algorithm for various problems.
- Example using Largest Substring without repeating characters.
03:17 🔙 *Backtracking Method*
- Concept of backtracking explored with the Combination Sum problem.
- Use of recursion in backtracking algorithms.
05:07 🧮 *Dynamic Programming Approach*
- Differences between backtracking and dynamic programming.
- Application of dynamic programming in solving the Combination Sum problem.
07:02 🌐 *Graph Traversal: BFS and DFS*
- Explanation of Breadth First Search (BFS) and Depth First Search (DFS).
- Comparison of BFS and DFS in graph traversal, and their respective data structures.
Made with HARPA AI
I was taught all these in university, but never told how, why or where they are used. I have started to use these in my personal projects after watching your video. Thanks a bunch for spreading this valuable knowledge. And of course I do plan to use this info for coding interviews in the future apart from my projects 😅
Hey, Have you landed a job yet? What is your primary language?
bro send me money too i have pay for my college fees ( small help will be appreciated)
We want a video on top 5 most asked data structures
Yeess
+1
+1
Hi all! Thanks for the suggestion. Will post it this weekend 😊
@@sahilandsarra thank you so much
Jesus christ you are an absolute beast at this, best educational content I've seen I think! Concise, informative, simple but not superficial.. Thank you so much!
I like how you explain simply with a very calm voice things that might seems complex at first!
Great work!
If you don't need to return the elements in order, Top k elements can be optimised even further with quickselect to Time complexity of O(n + k) => O(n) AND bringing down the space complexity to O(1) too.
Quickselect has a worse time complexity of O(n^2), but picking the pivot randomly each time gives O(n). The chances of always picking a bad pivot that would make it O(n^2) with a random pivot is so small, that papers assume it never happens.
Just a question:
You can do one for loop to get the largest let -> n
Another one to remove that won’t
-> n
Repeat it 2 times so we get too 3 elts
->O(5n) = O(n)
Am I correct ?
If it’s too 3 elts, but I see that a heap might be better if we want the top k elts and if K is very large
I like how you explain recursion - I always draw a stack and dive into each step but that's just cost a lot of time. And 127 interviews is just impressive! Keep up the good work power couple! 🙌💪
Thanks Kexin! Love your videos 🫶
@@sahilandsarra Thanks for your videos, i'm learning python thanks to you, where can learn GoLang, datacamp isnt teaching this programming language
This is great work. Please continue giving info about interviews, so that I can train my students better.
1. Top-k Largest Elements ( 0:46 - 1:00)
2. Sliding Window (1:01 - 3:30)
3. Backtracking ( 3:30 - 5:03)
4. Dynamic Programming ( 5:06 - 7:00)
5. DFS and BFS ( 7:02 - 7:54)
I would suggest using Quick Select to solve problems where you have to return top K elements, since it has O(n) average time complexity
Thanks for sharing 👍
U can mention quick select but I won’t try to code it up in interviews
@@moneymaker7307 why?
@@anon1963 it's kind of hard
I never really understood backtracking until I realized that it should be called quit when there’s no point going on
Thanks for sharing your knowledge with out any cost
Thanks for watching.
Right... I'm so grateful for the knowledge sharing 💕
For k largest/smallest elements we can do heapify which works in O(n) and then take k element in constant time.
Second option is counting sort which works in O(n +k)
Even with heapify in linear time, taking k elements is still klogk since when the top element is removed, the heap moves the last element to the top to replace it and sifts down, which is log k operation
We can solve it in O(n) time using bucket sort.
Your videos are so helpful, I inevitably end up saving them in a playlist so I can refer to them later whenever I need guidance. Thank you so much.
Thanks 🙏
His calmness is scaring.
😂😂
😂
😂
Nice and simple explanations! Thanks for uploading this
Thank You So Much for this wonderful video..............🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻
Whenever I am getting demotivated u just create a video and it makes me think dsa is easy. I dont know whether your calming voice or the way you explain. Thanks a lot .
Thanks 🙏 👍
i think its his gay voice he got in iit delhi which makes him very calm
Bonus Algorithms at the end of video:
6. Topological Sort
7. Dijkstra's Algorithm
0. A*, Bellman Fords, Floyd Warshall
Thanks for sharing this. I think a better title would be "Top 5 Algorithm Patterns they asked me" other than that, great work!
Sahil, amazing Video. Loved the way you explained the problem with an animation. Highly recommend you launching a course in DSA using Python with similar explanation 🙏
It would be awesome if you make a series explaining these algorithms
IIt's impressive to hear about your experience with 127 interviews and the algorithms they focused on. However, I'm curious about the circumstances that led to such a high number of interviews. Do you think there are specific factors or challenges that contributed to this? It would be really insightful to hear your thoughts on how to efficiently navigate the job market, especially for those who might find themselves in a similar situation.
Bro what an animation, how did you learn this top notch editing bro ❤
i love your calmness while explaining
Very good explication. There are algorithms here I've never heard of or for that matter never had any use for in my developer career but it's nice to broading your knowledge of things. Thank you for sharing.
Definitely make a top data structures video sahil! Also love your videos
👍
You are calmer than the buddhist monks. Listening to you is nirvana... 😁🤓🤗 Thanks for sharing your experience 👍👍👍 love and respect
Please do a video about the top 5 data structures!
The music sound at the end was perfectly placed.
This guy speaks so politely it just doesn't feel he is speaking and he also must be saving a lot of energy 😂
Thanks for the video!
I'm a computer science student, I'm doing cloud computing now, I'm bad at networking and I hate it, but I'm in love with programming, please help me !!! Especially professional persons give me advices, roadmap anything to make me in the right way
Wow, Nice explication even for someone who do not speak english I understand everything, Nice video editing everything was perfect, thanks for sharing your knowledge :)
Thanks 🙏
Hi Sahil, I loved your videos❤. Your voice is so dense😊. May God bless you.
Thanks ❤️
Nice video content selection is also good
Thanks ❤️
Sahil, thank you . Please do a video about the top 5 data structures!
🙏👍
0:44, just out of curiosity, what's the name of the serie/movie, please. Also, thank you so much for all the time, effort and quality behind your content, it really helps the brazillian intern making about US$3.34/h in a 30h/week job (Real is not at it's best), going night in and out learning new things and getting better at those I already know, hoping for better days where I will no longer have to tell my 5y daughter that 'today daddy doesn't have cash for sweets'. Love from Brazil. ❤
The movie is called: “Everything Everywhere all at once”. From this comment, I can tell that your daughter must be so proud of you. ❤️
@@sahilandsarra Thank you, and thank you so much for the support! Being a single dad is no easy task, and her mom is not that present in her life as she once was, so she really looks at all my efforts day 'n night and shows her pride by trying to copy me, get's one of her story books, sits next to me, opens it half way like a laptop, and stars typing on the page while saying: "Look! I'm working, just like you dad!"
My 76y old mom also needs my attention, since she has many health problems, and the home office in my actual job position made it possible for me to take care of both my mom and my daughter, so I'm already happy to be a full stack intern (Java/Spring, React/TypeScript) even if payment is not that good at the start.
Every day is a struggle to even put food on the table, but I'm more than certain that every effort I put on to this, will one day, sooner or latter, payoff and all of that will be just a shadow in the past.
To end this comment on a positive note, today I've received the new that I'm one of 25 people, in a long process with almost 8k submissions in the first stage of it, for a course in DevOps with a great company called "Nuclea CIP SA". At any moment of the course (btw, the course is 100% that's free of charge), they can hire one of us based on our advances.
So, crossed fingers. (maybe one day I'll be a Full Cycle Dev, who knows?!)
I’m sure you’ll do great in life. I wish you all the luck 👍
Asking candidates about algorithms is a bit stupid because knowing algorithms doesn't make you a good programmer. The key to be a good programmer is understanding the concepts like refactoring, design, clean code, objects and interfaces, SOLID principles and unit tests...
😂
clean code and solid principles REQUIRES you to know algorithms or else your run time will be horribly slow
@@Samir-rd8xp knowing many algorithms before you need to use them in your code is against YAGNI principle.
Knowing algorithms doesn't make you a good programmer, but the best programmers know a lot of useful algorithms.
@@danschey390 the best programmers know a lot of useful principles and patterns by heart and not so many useful algorithms beyond the basic algorithms for most common problems.
im confused if these are the coding problems or the algorithms, because we use algorithms to solve these that you mentioned right?
"Algorithms + Data Structures = Programs" was a 1976 book by Wirth, the designer of the Pascal programming language. Algorithms were all the rage in computing 50 years ago. Train yards and queuing in the 1960's, sorting, traversal and scheduling in the 1970's for Operations Research, an entire field that shortly disappeared.
Then the focus turned to symbolic processing and other problems because algorithms were largely solved and available by calling libraries.
While worthy of study for students, algorithms as questions in interviews for professional jobs shows a complete misunderstanding of solving real world problems and what a healthy code base should look like.
I'm always surprised when an interviewer doesn't follow with questions on how I'd implement in production code since, as you point out, most langauges have optimized solutions for us to leverage. However... DS-Algo challenges are the best way to determine candidate understanding of the computer science behind implementation choices. It's the best way to differentiate real coders from script-kiddies.
@@feroast1My first developer question is always "has any of your code made into a production environment?" Most people actually answer no. I have no idea what people do all day.
Pretty much. No one is writing algorithms by hand. That would be a colossal waste of time. Guess it sorta explains why FAANG employ so many people though.
Amazing explanations!!
Thanks 🙏
Yes, pls make a video on Top 5 Data Structures
Thank You for doing this. I subscribed to your channel as I love your videos. Can you recommend a best site that is good for learning and practicing these algorithms to pass most coding interview questions. Reply highly appreciated.
What tool do you use to display the code in the video? I have a presentation to do and would like to use something similar.
yes we want a video on top 5 data structures
If someone is starting from 0, what do you recommend they start with? I mean, what is the best learning path?
I love your videos each time something new very interesting topics
Thanks 🙏
Would be great if u upload lectures on dynamic programming! Great content go ahead.
Top k-frequent elements with heap is also N * log(N) time complexity.
Hey man why don't you start giving tutorials.I believe you can deliver them way better than many people
Every of your video is Awesome please do a playlist on DSA
I will be very thankful for considering of my comments
Keep it up❤❤❤
👍❤️❤️
Would love to see the some data structure videos.
👍
I like the way you speak!
Thanks 🙏
Please make a video on most commonly used algorithms and data structures with use cases. Include not only 5 but also the other commonly used ones
Thanks sir make a video on Android app development from java what things we follow and learn for beginning
Please explain top 5 algorithms in detail
And make more this type of video
Requesting you to kindly start a DSA course/boot camp - it would be very much helpful - thank you
yes, We want a video on top 5 most asked data structures
We want top 5 most asked data structures
What company is asking you dynamic programming questions? Those are really hard to answer fast in a 45 min interview and teams and companies I've interviewed do not like asking them.
Hi Power Couple, to crack coding interviews is needed to have a academic formation of data structures and algo? Thanks
I can do these algorithms even if someone ask me in the middle of sleep. however I am still worried about the upcoming interview
I recently completed my mern stack course whenever I tried to build any website by my one I get stucked at start how can I improve ? Please
top 5 DSA asked, we need a video on this topic
Yes please Top 5 Data structures.
How good do we need to know algorithms for front-end interviews?
Sometimes it is hard to understand you because of your English, but thank you for the video overall.
Must make video - Top 5 most asked Data Structures
How long in average should take for a person to master all of these algorithms? As many things the answer is always it depends, but I would like to you from you who is reading this comment, how long did it take to you to master these algorithms? 😮
For the "Top k elements" for your solution the complexity is actually O(nlogn), since in worst case scenario k tends to n.
no it can never exceed nlogk, assume k==1 so there is no way to make it nlogn
@@aliiucer you are considering the best case scenario, mostly folks talk about worst case complexity & average case complexity when talking about an algorithm.
@@muditjaiswal actually k is a different variable than n so nlogk is a better choice, worst case is a different thing
sir please make a detailed video on dsa as whole about topics most ques are asked
It’s already linked at the end of the video.
top 5 most asked data structure is needed
Please make videos on top 5 data structures
Hey bro, Im finding it difficult to find the time complexity for back tracking sum. Can you please a video about that?
I always watching ur videos and learned alot
Thanks
It okay that you have selected for 127 interviews but can you please explain what you did in your resume to shortlist for those interviews.
awesome video, the way you are speaking I feel I am listening to an AI machine. Thanks :)
What is the practical application of these algorithms?
please make a video on flow state and how to get into it
I have already made it.
can you please make a detailed video on most asked data structure Topics In an interviews ?
Really needed sir kindly teach
Nice video 👍
👍❤️
Waiting for the top 5 system design concepts asked in Google interviews ❤
Binary Search is not in the list?
Could you please make a video on the future of developer after 5 years from now ? As chatGPT and AI is evolving.
abe bhai itni videos bna chuka hai abhi tak voice ki volume aur tuning shi nhi kr paya. But great content though.
is there any difference between java and python algorithm courses except the fact one is written in java while the other is written in python?
No
Do I need to master DSA while I want to become a full stack web developer?
If I need to study DSA which language you prefer Java or JavaScript ?
1. Practically yes, most companies filter candidates by DSA online test.
2. For DSA don't use Java as it is very verbose so it is takes more time in time constraint environment. I personally use python, javascript should be fine as well.
@@shashankshekhar4208 ok thanks 👍
Love you bro I inspire you
Please make a video on the top 5 datastructures
big fan sir
Thanks 🙏
@PowerCouple, please make one video on calculating Time complexity
sorry what is log(k)? is that log base 10 of k.
CAN YOU PLEASE MAKE A FULL COURCE ON DSA, BCOZ YOUR WAY OF EXPLANATION IS MINDBLOWING
Spooky oO
Hello
do you do a personal coaching call or is there some way I can connect with you …..I am really lost in this journey and needed some help
Thanks
Sir can you please tell me the proper guild line to start programming journey
For Fe students