How I Got Good at Algorithms and Data Structures

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey what's up YouTube so my channels based around coding in general but primarily algorithms and data structures and studying for the technical interview a lot of you comment stuff like I can't do leak code easy questions I can't do easy hacker in questions I'm having trouble starting off how do I start off what do I need to know before I start doing these problems and I just want to give a guide for what you should know I guess before you start these questions and then once you know that stuff what resources I've used to get to the point where I'm able to go out and get a job whenever I want I actually just got a brand new job and it was on my second interview it was that easy so I just want to talk about how the resources I've used to study to get to the point where I'm at I'm gonna give you every single resource right here and that's it so the number one thing that you need to know before you start prepping for your interviews they're learning algorithms and data structures to solve leak code easy hacker and easy questions is you need to understand what data structures are and what time complexity is there's no way for you to come up with an optimal solution if you don't understand how one solution differs from another as far as time and space complexity so you're not gonna be able to know how to improve a solution if you don't know how to improve time complexity if you don't know how to identify a solutions time complexity and then improve it so you need to know how to do that first I'm gonna give you an example right now so for example if we have an array and we want to print each element and let's say one iteration takes one second meaning if we're doing a for loop in printing each element in the array it takes one second to print five then one second to print one then one second to print negative ten so it would be one second two seconds three seconds four seconds five seconds six seconds so each iteration is a second this algorithm is a linear time algorithm because the seconds go up with the number of iterations directly in a linear fashion so as our data set grows so if we have a data set of size six it takes six seconds if we have a data set of size six million it takes six million seconds now when we have an algorithm that involves nesting for Lu we're looping through the entire array with the inner for loop so this inner for loop is living through the whole array for each iteration of the outer loop so you could see that this is an event squared you could see how much slower this is moving so if you're looking at this and it takes one second for iteration look one two three four five six that was the whole time it took for the one little for loop algorithm but now we're going back seven eight nine 10 11 12 13 14 15 16 17 18 and in this case whereas the data set grows the time it takes to do this also grows but in an N squared fashion so if the data set is size two it takes four seconds if the data set is size 6 million it's not six million seconds like the other algorithm it is a huge number so that's why there's a huge difference in an algorithm of nesting for loops versus a single for loop and there's a huge difference between an N squared algorithm and an O of n algorithm and there's a huge difference between an n log n algorithm and an O of n algorithm so even just small differences in time complexity make a huge difference as the data set grows so that's why it's really important that we come up with good algorithms to solve these problems so what you need to be able to do is look at an algorithm look at a solution that you've come up with and identify what is the time complexity as the data set grows in Big O notation so there's au maintenance our Oliv log of n like binary search o oven a linear search o then log in like sorting oo of N squared o of 2 to the end o of n to the N over N factorial there's all these different time complexities you need to be able to look identify them what time complexity your solution is and then figure out can you make an improvement to it to make it an optimal time complexity for the problem that you're given now oftentimes understanding how to improve these time complexities is going to be based on your knowledge of algorithms fundamental algorithms and fundamental data store nature's so you're really gonna have a difficult time getting into doing leak code hacker rank and just preparing for technical interviews in general without the fundamental understanding of fundamental algorithms fundamental data structures so you need to take some kind of course or learn these in some way however you may do it want to do it to get this fundamental information like time complexity like space complexity like the fundamental algorithms and data structures and once you have that just a basic understanding you don't need to understand everything but just a basic understanding then you can move over to these sites and that's where you can really kind of start to figure everything out do it pattern recognition and get better so the first thing I'd recommend doing is starting with data structures algorithms often involve using data structures so you want to be familiar with these first an easy way to get started is just typing data structures in on Google or YouTube and watching some of these videos I highly recommend CS dojo and hacker rank this crash course also might provide a very good overview but I really like all three of these specific channels you might want to start with some overview videos to try and understand what a data structure means in general even though it's really just a structure for data some structures are better in certain scenarios so using some data structures in certain scenarios will be more beneficial than other data structures right and once you understand that or just looking at a brief overview you might want to hop into these hacker ranked videos or you can see you know they get a little bit more detailed and specific you can look at stacks and queues specifically linked to list specifically tree specifically these aren't going to give you every detail about them but they will give you an overview of each individual data structure and these are a lot of the basic ones so hash tables trees tries heaps stacks queues linked lists arrays all of that watch all of these videos another site I used a lot was course there at Coursera has some really good courses on data structures and algorithms University of California San Diego I took this course it was pretty good I took an algorithms course on Coursera offered by Stanford now was also really good now I would recommend if you're gonna take some of these Coursera courses not getting too wrapped up in the proofs in technical details they provide because sometimes they go into a little bit more detail than necessary what you guys really just need to do is understand the basics and just understand why we need to use certain data structures another course I really really liked even more than the Coursera courses was this MIT opencourseware algorithms course a lot of these algorithms courses you'll find online will go into data structures at the same time but specifically I really like the videos by this guy Eric domain so feel free to watch these as well now I'm not saying that you have to understand everything about data structures algorithms right I'm saying you need to know the basics basic data structures basic algorithms and so don't get into the details too much but also what I say you're comfortability level should be after you are ready to move on to solving problems is when you can implement these data structures so if you can code the data structures by just opening a text editor in writing for example class linked to list and starting to implement it so maybe go on YouTube and look up how to implement a linked list followed by whatever programming language you'd like to use and if you're comfortable with reading their sites like geeks for geeks or just blogs and articles on other sites like medium where you can find them just explain it in text so if you don't want to watch a video you can just scroll down and they'll show you with images and text how to implement a linked list so really understand the operations look up the time complexities of the operations for the data structures and say hmm why would I want to use a linked list over an array in this case why would I want to use a hash table in this case and once you understand that I think you'll be ready to jump into leak out and hacker Inc one side I've mentioned multiple times in the past is primp it's one of the only free peer-to-peer videochat connections where you can sign up and get connected with other engineers who are studying for these interviews as well this isn't a sponsor I just really really endorsed this because I used it a lot really helped me there's not too many sites where you can just meet random engineers who are learning algorithms and data structures and ask them questions like pram so maybe check out this website as well I think it's really helpful but other than that just reach out to your friends if you have questions I'm if you have friends that are engineers they might have gone through this and they might be able to explain something that's really confusing talking to other engineers is one of the best way to understand concepts so communicate with people now I did read some books but I do think they were really technical and I thought the videos explained a lot better but I read some of this book so introduction algorithms this is a really popular famous book I read some of it just because of how much it was recommended to me but I did find videos a little bit better one book I definitely loved was cracking the coding interview this book is super helpful in for me understanding time complexity and other things in general just about the interview process I think this Gail Walkman with Dahle just really puts you in the right headspace for the interview so I definitely highly recommend this also not a sponsor but this more than the other book so these are most of the resources that I used I will link them in the description but also I did go to college so I took algorithms and data structures in college I wouldn't say the algorithms course was any better than things online but I learned a lot of data structures while I was in college specifically how to implement data structures and when I got stuck I did have a teacher that I could ask so find a way to communicate with other people so when you get confused you can ask someone who knows that's very much it guys I forgot to record an outro so this is just me hanging out in my room so thanks for watching let me know as use if you are successful in algorithms and stuff and yeah that's pretty much it those are all of the resources like everything from when I was in college until now of what I've looked at and understood a lot of YouTube videos a lot of online courses the algorithms course in college did not hope so really the only thing from college I would like to his data structures you know than that everything else was online so so there's definitely a way to really get good at him online and then once you have all that stuff down like I said then you're ready for Lee code and hacker rank and yeah start with the easy ones where's your way up that's pretty much it thanks for watching see you in the next one [Music]
Info
Channel: Nick White
Views: 463,756
Rating: undefined out of 5
Keywords: algorithms, data structures, coding, programming, algorithm, data structure, computer science, tech, technology, developer, software engineering, software engineer, technical interview, software development, software developer, coding interview, google, facebook, amazon, microsoft, interview, computers, science, computer science fundamentals
Id: 9-ubSA9GA3o
Channel Id: undefined
Length: 11min 24sec (684 seconds)
Published: Sun Mar 15 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.