Top 7 Algorithms for Coding Interviews Explained SIMPLY

preview_player
Показать описание
Today we'll be covering the 7 most important algorithms you need to ace your coding interviews and land a job as a software engineer. We'll be showing visualizations, common uses, and time complexity. Hope you enjoy!

📘 Chapters
0:00 - Intro
0:57 - Binary Search
3:43 - Depth-First Search
6:39 - Breadth-First Search
9:13 - Insertion Sort
10:57 - Merge Sort
12:52 - Quick Sort
15:57 - Greedy

🔗 Resources

🎵 Music
Music Courtsey of Epidemic Sound
Wizzle - Guustavv
Slapperoni Pizza - Jobii
Unfettered - Jobii
At My Own Pace - Sarah, the Illstrumentalist
Deadlines - Dylan Sitts
Sleepy + Hungry - baegel
Tea Tree - Jobii
Taargus - Jobii
Pick Up Your Phone Please - baegel
Brontosaurus - Dylan Sitts

#coding #softwareengineer #algorithm
Рекомендации по теме
Комментарии
Автор

Hey guys! Sorry for lack of uploads lately, hopefully this 20 MINUTE comprehensive guide to algorithms makes up for it a bit! Please like and share with friends, I worked really hard on it and want it to help lots of people!

Codebagel
Автор

Algorithms

Binary Search:
- Used to find a specific element in a sorted list efficiently.
- Inefficient: O(n) for linear search, incrementally guessing from start to end.
- Efficient: O(log2(n)) for binary search, repeatedly dividing the search interval in half until the correct element is found.

Depth-First Search (DFS):
- Begins at the root node and explores as far as possible along each branch before backtracking.
- Utilizes a visited array to track already visited nodes.
- Continues backtracking until all nodes are visited.
- Real-life example: Solving a maze by systematically exploring paths until the exit is found.

Breadth-First Search (BFS):
- Looks at every node at one level before going down to the next level.
- Utilizes a visited array to track already visited nodes and a queue to keep track of neighbors.
- Begins at the root node and adds it to the visited array and all its connected nodes to the queue, then continues to explore nodes level by level.
- Real-life example: Chess algorithms predict the best move by exploring possible moves at each level of the game tree.
- Runtime: O(V + E), where V is the number of vertices and E is the number of edges.

Insertion Sort:
- Examine’s each element in the list, comparing it with the previous elements and shifting them to the right until the correct position for insertion is found.
- Simple sorting algorithm suitable for small datasets or nearly sorted arrays.
- Runtime:
- Best case: O(n) when the list is already sorted.
- Worst case: O(n^2) when the list is sorted in reverse order.
- Efficient for small or nearly sorted lists, but inefficient for large unsorted lists.

Merge Sort:
- A divide-and-conquer sorting algorithm that breaks the problem into smaller subproblems and solves them recursively.
- Starts by splitting the array into halves recursively until each subarray consists of single elements.
- Merges pairs of subarrays by comparing elements and placing them in sorted order.
- Continues merging subarrays until the full array is sorted.
- Runtime: O(n log(n)) in both best and worst cases, making it efficient for large datasets.

Quick Sort:
- A complex sorting algorithm that follows the divide-and-conquer approach and is recursive.
- Selects a pivot element, ideally close to the median, and partitions the list into two sublists: one with elements greater than the pivot and the other with elements less than the pivot.
- Continues the process recursively on each sublist until the entire list is sorted.
- Utilizes a pivot element that is moved to the end of the list, with pointers positioned at the leftmost and rightmost elements.
- Compares the elements pointed to by the left and right pointers, swapping them if necessary, until the pointers cross.
- Once the pivot is correctly positioned, the process repeats on the sublists.
- Runtime:
- Best case: O(n log(n)), when the pivot consistently divides the list into approximately equal halves.
- Worst case: O(n^2), when the pivot selection consistently results in unbalanced partitions.

Greedy Algorithm:
- A problem-solving approach that makes the locally optimal choice at each stage with the hope of finding a global optimum.
- May not always guarantee an optimal solution but is often simple and efficient.
- Real-life example: Finding the shortest path in a weighted graph using Dijkstra's algorithm, where at each step, the algorithm selects the vertex with the smallest distance from the source.

shadowrl
Автор

I love how you put each algorithm into a use case context. That is literally the only way my interest based nervous system works. My hat is off to you sir. Keep it up.

jasonbelcher
Автор

Why does this channel have only 55.6K subscribers? Dude you are a gem! Love your videos, they are very helpful!

NikosS-id
Автор

Code examples would help a lot too, great video

Redyf
Автор

thank you bro, my gf broke up with me so i have nothing but to learn algos, your video made me laugh at the greedy algo part. thank you u earned a sub

bb-xjed
Автор

Thank you for simplifying algorithms for me! I learned a lot from you, keep up this amazing tutoring 🙏🏻

LenSys-AE
Автор

This is an incredible video. I didn't understand most algorithms as a student, because I focused on theories and code. This video helps me save time in understanding these popular algorithms. Indeed, I rarely use them in my work, it is simply because we don't have many situations to apply. I usually use linear search in JavaScript. there was a time I had a problem with sort of 10, 000 objects. I have to use the binary-sort library without understanding. Once again, thanks for your video.

ngocchaunguyen
Автор

Commenting for the youtube algorithm! Binge watching your videos to prepare for my technical interview. VERY helpful!!

bigyabajracharya
Автор

This video is amazing! I was so surprised when I went to subscribe that you only had 5k subscribers, from the quality of these videos I expected at least 100k! Thank you for your awesome work, you really helped me a lot

originallyme
Автор

I enjoyed the explanations and presentation about the different important algorithms in this video. I am subscribing to this channel in the hope of similar good content in the future. Wish you the best with growing your channel :)

omgh
Автор

The quality of your videos is insane! Keep going, the growth of your channel is bound to happen!

redfinance
Автор

Thanks for this video! I’m starting to prepare for technical interviews now, and this is a big help!

BbB-vruh
Автор

You should explain how machine learning works and more of that types of videos too, your explanation is on another level

wlqpqpqlqmwnhssisjw
Автор

Bravo, the effort shows in the quality, detail and simple concise delivery.

semilife
Автор

For the traveling salesman, I would use a set of controlled variables that you could programmatically cycle through to optimize results. One example would be a tolerance on overlapping routes. Cycle through 0-10 overlaps and calculate results. Compare results. As long as you keep the number of variables and variable values low, it’s a great way to squeeze out extra optimization.

LastShade
Автор

Brother, You gotta be my best teacher on youtube. You making lesson just the way I want. You start a topic by first being pause. Then continue with the easiest way possible.
Please make more videos like these.

tamalpaul
Автор

With content like this you'll be big in no time, excited for what's to come!

durantburner
Автор

Bro, these explanations are truly great and easily digestible. Hopefully there is more to come!

markost.
Автор

just found your channel and the videos are awesome. Amazing balance between simplicity and coverage for the topics

largato