Before Your Next Interview Watch This
- January 7, 2024
- Posted by: MainInstructor
- Category: BASIC Go JavaScript Node Web Development
![*](https://i0.wp.com/allprowebdesigns.com/wp-content/uploads/2024/01/1704666784_maxresdefault.jpg?resize=840%2C430&ssl=1)
Video Title: Before Your Next Interview Watch This
Have you ever been overwhelmed by the sheer number of data structures and algorithms you need to learn and just not knowing where to start well in this video i’m going to share with you the 10 most important data structures and algorithms you need to know in order to land your
Very first job and at the end we’re going to be turning it up to 11 because i’m going to give you a bonus tip that’s going to be important across all the interviews no matter where you go so let’s get started now Welcome back to web dev simplified my name is kyle and my job is to simplify the web for you so you can start building your dream project sooner so if that sounds interesting make sure you subscribe to the channel for more videos just like this now to get started we’re going to be
Going over probably the most infamous data structure out there which is a linked list i actually have an entire tutorial on how to create a linked list in javascript i’ll link up in the cards and description for you but essentially a linked list is one of multiple types either a singly linked
List double a linked list or you can have a circular linked list which could also be doubly linked as well but essentially the way a linked list works is it’s very similar to an array in how the data is structured it’s a list of items but unlike an array instead of having
Indexes and positions in an array where your items are each item in a linked list points to the next item in the linked list or in the case of a doubly linked list it points to the next item and it also points to the previous item which is where you have these arrows
That point forward and point forward or in this case they point forward and point backwards so you can kind of tell where in the array you are you can get the next item or you can get the previous item and link through an array like that this is great for certain things like
Insertion into an array like this is very quick because you can insert right into here and just change the next position from one to another and that’s going to work just fine but if you wanted to for example get an individual element at a specific index
That is going to be much slower than a traditional array so there’s definitely pros and cons to a linked list but understanding a linked list overall how it works and how to create one is going to be crucial for pretty much any interview that you go into
Now the next type of structure that you should understand is going to be trees in general but more specifically we’re going to be talking about the binary tree because the binary tree is probably one of the most popular tree structures out there and it’s asked about all the time inside of different interviews
And really the only features you need to know about when it comes to a binary tree is that in a binary tree you have a root node so you have one node at the very top and every single node in your tree can have at most two children so you can see
This root node two here has two children seven and five seven has two children two and six six has two children five only has one child and nine only has one child that’s because you can have at most two children or zero children or one child either way with a binary tree you
Can only have at most two children which is super important so the important thing to understand about a binary tree when it comes to structuring out in your code is each node is going to have a value in our case these values are numbers like two and seven
And they’re also going to have a left and a right and those left and right just point to other nodes so this left points to the node seven and this seven node has a left that points to two and a right that points to six
Six has a left that points to five and a right that points to eleven so you can have this tree structure which you can navigate by using these left and right properties of each of the nodes and you can get the value of each one of them
So understanding binary trees and how to do different operations on them such as reversing binary trees or sorting binary trees is really important for interviews now this next data structure is something you’re almost always going to be implementing or using inside of an interview and that is either a stack
Or a queue of some kind and these are lumped together because they’re both very similar to one another so first we’re going to talk about the stack and then talk about the queue with the stack what’s happening is just like a stack in real life imagine you
Have a stack of papers or a stack of books when you approach this stack of books and you have a book in your hand you put your book on the top of the stack and then if you need to take a book off the stack
You take the book off of the top of the stack this is why stacks are generally called last in first out or lifo for short and essentially all that means is the last item that gets put onto the stack is the first one that gets taken off
When you need to take something off and with this demonstration here you can see that usually the push method is used to push something on top of a stack and then we call pop to pop the item off the stack and as you can see push puts it on the top
And pop takes it off the top so always the very last thing that you put on is the first thing you take off and the very bottom of the stack is the very last thing that gets taken off and that’s the first thing that gets put onto the stack
Now cues are just like a cue in real life like a line that you’re going to wait in to get something you go to the very back of the line when you enter and the person that’s in the front of the line is the first one taken off
So this is first in first out the first person in line is going to be the first person that gets helped while the last person in line is the last person that gets helped so usually the methods you use with a cue are nq and dq
But you could also use things like push and pop if you really wanted or add or remove the really important thing is that when you enqueue an object onto a queue you put it in the back and when you dequeue something off you take it off of
The front of the queue so this is called first in first out and understanding when to use a stack when to use a cue and how they work or even how to create them is super important when it comes to landing your interview next we’re going to mix things up and
Talk about an algorithm and this algorithm is merge sort and merge sort is a type of divide and conquer algorithm where you take a large problem of sorting an array and you divide it into smaller and smaller subsets until you essentially have nothing else to do and then you take these small
Subsets of just one element and start conquering them by combining them together over and over and over again until we get to a final sorted array this is much quicker than algorithms such as bubble sort so this is why it’s really important to understand another algorithm that you might want to
Understand is going to be quick sort there’s very few differences between quick sort and merge sort when it comes to the performance of them merge sort is generally going to be a little bit quicker but it does take up more space so you have to kind of weigh the space
Versus time complexity to figure out which one is more important but both of them are divide and conquer algorithms that work in similar yet different ways so understanding merge sort and possibly quick sort are crucial in your interview prep now this next type of data structure is one that you’re most likely very
Familiar with especially if you use something like javascript before and this is the idea of a map a dictionary or even like a hash table really all it’s doing is taking some key and converting that key to a value in some kind of storage method so in javascript you could use an object
For this also you could use a map inside of javascript they actually have a map built into javascript and a map is very similar to an object it takes keys and values and allows you to convert between a key to a value if you want to learn more about this map
Object i have an entire blog article on it linked in the description below but understanding how this dictionary map kind of idea works and how you can convert from keys to values is super crucial and something you’re going to use definitely inside of an interview but
Most likely this is one that you already know now this next type of data structure is going to be a graph of really any type the two main types you’re going to run into are an undirected graph and a directed graph and really the only difference is a
Directed graph points you in the direction that you can go from one node to another for example here we can go from two to zero from zero to one one to two we could go from zero to two and so on well in this undirected graph over here
We can go from zero to one or zero to two it doesn’t matter because there is no direction and the most important thing to understand about a graph is how they’re actually structured inside of a code so generally graphs are going to have things called vertices or nodes these
Are going to be essentially the places where your graph can point to so for example this one four three two zero and generally these are gonna have some type of value associated with them in our case one zero two three four these are just numbers and then between your different vertices or nodes
You’re going to have edges and the edges are just the lines that connect one vertice to another vertices so the way that these different vertices connect is called edges and these edges can also have a value to them for example it could be like how long it takes to go from one
Location to another so take for example google maps google maps is kind of like a graph because you graph how you get from one point to another point following a bunch of edges that connect vertices these edges would be the roads and the vertices would be essentially
The places where you can turn from one road to another road and those roads they have lengths associated with them for how long the road is how slow it is how long it’s going to take so google maps essentially can calculate all of these different things related to the edges of this graph
And can determine the best path for you through the graph based on the different values of each of the vertices and each of the different edges so understanding how a graph is laid out how it looks in code and just in general how you can use them to do different calculations is super
Crucial now another important algorithm that you should understand is going to be the binary search algorithm because it’s used all over the place and is pretty efficient what it does so understanding how it works is really crucial and binary search is very similar to that divide and conquer style algorithm
You start with your array it has to be a sorted array and what you do is you go to the very dead center of that sorted array and you say okay in our case we’re searching for 13 so is 13 greater than 11 or less than 11.
We say okay 13 is greater than 11 so we look at the right half of the array we go to all the values greater than 11. we again go to the dead center and say okay is 13 less than or greater than 19. it’s less than so we go to this next section
Over here which is 1317 and we just happen to choose 13 as our starting point because it’s the center in our case we don’t actually have a true center so it just chooses one of the two values that’s the center in our case we get 13 exactly chosen so
With binary search we’re kind of doing that divide and conquer thing where we’re constantly cutting the array at half over and over again which is where it gets that binary name from because it cuts in half over and over and over again until we finally get to the value that
We’re actually looking for now understanding how this actually works and how you can implement this in your language of choice is going to be really useful in an interview because questions related to binary search and other search algorithms are really really popular in interviews and binary search is probably the most
Popular search out there when it comes to web development now while we’re on the topic of search i also want to talk about two more popular search algorithms which are breadth first search and depth first search and they’re pretty straightforward you just think about the name
With a depth first search over here on the right you essentially want to go as deep as possible first so this is a just binary tree here and you start by going all the way down one side until you get all the way to the bottom
And then you go up one level and go again till you get all the way to the bottom you go up again down all the way till you get to the bottom up a little bit down all the way so you’re just constantly trying to search
As deep as you can at first and with a breadth of first search what you’re doing is you’re essentially going down one level and searching all the way across that level and then once you finish that you go down to the next level and search all the way across that level
Down again and all the way across so you’re really trying to search from the shallowest all the way down to the deepest and the deepest is the very last thing you do so you can kind of think about breadth first search is going to left to
Right on a you know binary tree like this well depth first search is going top to bottom it’s going up down up down up down up down while breath first search is left right left right red light really there’s not many differences between these two when it comes to performance
But depending on the problem that you’re trying to solve one may be slightly more efficient than the other and just understanding what they are and how to explain them and talk about them in an interview is super important a lot of times you may not actually be
Asked to implement these or use these but just being able to talk about them with an interviewer because you might get asked questions about the differences between the two is really important to understand and the next thing i want to talk about really isn’t an algorithm or data
Structure but it’s more of a concept that’s really important to understand and that concept is memoization i actually have an entire video on the concept i’ll link in the cards and description for you but in short essentially memoization is when you calculate a value and you store that value to use later so
If you try to recalculate the same value you already have it saved memoization is really useful for when you have to calculate something a lot of times with the same inputs or if you need to calculate something that takes a long period of time and you’re going to calculate it again in
The future a common example used with memoization is the fibonacci sequence because there’s a ton of repeats in the fibonacci sequence so here we can see we’re searching for f of zero f of one f of two f of three we’re just passing these numbers into the fibonacci sequence
And you can see that f of three requires us to figure out the value of f of 1 and f of 2. we’ve already calculated f of 1 so we don’t need to recalculate it same here with f of 2 it’s already been calculated so we’ve saved all these
Steps that are x out f of 3 saves all these x doubt steps f 4 since we already saved it we already can just remove all these x out steps so essentially instead of recalculating the value of what 4 is when we pass it into our function
We saved it from the first time we calculated it and we can just get that value from a cache a memory and that’s what memoization is you just save the output of a calculation that way when you have to redo the calculation you can use the saved output instead of recalculating everything over
And over and over again and with things like fibonacci sequence it’s incredibly important and it’s going to save you tons of computation time now the final concept before we get to the bonus one is going to be recursion and recursion is a pretty simple concept of having a function
Call itself so you have a function that calls itself which calls itself which calls itself until eventually it exits out of itself and goes all the way down the stack a famous example of recursion is this image you can see we have one giant triangle and then this giant triangle is composed
Of three smaller triangles that are all exactly the same and those three triangles are composed of three triangles that are all the same and so on and so on and so on all the way down this is a recursive drawing because everything is composed of itself we just have this one triangle element
And that triangle element is made out of itself and that thing also makes other bigger triangle elements so that’s what recursion is you’re just calling the same function over and over again i again have an entire tutorial on recursion i’ll link up in the cards and description down below
Now the final bonus thing that i want to talk about is going to be big o notation and that’s because big o notation is pretty much used in every single algorithm and data structure that you can think of because it’s going to calculate the time and space complexity of your algorithm
That you’re writing out so understanding how you can use big-o notation is incredibly important and again i have an entire tutorial on big-o notation i’ll link up in the cards and description down below but essentially with big-o notation you’re just taking a look at your algorithm
And figuring out okay how many times am i doing an operation am i doing it n times so if i have an n length array i put inside of here am i doing the n times am i doing n squared times 2 to the n times n factorial times
Or is it really quick maybe it’s just constant time where i’m just doing it once no matter how big the array is being able to calculate this big-o notation is absolutely crucial you’re going to get asked this in pretty much every interview that you go to so just
Having a basic understanding of big-o notation is going to put you a step ahead of everyone else that doesn’t understand it and those right there are the most important data structures and algorithms that you need to understand if you enjoyed this video make sure to check out my other videos linked over
Here and subscribe to the channel for more videos just like this thank you very much for watching and have a good day
-
Sale!
Wireless WIFI Repeater Extender Amplifier Booster 300Mbps
$29.99$14.99 Add to cartWireless WIFI Repeater Extender Amplifier Booster 300Mbps
Categories: Electronics, Wi-Fi Router, Wireless Wi-Fi Extender Tags: 300Mbps, 802.11N, Amplifier, Booster, Extender, mobile wi-fi booster, Remote, WIFI, Wireless, Wireless WIFI, Wireless WIFI Repeater, Wireless WIFI Repeater Extender, Wireless WIFI Repeater Extender Amplifier, Wireless WIFI Repeater Extender Amplifier Booster, Wireless WIFI Repeater Extender Amplifier Booster 300Mbps$29.99$14.99 -
Sale!
Full RGB Light Design Gaming Headset Headphones with Mic
$24.99$14.99 Add to cartFull RGB Light Design Gaming Headset Headphones with Mic
Categories: Electronics, Gaming, Gaming Headsets Tags: Design, Full, Full RGB Light Design Gaming Headset, Full RGB Light Design Gaming Headset Headphones, Full RGB Light Design Gaming Headset Headphones with Mic, Gamer, Gaming, Gaming Headset Headphones, gaming headset wireless, Headphone, Headphones, Headset, Light, Mic, Package, RGB$24.99$14.99 -
Sale!
Wireless BlueTooth Multi-Device Keyboard Mouse Combo
$39.99$19.99 Add to cartWireless BlueTooth Multi-Device Keyboard Mouse Combo
Categories: Electronics, Gaming, Gaming Keyboards, Keyboard Mouse Combos Tags: Combo, Keyboard, keyboard mouse combos, Mouse, MultiDevice, Set, WireKeyboard Mouse Combo, Wireless, Wireless BlueTooth Keyboard Mouse Combo, Wireless BlueTooth Keyboard Mouse Combos, Wireless BlueTooth Multi-Device Keyboard Mouse Combo, Wireless BlueTooth Multi-Device Keyboard Mouse Combos$39.99$19.99 -
Sale!
High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar
$199.99$139.99 Add to cartHigh Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar
Categories: Gaming, Gaming Chairs Tags: Adjustable, Chair, computer chairs, Desk, Executive, Gaming, Girl, Headrest, High, High Back Leather Executive Adjustable Swivel Gaming Chair, High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest, High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar, High Back Leather Executive Adjustable Swivel Gaming Chairs, Leather, Lumbar, Office, Racing, Swivel$199.99$139.99 -
Sale!
Professional LED Light Wired Gaming Headphones with Noise Cancelling Microphone
$29.99$19.99 Select optionsProfessional LED Light Wired Gaming Headphones with Noise Cancelling Microphone
SKU: N/A Categories: Electronics, Gaming, Gaming Headsets Tags: Cancelling, Gaming, Gaming Headphones with Noise Cancelling Microphone, gaming headset, Headphones, Headset, LED, Light, Mic, Microphone, Noise, Professional, Professional LED Light Wired Gaming Headphones, Professional LED Light Wired Gaming Headphones with Noise Cancelling Microphone, Wired, Wired Gaming Headphones, Wired Gaming Headphones with Noise Cancelling Microphone$29.99$19.99 -
Sale!
Gaming Desk with LED Lights USB Power Outlets and Charging Ports
$349.99$249.99 Select optionsGaming Desk with LED Lights USB Power Outlets and Charging Ports
SKU: N/A Categories: Computer Desk, Gaming, Gaming Desk Tags: and Charging Ports, Charging, Desk, Desks, Gaming, gaming desk with led lights, Gaming Desks with LED Lights, Home, LED, Lights, Monitor, Office, Outlets, Port, Power, Room, Stand, USB, USB Power Outlets, White, Workstation$349.99$249.99 -
Sale!
Wired Mixed Backlit Anti-Ghosting Gaming Keyboard
$99.99$79.99 Add to cartWired Mixed Backlit Anti-Ghosting Gaming Keyboard
Categories: Electronics, Gaming, Gaming Keyboards Tags: Antighosting, Backlit, Blue, brown, Gaming, Gaming Keyboard, gaming keyboards, gaming keyboards and mouse, Keyboard, Laptop, Switch, Wired, Wired Mixed Backlit Anti-Ghosting Gaming Keyboard, Wired Mixed Backlit Anti-Ghosting Gaming Keyboards, Wired Mixed Backlit Gaming Keyboard$99.99$79.99 -
Sale!
Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset
$119.99$59.99 Add to cartWireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset
Categories: Electronics, Gaming, Gaming Headsets Tags: 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset, ANC, Audio, Bluetooth, Cancellation, Ear, Earphone, gaming headset, Headphones, Headset, Hi-Res Over the Ear Headphones Headset, HiRes, Noise, Wireless, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Headphones, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headsets$119.99$59.99 -
Sale!
Wired Sports Gaming Headset Earbuds with Microphone
$19.99$9.99 Select optionsWired Sports Gaming Headset Earbuds with Microphone
SKU: N/A Categories: Gaming, Gaming Headsets Tags: Accessories, Earbud, Earphone, Earphones, Gaming, gaming headset with microphone, Headphones, Headset, IOS, Microphone, Sports, Wired, Wired Sports Gaming Headset Earbuds, Wired Sports Gaming Headset Earbuds with Microphone, Wired Sports Headset Earbuds$19.99$9.99 -
Sale!
150W Universal Multi USB Fast Charger 16 Port MAX Charging Station
$49.99$29.99 Add to cart150W Universal Multi USB Fast Charger 16 Port MAX Charging Station
Categories: Charging Stations, Electronics Tags: 150W, 150W Charging Station, 150W Universal Multi USB Charging Station, 150W Universal Multi USB Fast Charger 16 Port MAX Charging Station, 150W Universal Multi USB Fast Charger 16 Port MAX Charging Stations, 150W Universal Multi USB MAX Charging Station, 16 Port MAX Charging Station, 3.5A, Charger, Charging, Fast, laptop charging stations, Max, Multi, Port, Stand, Station, Universal, USB$49.99$29.99
Thank You So Much for this wonderful video………🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻
Just popped the matrix of the Contra code! Great stuff.
10:30 😅😂
linked list being on any interview is the most deciduous thing ever
thanks
This channel has many great contents but this sounds too abstract. Would,ve been too much help if you touched even slightly about on their application.
Shalom Jedi K, I hope you and your wife are doing well.
Thank you very much for all of your effort, hard work and for sharing.
Shalom
Thank you for this video,
One advice : give a real life example of a useCase to be able to understand why do we use them,
i'm not a fan of just explaining without examples.
1. Linked list
2. Trees (binary tree)
3. Stack and queue
4. Merge sort algorithm, quick sort
5. Map, hash
6. Graphs
7. Binary search
8. Breadth first search, depth first search.
9. Memorization
10. Recursion
11. Big O notation and complexity
I think it should be enough for frontend devs to know and explain those structures without much coding. Thank you man!
Are these data structures/algorithms really necessary for a Front-End web developer interview?
thank you brother, small duration but massive information ..just like a stack..waiting to be watched ^^
useless
isnt the term "balanced tree", i guess so 😀
You showed BigO and Linked List. Can you show some of the others in new videos?
F(Xn)=F(Xn-1) => Fibonacci sequence.
Binomial convergence- search function => the best
Sum( of n of 1/(2^n)) => converges to a search result number, thing or an array, depending on the loop iteration. BIG key point is determining how deep you search, depending on the time required to determine the result.
In a binary search section, the greater then and less than operators are reversed (should be 11 < 13, 19 > 13).. Thanks for creating a nice overview!
Ohh man,I never get bored while watching your tutorials because those are on point, easy to understand for absolute beginners and with real life examples which makes it even easier to understand even better.. Thanks Kyle!!
Always the best content, thank you Kyle
They don't really ask these type of questions for Front End
Hi Kyle ,please make one complete detailed video on Data Structure and algorithm using JavaScript .,
I have been looking for a video like this forever. Just wanted something that listed out the different algorithms so I can dive deeper into each one and learn them. So many videos want you to watch 8 hours of them talking about 1 algorithm or data structure which is fine but I like to see the 10,000 ft overview first to setup a learning plan vs trying to chase down each algorithm that may or may not be used in interviews. Thanks man.
This is incredibly similar to management consultant's frameworks
Do we need this to be a front end web developer
WDS: Recursion is simple
Me: …. Winces
Math Prof: Given the following alogrithim, state the recursive formula along with it's asymtotic runtime. You have 5 minutes. Presents a non homogenous 3rd degree linear recursion
Me: When will this recursive nightmare end? 🤔😭
I just gave up to become a developer who works for someone else! I'm working on my programming skills and I live on the back of my family for now. I hope someday I can build something and live with the royalties that my product brings in!
4:50 I think that would be last in first out no? Can someone explain me?
Hi, Do you have real examples with all 10 types of algorithms?
I haven't implemented any of these things since I learned them, because why would I reinvent the wheel just so I can prove I understand wheels. Makes no sense. Just because I can't build a calculator physically myself doesn't mean I can't use one and it doesn't mean I don't know when to properly use one over something else like mental math, but that's the interview game I guess. Extremely archaic and nonsensical. Thankfully I never had to deal with this crap when interviewing. Just had to build a few applications.
I'm here after the vid saying ' I got my first fullstack dev job knowing html, css some js,'you can do it just apply', and here's a huge 'but' , perfectly discouraging 😅
Awesome vid man. I do gotta say it cracks me up every time you say memoization lol, sounds like Elmer Fud trying to say memorization.
Keep up the great work webdev!
"Verti-see" 😂
This was a very good video on beginner CS topics but I really disagree that these are essential to an interview. I work for a large company and for every person we interview, the biggest takeaway question is “will this person fit well in our team?”
100/100 times I will take someone who has no clue what a binary tree is but shows technical aptitude and is a great team member, over a person who has outstanding technical knowledge and is totally useless in collaborative settings and writes code in a vacuum.
If you’re prepping for an interview, sure be ready to answer some technical questions to prove your aptitude, but you need to focus more on the personal aspect of showing how you can fit with what that team needs and play to your strong suits. If you’re not an amazing back end developer, don’t pretend to be an expert on development of these low-level structures and algorithms — in no way am I ever going to need some junior developer to rewrite these well established and well documented concepts. I want a junior deveoper who understands they don’t know anything and are willing to adjust and pivot to fill the holes on whatever our team is struggling with.
I am glad you don't recommend FAANG. I don't like FAANG either.
Uhhh…Array infamy > LL infamy…
thanks Kyle, so great content
Instead of all these kind of irrelevant algo's for a js dev. People could've asked what's an "ArrayList" and why are js "arrays" are secretly "ArrayLists"? Or what's a hashtable and why most of the times js objects are implemented as hashtables, yeah I know they were implemented as linked lists somewhere.
It's much more useful to know this stuff, than an abstract binary tree, which you probably never use.
Video is nice and has a lot of valuable information, but I feel it is quite misleading. I have worked as front-end developer in 10 companies, that means I have passed 10 interviews, that means I have been in 30+ interviews. And yet, I have not been asked a single data structure question or asked to do data algorithm task in my interview.
If you are junior developer, don't stress on these too much, better spend your time on understanding how JavaScript works and what are good/bad practices. You can be very successful without being data guy. But if you know it, of course it will help. 🙂
In the binary search section (8:17) your less than and greater than signs are backwards on the right hand side. Should be 11 < 13 and 19 > 13. Very distracting.
Very cool stuff, though if you go for an interview for a "web dev" job and they starting asking you about this stuff, either they have lied about the job description or the interviewer just looked up generic programming interview questions and hasn't got a clue.