Master the Coding Interview: Algorithms + Data Structures | Andrei Neagoie | Skillshare

Master the Coding Interview: Algorithms + Data Structures

Andrei Neagoie, Senior Software Developer + Instructor

Play Speed
  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x
88 Lessons (8h 43m)
    • 1. Master the Coding Interview

      3:47
    • 2. How to Succeed

      5:04
    • 3. 01 Introduction

      5:39
    • 4. 02 Resume

      5:09
    • 5. 03 Resume Walkthrough

      17:05
    • 6. 04 Resume Review

      2:37
    • 7. 05 What If I don't have experience

      15:03
    • 8. 06 LinkedIn

      8:22
    • 9. 07 Portfolio

      3:23
    • 10. 08 Email

      8:24
    • 11. 09 Where to find the jobs

      6:02
    • 12. 10 When should you apply?

      3:34
    • 13. 11 Summary

      2:17
    • 14. 00 Environemnt Setup

      2:53
    • 15. 01 Introduction

      2:24
    • 16. 02 What is good code?

      6:57
    • 17. 03 Big O and Scalability

      11:08
    • 18. 04 O(n)

      5:39
    • 19. 05 O(1)

      6:10
    • 20. 06 O exercise

      5:54
    • 21. 07 O exercise2

      2:29
    • 22. 08 Simplifying Big O

      1:50
    • 23. 09 Rule 1

      4:28
    • 24. 10 Rule 2

      6:36
    • 25. 11 Rule 3

      3:13
    • 26. 12 O(n^2)

      7:13
    • 27. 13 Rule 4

      6:47
    • 28. 14 Big O Cheat Sheet

      3:18
    • 29. 15 What does this all mean?

      5:32
    • 30. 16 O(n!)

      1:18
    • 31. 17 3 pillars of coding

      3:32
    • 32. 18 Space Complexity

      2:22
    • 33. 19 Exercise Space Complexity

      6:24
    • 34. 20 Twitter exercise

      7:13
    • 35. 21 Review

      4:43
    • 36. Optional: Javascript Loops

      3:27
    • 37. 01 Introduction

      1:58
    • 38. 02 What are companies looking for?

      3:05
    • 39. 03 What we need to learn

      3:27
    • 40. 04 google interview exercise

      2:31
    • 41. 05 Problem Solving

      20:33
    • 42. 06 Problem Solving 2

      22:59
    • 43. 07 Google revisited

      1:30
    • 44. 08 Review

      3:35
    • 45. 01 Introduction

      1:58
    • 46. 02 What is a Data Structure

      5:53
    • 47. 03 Down the rabbit hole

      12:33
    • 48. 04 Data Structures in Different Languages

      3:27
    • 49. 05 Data Structure Operations

      3:05
    • 50. 06 Arrays

      13:51
    • 51. 07 Static vs Dynamic Arrays

      6:40
    • 52. 08 Implementing an Array

      17:19
    • 53. 09 Strings and Arrays

      1:04
    • 54. 10 Exercise Reverse string

      1:35
    • 55. 11 Solution Reverse string

      10:31
    • 56. 12 Exersise Merge Sorted Arrays

      0:44
    • 57. 13 Solution Merge Sorted Arrays

      14:12
    • 58. 14 Review Arrays

      3:28
    • 59. 15 Hash Tables

      4:10
    • 60. 16 Hash Function

      5:56
    • 61. 17 Hash Collisions

      9:43
    • 62. 19 Hash Tables in Different Languages

      3:30
    • 63. 20 Exercise Hash Table

      3:51
    • 64. 21 Solution Hash Table

      17:24
    • 65. 22 Solution Hash Table Extra

      6:11
    • 66. 23 Hash Tables vs Arrays

      2:01
    • 67. 24 Exercise First Recurring Character

      1:18
    • 68. 24 Solution First Recurring Character

      16:11
    • 69. 25 Section Review

      6:09
    • 70. 01 Introduction

      2:26
    • 71. 02 What is a Linked List?

      4:36
    • 72. 03 Exercise Why Linked Lists?

      2:05
    • 73. 04 Solution Why Linked Lists?

      5:35
    • 74. 05 What is a pointer

      5:45
    • 75. 06 Our First Linked List

      8:38
    • 76. 07 append()

      5:25
    • 77. 08 prepend()

      2:27
    • 78. 09 Node Class

      2:40
    • 79. 10 insert()

      5:12
    • 80. 11 insert() solution

      13:08
    • 81. 12 remove() solution

      5:21
    • 82. 13 Doubly Linked List

      3:18
    • 83. 14 Soultion Doubly Linked List

      8:50
    • 84. 15 BEFORE doubly vs singly linked list

      2:40
    • 85. 15 Exercise Reverse linked list

      1:30
    • 86. 16 Solution Reverse linked list

      7:38
    • 87. 17 Review Linked Lists

      5:07
    • 88. Where to go from here?

      0:11
33 students are watching this class

About This Class

Want to land a job at a great tech company like Google, Microsoft, Facebook, Netflix, Amazon, or other companies but you are intimidated by the interview process and the coding questions? Do you find yourself feeling like you get "stuck" every time you get asked a coding question? This course is your answer. Using the strategies, lessons, and exercises in this course, you will learn how to land offers from all sorts of companies.

Watch a preview here: https://links.zerotomastery.io/datastructures_academy

Many developers who are "self taught", feel that one of the main disadvantages they face compared to college educated graduates in computer science is the fact that they don't have knowledge about algorithms, data structures and the notorious Big-O Notation. Get on the same level as someone with computer science degree by learning the fundamental building blocks of computer science which will give you a big boost during interviews. You will also get access to our private online chat community with thousands of developers online to help you get through the course.

Here is what you will learn in this course:

Technical:

1. Big O notation

2. Data structures:

* Arrays
* Hash Tables
* Singly Linked Lists
* Doubly Linked Lists
* Queues
* Stacks
* Trees (BST, AVL Trees, Red Black Trees, Binary Heaps)
* Tries
* Graphs

3. Algorithms:

* Recursion
* Sorting
* Searching
* Tree Traversal
* Breadth First Search
* Depth First Search
* Dynamic Programming

Non Technical:

- How to get more interviews
- What to do during interviews
- What do do after the interview
- How to answer interview questions
- How to handle offers
- How to negotiate your salary
- How to get a raise

Unlike most instructors, I am not a marketer or a salesperson. I am a senior developer and programmer who has worked and managed teams of engineers and have been in these interviews both as an interviewee as well as the interviewer.

My job as an instructor will be successful if I am able to help you become better at interviewing and land more jobs. This one skill can really change the course of your career and I hope you sign up today to see what it can do for your career!

Taught by:

Andrei is the instructor of the highest rated Web Development course on Udemy as well as one of the fastest growing. His graduates have moved on to work for some of the biggest tech companies around the world like Apple, Google, JP Morgan, IBM, etc... He has been working as a senior software developer in Silicon Valley and Toronto for many years, and is now taking all that he has learned, to teach programming skills and to help you discover the amazing career opportunities that being a developer allows in life. 

Having been a self taught programmer, he understands that there is an overwhelming number of online courses, tutorials and books that are overly verbose and inadequate at teaching proper skills. Most people feel paralyzed and don't know where to start when learning a complex subject matter, or even worse, most people don't have $20,000 to spend on a coding bootcamp. Programming skills should be affordable and open to all. An education material should teach real life skills that are current and they should not waste a student's valuable time.   Having learned important lessons from working for Fortune 500 companies, tech startups, to even founding his own business, he is now dedicating 100% of his time to teaching others valuable software development skills in order to take control of their life and work in an exciting industry with infinite possibilities. 

Andrei promises you that there are no other courses out there as comprehensive and as well explained. He believes that in order to learn anything of value, you need to start with the foundation and develop the roots of the tree. Only from there will you be able to learn concepts and specific skills(leaves) that connect to the foundation. Learning becomes exponential when structured in this way. 

Taking his experience in educational psychology and coding, Andrei's courses will take you on an understanding of complex subjects that you never thought would be possible.  

See you inside the courses!

Transcripts

1. Master the Coding Interview: welcome to master the coding interview, a course that helps you take your programming career to the next level. Whether you are a self top programmer looking for your first developer job, a computer science student or even a career veteran and engineer courses designed to gay you through an interview at some of the top tech companies while making you a better program, I'm Andre, a senior software developer that has consulted and worked for some of the biggest tech firms, both in Toronto and Silicon Valley. I've worked with and managed numerous engineering teams and have been part of numerous interviews as an educator. Over 60,000 programmers have taken my courses last year alone. The Golden this course is not to teach you what 90% of the population does. The goal is to teach you to stand up and be an exceptional programmer during the coding interview. And unlike most courses that just less a ton of problems and give you a solution, I take you from lessons that teach you the principles and fundamental ideas to doing exercises and problems together, step by step coding along So you understand how we do things and most importantly, why we? Do you think this course is actually two courses built into one? The first part is computer science theory and technical coding interview problems. You're going to learn algorithms and data structures and big o notation from scratch. In each section, you're going to be solving riel life interview problems that I've selected based on importance from Google, Netflix, Microsoft, Facebook and Amazon. The second part of the course is the non technical interview preparation. There are sections that take you from how to get Mawr interviews, how to form on your resume portfolio linked in even get up. How to answer common non technical question. How to handle offers as Wallace negotiating a raise specifically for engineers. With this course, you will get a lifetime access to over 200 videos, as well as cheat sheets on resumes, interview problems and step by step instructions on what to do during a whiteboard coding injury. You'll also get access to our online community that has thousands of developers chatting online, solving interview problems together in doing monthly coding challenges while helping you get through the course. I'm proud to say that we have the most active developer community on you, Demi. The beauty is that everything you learned in this course is not programming language specific. Although I use javascript to demonstrate code, all the questions and principles you learned can be done in all types of programming languages. You also find my solution files and interactive exercises using rebel, which can be written in different languages. You won't have to go around buying different books, different tutorials and seeing which is up to date and which is not. This course is complete and will be updated as the industry evolves so that you can always come back to it whenever you are looking to interview in the future. Although we spend most of our lives working the actual time, preparing and studying for an interview is very small. Let's gain that extra edge because once you learn it, you have it for life. By the way, if this course does not do what it promises, we have a 30 day money back guarantee, no questions asked. I look forward to helping you succeed in this journey. Have a look at the next video to see the course breakdown. See you inside 2. How to Succeed: you know yourself and how you learn best. This isn't a video of me just telling you how to learn. Instead, I want to point out some things that may help you get the most out of this course based on how this course is structured. Think of this course as having two courses into one. The first part right over here is the non technical aspect of the interview. These are the skills that you will use through all your career to get a leg up from the competition and make sure that you are able to optimize your chances of getting a well paid job that you love. We're gonna be talking about how to get Mawr interviews and talk about all these topics right over here. We'll also talk about non technical interview questions, the most common questions that we had asked in an interview and how to overcome them and then finally talk about offer and negotiation on often overlooked skill, where we talk about how to a handle, offers and even negotiate a race. The second part of the course is all technical. This is the really fun part of the course where we learn fundamental computer science topics that get asked at some of the top companies. And don't let this diagram intimidate you. By the end of the course, you're gonna master all these topics. We're going to learn about data structures like El Rey's stacks, trees, graphs and in specific ones like priority queues, binary search Tree Doubly Link list. We're going to learn about algorithms, how to traverse a tree and a graph. How to use Rikers in properly, how to improve time, complexity and big o notation. How do we do sorting, perhaps even searching all with the goal to help us, right? Better code and answer interview questions. One of my favorite sections here is when we're going to take you through a Google interview and demonstrate each piece of the puzzle so that by the end of it all, you're able to answer really difficult questions as if you were part of that interview. By the end of it, you're gonna feel confident in any quoting interview or white board interview at the end. We're also going to have a Thanh of questions for you to do on top of the ones that were going to do together from all these companies, plus specific questions, whether you want to be a front end engineer or a back and engineer. So you have three options with this course. If you want, you can just do each course separately, and that is fine. However, the courses, structured in a way that these two courses are ordered to make you understand the topic, bill the fundamentals and really connect the dots on interview. So to get the most out of this course, you should follow the lessons in order, since you may gain an insight or two, even if you thought I'll leave me alone. Andre already know this stuff. So now that you have an idea of the outline, let's talk about what it means to succeed in this course. First, make sure you use our online discourse community to communicate with fellow students, ask questions and talk about anything you may want. When it comes to interviews, there's nothing better than talking out loud and practicing in front of people or with others. I'm also active every day on this community. The second part, these exercises get harder and harder in each section. They will challenge you and make you really extend your abilities as a developer, this is done on purpose. We're going to be building our foundation throughout the course and do challenging problems so that when it comes to riel interviews, you find things easy. Although I walk you through the solutions I encourage you to use available resource is to solve the answer. Think of it this way. If someone offered you $10,000 bonus to study interview questions for a month, would you do it? That is why you're doing practicing for this by working hard and practicing what most people don't do. Interviewing You're putting yourself in a higher salary position for the rest of your life . The third point. I know it sounds silly, but it's important any time you feel like you're just watching a video and aren't understanding a topic, stop what you're doing and take a break. Come back to the problem. You won't be able to finish this course in one week. If you do it properly, it will take you a about one month to finish everything in here. So take your time. This isn't a sprint. It's a marathon. Finally, try to complete the full course instead of just parts of it. Most lessons are tied into one from another so that they flow and we keep building. This pyramid of knowledge will start from basic and get into more and more advanced topics . All right, I think it's time for us to start the course and get prepared to line our dream job. Let's get started and see you in the next section. No, by 3. 01 Introduction: Hello. All right, I'm very excited. The very first section all the course now. In order to get any job, you need to have interviews in order to get any interviews you need to actually apply and get these interviews. If you're the best interviewer, the best at answering questions, solving puzzles, the best coder it won't really mean much if you're unable to get an interview at a company and get them to see you. So the first step is also this getting the actual interview. Now the number one thing we need to do is to increase these oughts the odds of getting an interview. The MAWR interviews you get, the more likely to get a job. The best way to get a job on top of being a good interviewer is getting in the door as much as possible and practicing your interviews. We're starting this course with this first step, so that even just a few minutes into the course, you can start applying to jobs in practice. Your interviewing skills as most companies won't get back to you right away. So while you go through the course, you can start applying to companies and wait to hear back from them. And while you're waiting, you can practice your actual interviewing skills. So by the time that the interview comes, you're gonna be ready for it. So let's have this goal in mind. If I apply to 100 companies, how can I increase the number of companies that will get back to me with interviews? We want to increase this percentage by the end of this section on once your success rate to be higher than 1% 5% maybe, maybe higher. It doesn't matter. As long as we're able to increase this by increasing your percentage, you're getting closer and closer to that dream job. If you're applying to 100 jobs and you're not hearing back from any of them, or you only get one interview, that's 1% then you're probably doing something wrong. So we're going to take a look at that and make sure that you're following best practise, and you're also doing a couple of tricks to make sure that your success rate isn't necessarily 1%. However, there is some good news for you. Interviewing is a numbers game. A person who has failed ah 100 interviews and got rejected but got one. Acceptance. A Google is just the same as a person that has never failed an interview and is now working at Google with you, despite them having offers from all the other companies never failing an interview, always a sing their coding interviews that doesn't really matter. At the end of the day, all you need is that one really good offer and you're in the same boat as somebody else. How awesome is that in your resume? You don't put down how many times you failed. Your resume looks the same as I shine over there. Well, maybe that's a bit of an exaggeration, but I hope you get this point. Your resume looks the same as a person who never got rejected at an interview. That's the good news. And as a matter of fact, I know a person who has been rejected by Google multiple times but kept applying and is now working at Google. So in the upcoming section, we're gonna be talking about some of these topics, and it should not take you more than a week to set everything up and start applying to jobs . If you are spending more than that, then you're wasting your time when you could be doing something better, such as improving your actual skills as a programmer. Don't get me wrong. You can keep improving here and there to optimize things, but the overall effort you put in to set things up before you start applying should be less than a week. Most people spend too much time editing their resume and never applying to jobs, but we're not going to do that. So we're going to be covering how to optimize your resume, linked in profiles your portfolio, how to use email and referral to your advantage. And we're also going to cover some common questions, such as how to make up for lack of experience. Maybe you've just recently learned how to program and you don't have any job experience. How do we overcome that? We're also going to talk about when should you start applying to jobs? When are you truly ready? Because some jobs posts that they need five years of experience and you're not sure whether you should apply to them or not. And then finally, we're also going to talk about where to find the jobs and what are some of the best places to look for jobs and apply online? And last note here, I want to warn you, some of these topics may be obvious to you. I've included them on here because not everyone will know these things. Although some things may seem obvious and silly, the last thing I want to do is to just assume that this comes easy and natural to you. Keep in mind that educational background cultures and many other factors will come into play here. So keep that in mind, the more technical from part. And, frankly, my favorite parts are going to start to begin after this section. So you're more than welcome to skip this section if you feel that getting an interview is not an issue for you, but otherwise you might learn a thing or two. So stick with me and I'll see you in the next video. But by 4. 02 Resume: everyone's favorite topic. The resume. I don't know. Many people actually enjoy writing their resume, but unfortunately, it is a required part of a job search. Well, actually, in a later video, all argue that this is not the case, but for now, let's leave it at that. In order to maximize your chances of getting an interview, you will most likely need a resume, a brief document that someone will glance over it about 10 seconds and decide if you are worth talking to for a potential interview or phone interview. How can we increase the odds here now resumes air being to everyone's existence. Nobody likes writing them, and no employer offers a job just because of somebody's resume, so you need to treat it accordingly. Resumes air Simply a way to get interviews, and again, you'll see soon that it's not the only way. Spent very little money of time on your resume no longer than a day. Look at the types of jobs that you want to have and have the words and characteristics described in those job postings on your resume. Finally make it personal for each position you applied. Do so that employers names is on the resume. It will take you 10 seconds. But by doing just those things, it already puts you above. Most people that just send mass amount of resumes that look the same. Now, before we get into the details of how to make a resume look good, I want to show you a really nice tool. This is the resume maker dot online, a free tool that just creates a resume for you or gives you a nice design and template that you can just fill out yourself. There are others like it online. So you should really format your own resume. I mean, you're a programmer, you're a developer. You should spend your time coding and use the skills that other people have in design to improve your resume. So unless you're a designer, you don't really need to focus on making your resume visually appealing. And you can just use a template like this one. Most of your time, like I said, is better spent on other things. And again, remember what I said. In most cases, resumes get viewed for only 10 seconds by recruiter, and they'll decide quickly if they should contact you for an in person interview or a phone interview. Most people spend too much time on the resumes tweaking small things, changing fonds and, well, it's just a waste of time. Once you have a good resume that returns a good result, then you're all set. Ancient stress about it. And keep mind that some companies I get a lot of resumes don't even have humans actually looking at the resume and initially to have some sort of an algorithm search that looks for keywords on your resume based on their job description. So let's go back to the slides now. I'm gonna give you a cheat sheet in the next video and do a bit of an exercise that goes into a little bit more detail. But for now, let's follow these key points for having a nice resume. Resumes should be one page on Lee, and unless you're an executive or something like that, you won't need more than a page. Second, make sure that your resume contains relevant skills. Each job has a specific requirement, and they're looking for specific skills. These form great keywords to use in your resume. You can highlight the relevant skills in your professional summary that enables the employer to quickly get a grasp off the most impressive and important things in your profile. So again, try to use the key words that they use in the job description in your resume. Thirdly, you want to make it look personal like you didn't just mass email a bunch of companies. And one of the biggest mistakes you can make is to use the same resume for East Job application. That doesn't mean making your resume handcrafted each time spending hours for each company , because most of the time your resume will look the same. It's very easy to customize your resume, though, may be changing a headline or summary section of the top, where you can convey us in a sentence how you would fit well with the company or even just mention the particular company you're applying for. And then finally, you wanna have some sort of an online link you want to highlight perhaps your get hab. Your block posts portfolio websites. As a developer, you should have something that is present online for you to showcase to an employer. As a matter of fact, that is more impressive than a resume. And this is something we'll talk about later in this section. That should be clearly highlighted on your resume. All right, These air just bullet points. And it's kind of hard to explain this without actually showing you a demo. So it's time for a little exercise. I have a little resume, Cici for you. And in the next video, I'm gonna show you an example of a bad resume. Then use the checklist to see how we can improve it. I'll see you on that one number. 5. 03 Resume Walkthrough: Welcome back. It's time for a fun little exercise. Well, I mean, resumes air. Never fun. But I'm gonna try and make this fund. Um, I might succeed my nut. Let's have a look. Okay, Before we get started, I have very resume Cici for you that we're going to go through. And this is what you can do. I've simplified everything so that you do these items and you already above average with your resume and you're gonna see some increase and the number of interviews you're gonna get. But before we get into that, I want to show you again this website that we already talked about the resume maker dot online. Now I like this website because it shows you what part the interviewer actually cares about or the recruiter actually cares about. If you look over here, we see that we see the title. We see professional experience may be a bit of education. And in the left hand side, I don't think you need birthdate or nationality. But you get the idea. A recruiter, usually on Lee checks out the main points and from there, if they're interested in you, they'll read further. But you want to focus on these main points where a recruiters eyes are gonna be drawn so that right away within the 1st 2nd they see that you're a qualified candidate. So keeping that in mind, let's go over the points. All right, so I have the cici tear and 1/2 year a demo resume that I just randomly found online. Now, before we get started here, will you make this a little bit bigger? So you can see you can pause the video here and have a look of this resume and see how you might want to improve it. Or you can even bring up your own resume so that as we go along with each point, you can critique your resume. All right, so pause the video. Otherwise I'm gonna get started. Now. This resume, Cici, the first item on it is does it use a pre designed resume template? And if we take a look at this resume, well, I mean, it looks like somebody just wrote it in Microsoft Ward with the most basic font, and it doesn't look very pretty right away from a recruiter looking at this, I'm not going to be impressed and I'm gonna associate low skills with the person that doesn't have a well designed resume. So again, you might want to use a tool like the one I showed you that has pre designed templates. So everything looks good and professional so we can fix that resume that way, nice and easy. Fix what about the next one? Make the resume fit on one page. I've said this numerous times. And you know what? This person has a resume on one page. That's a nice, easy one. Good job. What about the next one? Include words from job description. If I go into this resume, I don't know what this person was applying to. But again, the very first items, which is what a recruiter is gonna look at, is going to read. I wish to obtain a Web graphic design position where my unique technical and creative experience will be valuable. Having worked in media, I am familiar with the fast paced environment, keeping tight deadlines and maybe some technical knowledge and work experience. But just by reading this resume, I have no idea what this person is applying to. I just see that while they're looking for a Web graphic design position, but it's not very specific. We want to include awards from the actual job description. If they're looking for a front end developer, make sure that the front end developer maybe JavaScript is included in your objectives or technical knowledge. Right at the beginning. Again, keywords are those wars that people are going to see recruiters are going to see. Or even machines that are reading your resume are going to see and say who this person is the type of candidate that we want. Let's look at the next one. Include company name you're applying to. This is so simple to Dio and right away puts you above most resumes. You see over here that this person hasn't really included that ideally, you've added into the objective or maybe summary or the title the company name or something specific to that company that you want to improve. Maybe the company is looking for engineers who can improve their infrastructure. Well, should definitely have those wards and that phrase in your objective. All right, off to the next one. Does your first item on your resume reflect what you are looking for or what they are looking for the companies looking for again. This kind of goes hand in hand with the job description and the company name. But your technical knowledge, your objective, your experience should be exactly especially the very first item should be exactly what they're looking for again. If you don't include those words and you give them something random like this prison has a company name here and a company link off somewhere that they've worked in the past. Well, I don't really care. And if I look over here, the first item that I see is HTML. If they're applying for a Web graphic design position issue most probably not the most important here item here. So again, Oops, I can I don't really care about that. All right, toe off to the next point. We're flying through this. It's not that bad, is it? Experienced titles demonstrate value, probably the most poorly worded sentence off I have come up with. But let me explain what it means. The experienced title should demonstrate value. That is, the work experience, which is usually the main part of the resume, should show that you provide value if I go into this person's resume. The first sentence I'm going to read is that a company's name that they've worked out, that I've never heard off Web M D, which is a big website. So I've heard of them. And then I see what producer And then again, responsibility includes updating a ship, all content. It doesn't really demonstrate a lot of value here. Instead, you want to make sure that your work experience shows a value that is, instead of having the company name here. Unless it's a big company like Amazon, Netflix or Alibaba something with a lot of good recognition. I don't really care about the company. I'll care about what you did. Wet producer. That sounds a lot more impressive than this company name, so this should be bold and highlighted. Production coder again, Mawr important that web nd our director again. More important, so you want to make sure that that's highlighted that those are the key things that shows your valuable. Another thing is, if you look at their this sentence over here, this a shame Apart doesn't sound impressive, but the second part cropping retouching, optimizing photos for creation of thumb, nasal and other images. I mean, you could reward that and make that sound better, such as improving performance of the website by optimizing assets such as photos. Having those forced items demonstrate value is very, very important. And this is actually over here as well. When we go to technical knowledge, we see that the second item is M s office. Microsoft Office. I mean, everybody knows how to use word. It's not very impressive. Maybe adding adobe creative suite photo shop, illustrative flash at the beginning. If you're applying for a Web design, graphic position is more important than Microsoft Office. And again, even this sentence I've been hand coding a schimmel for nine years. CSS for four years, Web master Don ph. B My skill. Why is that so small and underneath everything? A recruiter is gonna see this without reading this full sentence. That's probably the most valuable part of the resume. This should probably be up over here again, making those key items. Remember this image that I showed you the very highlighted items? The most important thing. All right. I think I've talked about that point enough. Let's go to the next one. Do you have an online link again. If you're applying to be a Web graphic design designer, and for people taking this course, you're most likely some sort of an engineer. You should have some sort of an online link to your get how profile? Maybe block posts, maybe website portfolio that needs to be at the very top. Next one. Remove the word I I wish to obtain. I am familiar. I was hired. I mean, all those sentences doesn't really tell me anything. You're adding extra weight again. You only have a few seconds to impress a recruiter and you adding these extra items that we don't really care about as a recruiter, we want to know right away what you can offer us, what type of asset you would be. I have been that we don't really care about that. Instead, let's just say something like professional Web graphic designer with five years of experience, gets to the point right away again. We don't care about I have been coding or any off those eyes. Get to the point right away. Speak in the third person if you want to just make sure right away. The first sentence that they read are the key wars and important items on the list. Let's look at the next one. No buzz words describing how great you are. And you know what? This person, definitely under cells themselves, I think this resume could be a lot better. This person definitely does not over inflate themselves. But what I mean by buzzwords is don't put garbage on your resume. That doesn't mean anything so words or phrases such as thought leader, passionate entrepreneur and sometimes people actually think negatively on these type of terms. Don't tell the recruiter him or her what to think about you and we wanna focus on using something called action words. And that's actually the next point. Instead of using vague terms that don't really mean anything, we want action words. What did you do and what were the results? And you can be really creative here every time you do something with Code C, how you add it to your resume as an action and an end result. It's very easy to just list your responsibilities, kind of like this person has done. But what did you actually do? And I mean this sentence is actually pretty impressive over here. The content or not, this one over here testing the content management system and seeing that migration to the new servers is running smoothly. I mean, that sounds a lot more impressive than coding. SQL webpages action words perhaps should be testing, deploying an observing content management systems to production servers, maybe at some monitoring there. But you want to show exactly what you did and then perhaps even say, what were the results that the customer experience improved? Or that more customers came to the website because of this transition to production service . And again, this translation to the next point. We want to measure everything in terms of impact. And don't just describe your responsibilities. We want to show off what we've actually done for a company like WebMD. Ideally, you have some sort of numbers, such as By how much did you improve the website performance by optimizing the photos and thumbnails? How much did the traffic of Web M D improve because of this migration to new servers? By having numbers, it's a lot more tangible. As a recruiter, I can see the impact that you had on the business because let's be honest. Here, companies hire people that are assets that improve the company and create more revenue for them. So if you're able to demonstrate that in a past job that you've actually here are the numbers, this is how improved the company. Well, then you for sure, are going to be a good hire. All right, let's talk about the next one. We're almost done here. Hang with me here. I know resumes. Not the funnest topic, but I promise you it's going to get better and better. So technical knowledge skills should include what they are looking for. Onley show years if it is impressive. So over here, this person, when I say years ice, I'm saying, Hey, if you worked at this company only for a month or two months, well, that's not very impressive. But if you have a certain number of years of experience, this person has nine years that they've encoding on html CSS for four years. I mean, that's nine years of experience. You don't even have to mention HTML or CSS. You can just say that your weap and graphic designer with nine years of experience I mean, that sounds impressive, and you also want to make sure that these technical skills is what they're looking for. I doubt they're looking for M s office or laptop PC hardware knowledge. They're probably looking for a photo shop illustrator. Maybe CSS maybe PHP my SQL. Maybe it's a react J s position you're applying for. You want to make sure that you show off those skills and if you have many years of experience with them, make sure you include that number. If you don't have that many years of experience, just don't show the number. You don't need to tell them everything. All right. Last two items include Onley sections, items that are impressive experience projects, adding education, technical skills. This just says, hey, only include items that a recruiter really cares about. For example, if I was an intern at a flower shop five years ago as a recruiter, maybe recruiting for a software engineering role, I don't really care about your flower experience. I mean, hey, maybe some people do, but I doubt that they do Onley include things that are relevant or can be indirectly improve your odds of getting a job. You don't want to just fill out a resume just to fill out a resume if it doesn't actually add to your overall picture. Now this person does it a pretty good job. You can see that most of their experiences technical knowledge. So that's good. But we see over here that usually you want to include experience, maybe projects, education and tight mingle skills. Anything outside of that I mean, you can add it, but on Lee, if you think it will improve the way the recruiter sees you. But those four categories should be enough. And then finally, everybody knows this. But I added on here, just in case, no typos or bad grammar. If you're not a native English speaker or a native speaker of your language, make sure you get somebody to double check your resume that there's no typos. But everybody knows that. All right, that was a lot. I know, I know. But, hey, I'm excited just as you that we're almost We're pretty much done with the resume section so we could get into the fund technical part. But, you know, people have written books on the topic of hotter right resumes, and there's so many things, so many minor things they can adjust to make them important. But if you follow these steps and I'm gonna give you a sheet right after this lesson, you've pretty much done 90% of the work. That is important for you to get a job. After that, you should be focusing on other things, such as improving your skills as a developer. So by just following this simple list, I guarantee your percentage off getting interviews is gonna increase, at least with resumes. That's it. Hopefully, by looking at this and your own resume and looking at these checkpoints, you can see how you can improve things. It's all about wording and how you can get the recruiter to see the top parts of by you the good things about you at the very beginning so that it catches their eye and they say, I'm gonna keep reading or I'm going to give this person an interview so I can find out more . Now that's enough for resumes, their books written on the topic. But you have to remember that there simply a way to get interviews and as such, treat them that way. Don't over complicate them. But I hope you get the general goal here every word in a resume. She convinced the recruiter why they should high. I'll see in the next video. No, but 6. 04 Resume Review: Let's quickly review what we know about resumes. Well, they should be one page. That's it. Don't cram everything into it. Make it clean and simple. Onley include relevant positions and things that make you stand out. Make the resume be very clear into why you did. And don't use any big language. I did this and it resulted in this what you did, how you did it. And what were the results Making measurable. Personalize your resume instead of just emailing ah 100 companies. Try focusing on a few companies and personalize that resume to them. And finally make sure there's some sort of an online presence that they could check out in case they want to find out more about you. And at the end of the day, you have a few seconds to get the person looking at your interview to say this person is smart and can help this company. Because remember, a resume is a piece of paper that someone will look at for a few seconds to decide to give you a phone interview or an in person interview so you don't want to spend a lot of time on it, but make it so it is effective, but it won't get your job. You got to remember that. We'll we'll get you. The job is your projects, your interviewing skills, things we're going to cover. Finally, be honest with your resume. Most companies will ask you questions about your resume, and they can tell you if you made it up. It's better to be, ah, 100% honest and be able to know 100% about the projects that you worked on and the resume items, because that's something that you're gonna talk about in the interview. I also want to show you a nice little tool. They're fun little tools like job skin, where you can actually paste your resume, paste the job description and you can scan it and it will tell you how well your resume does. And I'll give you tips on how you can improve that resume to match the job that you want. But you may have noticed a problem with resumes. What if you don't really have that much experience or things to put down? What do you do? In that case? What if I'm under qualified for a job? What if I've only been a developer for six months. What if I'm self taught with no previous experience? What if I have nothing to put on my resume? We're gonna tackle that question in the next video. I'll see in that one. No, by 7. 05 What If I don't have experience: What do I do if I don't have enough experience? What if I'm under qualified for a job? Well, first of all, you should have this mentality. Mind when applying to jobs and apply to jobs that you feel you are under qualified for. If a job is asking you to do something that you already feel confident, then you should ask yourself, What am I going to learn in this job? Am I going to learn? Actually, is this job want to put things on my resume that will make me get better and get a better position in the future? Or am I just going to do the same thing that I already know what to do or how to do it? Finally, you have to keep in mind that job postings are put in order to weed out the weak candidates . I have seen way too many of these created by non technical people or just making job sound tougher than it really is to remove junior developers or engineers from applying. So ask yourself, Is this job going to be tough? Good, Then that is why you want. That's what you should be doing. Do you feel confident you are very qualified for this job. Okay, then maybe you should push yourself and apply to a job that's more difficult than you think . Every application should be a long shot if you're applying to something that you are 100 saying qualified for where is your room to grow? So dream big. But in order to dream big, you might have a bit of a roadblock. What if you don't have enough experience? See, I don't love resumes, and I don't think a lot of people do, either. But sometimes without a resume, you cannot get an interview. And in order to have a good resume, need to have something to put on it like great experience. Here's the cash. So how can you have good experience if you're just getting started? It's like you have no hope if you're a beginner or if you don't have enough work experience because you're just out of school or you're changing careers. Well, not quite. As with everything, there's the regular way of doing things. Then there is the smart way you see. Experience doesn't come just from working at another company. There are many ways that you can demonstrate experience without a past job, and here you'll find my favorite ways to show improve. You can get the job done. You won't have to do every single one of them, but two out of four of these, or even better, three out of four will be great as showcasing on your resume and make you stand up. So let's go in order and see how we can do this. The 1st 1 is, Get home. Get Hub is a great way to demonstrate that you actually code that you've built project. The number one thing you can do is to start making commits and making sure that you have a good history of things that you've done. And by the way, if you're wondering how I got this cat picture in here, I'll show you a little trick in the next exercise to make your contribution look a little bit nicer and busier in case you're just getting started and you don't have a good past history. Another way to improve your get hot profile or to just add more experience is contributing and participating in open source projects. For example, I've created a zero to mastery organization where we have a hun off open source projects by the community that you can contribute to, and they're made specifically for you to mess up, make mistakes. Nobody's gonna yell you these air. Just fun projects that are open source they can contribute to, and you can do as much or as little as you want. But this will improve your experience and contributing to open source projects. And it's something you can add to your resumes now contributing to open source projects. Recruiters love seeing this because this demonstrates he can work with others and also with something like Get hub and version control. All right, let's look at the next one. The next salon is website. If you're especially a full stack or a front end developer or even a designer, you should have your own website where you can showcase your skills. This again is something you can speak about in your interview and about how you built the website, or it gives you a good way to talk about your past projects. Now you're asking yourself, Andre, am I gonna have to build a whole new website and waste a bunch of time? Well, not really. Let me show you a couple of tricks. You see, you don't need to build your own Web site from scratch. There's a Thanh of free templates like Creative Tim here that just gives you a nice template for you to use and fill in with your information. We can also look at this one and again free templates that you can use. I especially like the mountain template and you can see that, Yeah. I mean, you can customize this to your own and make a look professional, and it's already designed nicely and also customized for different experiences such as mobile tablet and in a day you can have your own website. And just to show you how you shouldn't really spend too much time on your own website one. My favorite people to follow is Kevin Kelly. He is very, very popular monk. The tech community is just the overall really smart thinker, and you can see his website over here. It's very simple. Nothing exaggerated, very, very clean but small, very basic layout, and this is to show you that you don't need some crazy animations. Make it all flashy to stand up as long as you have a personal website, it just shows that you actually spend time building it and doing something that most people wouldn't do. Another thing that I want to show you is, for example, the job or that we have for all of my students. And this is again another open source project that the community built. If we just searched through, let's say Toronto developers here and we go to Christine a key, I hope. I'm saying the last time, right? You can see how simple yet beautiful her portfolio is if we go to about me just a nice little bio with links to her profile for Goto projects, we see some of their projects, and this is something that she can put on her resume and immediately stand out from the crowd. And it also gives her an opportunity to list projects that she can talk about when she gets to an interview. All right, let's look at the next topic. 1 to 2 big projects. No, you can't really fake experience. If you've never built anything beyond a to do list or a hello world up, you simply will not be able to get very good jobs. However, most people think having AH 100 projects is the way to go. So they do a project today and build small projects, many small, tiny projects to have 30 of them and they start building all these projects that are very, very simple. Now that's not actually impressive. I mean, it shows that you're working hard and coding along. But if I'm a recruiter in Show Me a project of Maybe Tic Tac Toe, well, that's I don't really care. That's something that anybody can build with a bit of coding experience in a day or two. Frankly, no recruiter or interview is gonna check out all your 30 projects. Most of the time we want to hear your most difficult or the hardest, biggest project you've worked on. Instead of spending your time on these small little projects, spend your time on one or two big projects, for example, and other courses that I teach. We built a face recognition app, and this app will has a front end using reaction. Yes, a back end where we have ah rest ful ap I server with express. We've deployed it to Roque. We've created session management with authenticated routes. We store user information such as user name and also hashed passwords securely in our database. On post Chris, we've deployed our app with Docker, and we've also used a red ISS for session management and cashing. Now all of that may not mean a lot to you, but having something like a one big project that you can talk about all these things will make you sound a lot more impressive than somebody that just builds a ton of tiny projects . So focus on that. Have want to to big projects that you can show off makes you stand out, and it also going to give you something to talk about during the interview and put it up on your website or create its own website. And you immediately can put this as the first item on your resume. Because here's the thing. If you don't have work experience, if we go back to the resume we used in the exercise, remember this resume Well, if you had no work experience, maybe for work experience that you can say something like JavaScript developer or Web application developer and talk about how you build your project here because to a recruiter , it doesn't really matter if you worked but asserting company, building an application or on your own, or that could be a little bit too back to They don't need to know that. They just need to know that you build things that are real that are big and complicated, and you solved heart problems. So having one or two big projects that you can list on your experiences is a great way to add to your resume if you don't have enough past work experience of companies. And I have a few students who have actually used this technique to get interviews, even though they just learn how to code six months ago. And then finally, we have the block posts or block. Let's have a look at what I mean by that. This is another thing. You can include your resume, especially if it's related to a technology your using or the company is using. For example, I have here my medium profile and medium dot com allows anybody around the world to just post a block post, and it's very popular with the tech community, so there's a lot of tech related posts taken right on medium, and there's other platforms like this. What if you wrote a block post about a specific technology that the company you're applying for is using or some sort of a technical problem that they're facing? By doing that in just adding a link to that block post, it gives you again another leg up to most people. And the great thing about platforms like this is that well, if we go to one of my articles here, you can post it to what we call publishers and publishers. Allow your post to be discovered by others. And it's very simple to do. You can write a block post on medium and a day and submitted to a place like Hacker Noon and lots of people see it. And as soon as you show this to a recruiter or an interviewer again, it automatically shows that you know what you're talking about. Or at least it makes you stand out from the rest, and you can do this with YouTube videos as well. But I prefer writing because it's a lot faster and it looks a lot more professional. So let's just review here. What happens if you don't have enough experience. We'll all of these four points allow you to gain that experience or show that you have experience without actually having traditional work experience. All you need to do is start something on your own and build something like a project or a portfolio. Our A block post This Onley shows initiative, but you can focus this project on solely getting your interviews, or you can participate in a hackathon or contribute to open source projects. By taking this initiative, you're doing more than most people that hope to just land an interview. By sending a generic resume, you'll immediately stand out from the crowd and give you something to put on your resume. That again, is different than the average developer. Plus, you have the added benefit of something to talk about in your actual interview. Remember, nothing is given to you for free, and luck is for those who rather wait, then go after what they want. So by simply building something just for fun, such as a side project, you're showing how self motivated and ambitious you are. Experience doesn't mean on the job experience right about your portfolio projects, maybe talk about your website and how you built it. Talk about your get hot profile. Maybe a hackathon you participated in, or open source projects that you've worked on. Brighter Block post on a specific technology that the company you're applying to is using. All of them answered this question. Do you have experience? Finally, there many things that you can add that are not developer related but can make you a great employees. For example, did you work as an instructor at a camp? Well, you can now add ability to manage people on, communicate well with others. Any skill that is related to getting the job done can be included. Also, if you have only had six months of coding experience, don't show that on the resume that doesn't mean to lie, but to hide that information because the recruiter only glasses at your resume, they won't care if you're the best of all. Burn the world. If they just see six months experience, that's too risky for them. Your resume will most likely be discarded no matter how good of a developer you are. So remember resumes on Lee. Good to get your foot in the door by tweaking your resume to show that you have experience so that the recruiters thinks, Oh, interviewing this person is low risk because they know what they're talking about is a good way of doing it. Do you have past experience having made good decisions in the past and have you worked on a challenging problem and solved them? If you're able to answer yes to that, well, then a recruiter is most likely going to ask you for an interview. I'll see you in the next video. No, by 8. 06 LinkedIn: Welcome back. Lincoln is one of the best things that has happened to the job market. Now, depending on your geographic location, you'll see different levels of activity for Lincoln. So this is something that you will have to consider for yourself and make sure that Lincoln is a good option for your location. Now let's have a look at Lincoln so we can talk about it and also to see if it's a viable option for yourself. The best way to actually see if it's worth your time to invest in a linked in profile is to actually just do a search for jobs. And in here you can do all sorts of filters. But if I go to all filters, you can look for jobs based on your location and the type of job that you're looking for. If there are jobs, then per house, you need a Lincoln profile because, well, this is a great way to apply to jobs, which you canoe on Lincoln but also have recruiters contact you through Lewington, which actually happens a lot, and we're gonna get into that a little bit later. I personally think that Lincoln is ah, 100% better than resumes. And it's something that every single person should have, especially if you want a job and attack industry. And by the way, I'm no specialist when it comes to Lincoln, and there's a lot of people and books that talk about how to optimize, He sings. However, if you craft things well enough, you'll find you'll get contacted by recruiters constantly on linked in. I actually have to add on my profile. Ah, little bit of Ah, no recruiters, please, because to get contacted so often by recruiters from my experience, speaking with other people when you have a good linked in profile Joga contacted for job offers, which again is a great thing to have in the back of your pocket as an extra way to increase those odds of getting an interview. So here's the keys to linked in fast and quick. Number one is to look for jobs and apply to jobs through LinkedIn again. I showed you how to do that. You can see what jobs are available and actually apply to them directly. Lincoln is pretty much like your resume, so it should have very similar items as your resume, whatever it makes your profile complete. Well, you should add it over here just like I have done for myself. Now the interesting thing here is that recruiters for other companies and tack recruiters usually search Lillington for candidates. And what they do, is they you keyword searches. So if I'm a recruiter looking for, let's say, a Python developer, I'm gonna Google Python developer and maybe check that a linked in profile house the word python in it. Maybe I'll check that if I scroll down here that they're endorse skills. Where are they? That skills and endorsements that this person has python and perhaps whether this person changed their profile recently. And that's a little trick. Update your profile every week when you're looking for a job on Lincoln, since it's going to show up in a recruiters search result. So even if it's a small change, such as just a little typo or a little space, it's going to show up as an updated profile. And recruiters are actually going to see that this person changed their profile recently, which means they're more likely to be looking for a job, and they're more likely to reach to you so you can actually just do this every couple of days when you're looking for a job so that it increases your odds of you getting onto recruiters Search results. You also want to include keywords that recruiters air looking for, and I have an example here for you if I scroll to one of my positions here. I have a list of my favorite tools in 2017 and actually did this strategically, because all these tools that I'm using are now keywords that if a recruiter or companies looking for somebody with mongo DB experience or maybe server less architecture or fire base or any of these things, my profile includes those. So I'm going to show up in those results. So think of it that way. What are the key words that will make you more approachable? Finally, try to get recommendations from other people, message your friends or colleagues or co workers and get them to refer you. Not that recruiters or companies will read this, but again, when your profile shows up in searches, it's more likely to be ranked higher up because you have these recommendations. By the way, these skills and endorsements are things that will. Usually you get from people such as your connections on LinkedIn. It's really hard to get this number up. So I've actually created a little group for us, where if I go to groups and by the way, Lincoln is updating these, so it's going to actually change, most likely from how you see it in the video. And here we have members that you can connect with and actually ask for referrals, skills and endorsement just to again boost your linked in profile. Finally, something that we're going to talk about in the email section. But some of the best way to get jobs is to not just blindly email companies that don't know anything about you. Getting referrals or being referred by somebody within the company is one of the best ways to do that. And for me myself, I'm not very sociable. I don't really like networking and going to events. Or perhaps maybe I don't know somebody at a company, and there's no way for me to get a referral. Well, Lincoln allows us to do this by simply searching for Let's say, Netflix. I wanna work a Netflix. I'm gonna click on this company. Or actually, if we go back and do Netflix and click on Netflix in people, I'm gonna look for people that work in Netflix. If it works, there you go a little bit slow there, and I see here people that actually work in Netflix and some of my connections to them. I see that I have shared connections and I can message somebody I can connect with them. I can also see that this person is actually a recruiter, and Netflix and I have some sort of a shared connection. May be I soon message her and see if I can get an introduction. Or maybe I can pass my resume onto her or set up a phone interview. In other words, Lincoln allows us to see that we have mutual friends and we can vouch for each other's credibility. Or perhaps contact somebody directly a Netflix that can get us an interview again. It's all about being strategic and efficient and doing what most people aren't willing to do, which will make you stand up alright, so to review, update your linked in profile with the skills that you have, and according to the jobs that you're targeting recruiters air going to use linked in to look for candidates. And they will always search for users who have recently changed their profiles, since it signals to them that this person is looking for a job and also try to include the relevant skills and have those keywords ready so that you do show up in those search results. You can also apply to jobs directly through Lincoln, and you can also find people of companies that you want to work for that you can connect with message or give referrals from again. Something will talk a little bit more in detail in our email section, using a tool like this that allows you to be discovered while you're sleeping just optimizes your chance of getting interviews without making you spend a ton of time trying to get those interviews again so you can focus on things that really matter. I'll see in the next video, but by 9. 07 Portfolio: Welcome back. Let's talk about portfolios. And actually, we kind of spoke about this already on our video about what if you don't have enough experience, so I'm just going to go over a few things, so I recommend you make sure you watch that video first. Otherwise, let's just recap what air portfolio should be. A portfolio is simply a way for you to showcase your big projects the items that you want to really demonstrate your value with to talk about in the interview. Those personal projects should reflect what kind of job you want. So don't spend a lot of time on your birth folio. It doesn't really matter that much how it looks unless you're a designer using a free resource like the one I showed you that gives you free templates. Where you can list your projects is enough for you to just have an online link on your resume and for recruiters to possibly see that you have some sort of an online presence. So using something like this or creative Tim is a great way to just speed up that process. Remember, the projects inside this portfolio is what matters most. You just need to have 1 to 2 big projects you really care about. I've actually never met a developer that has gotten a job solely because they had a nice portfolio, so don't stress too much about it. Remember, your goal is just to be seen just to get that interview. Your portfolio can be quite simple. You just want to make sure that it looks someone nice and that it also loads up fast. And you just need a place to showcase your main projects a place maybe to add your block posts, maybe to add your get hub account. And I'll leave a nice resource for you for some of the best portfolio websites. But they all pretty much look the same. A little about me section links to get have been blocked posts and just a list of your project. You can even have your resume on this portfolio. And by the way, once you're done with your portfolio, I recommend you added to the job board that we have here so that you can showcase it for other students of the course. But I also include this on my LinkedIn profile so that when recruiters see my profile. They can just search for developers that they need based on name, job, title, location. And it's just a nice way to get seen or have a lease, another avenue to be discovered and that's it. Again, spend very little time, but just have something out there. I also recommend going to are zero to mastery community and actually going to the job hunting section, and we might have a few more channels by the time you wash this video. But you can check out other people's profiles as well. Let's talk about job hunting, and people sometimes share job openings here. This is a great place to ask for help, get tips and maybe help out community members as well as we all try and get that dream job anyway, I'll see in the next one. But by 10. 08 Email: welcome back to our fourth and last item on the list e mails. Now, if you're applying directly via the company's website or through a job board, please stop. Well, right don't actually stop but realize it's not the best way. It's what everybody else does. There's a study that was published by a company called Impact Group, and they looked at some of the job applications and did some statistics around those numbers. And they found that close to 30% of hires made by organizations actually came from referrals. So that is employees referring their friends or somebody that they know to the company. It was the number one way off companies to hire other people. And again. Part of this study also discovered that 46% of men and 39% of women actually find their jaws most of their jobs through networking. The interesting thing is that the higher your salary, the more effective networking becomes and getting a referral. For most companies, the best way to get an interview is not Onley through online job boards. But the best way to get an interview is through referrals. But lucky for you, this doesn't have to be an actual friend or coworker. Usually you can message people within a company using some of the tools that I'm going to show you, right. Let's get started and show you the first example. All right. The first way. Well, the most obvious way is to actually apply to companies where your friends and colleagues can refer you. But maybe that's not the case for everybody. And that's kind of rare, as I've shown you in the Lincoln video there ways for you to actually connect with employees through LinkedIn and message them based on who you're connected with, and you can usually send them a polite or smart email. And this is unexamined all template that I'll share with you that I actually a user. Patrick McKenzie on Hacker News shared, and it's ah, it's a really, really good piece of text. I'm not gonna read it off for you, but you can see over here a short email to get yourself a referral or at least talk to some of the developers of the company or some of the key players that might get you an interview . But again, how can we solve this problem? off finding the people to contact Well, the one way to do this is using Lincoln like I showed you. I can see what jobs bless a Netflix is hiring for. I can see some of their employees here. I can see that I have some connections here from my school, so that's an easy way. But what if you're not able to use LinkedIn or able to find these connections? There's some great tools that you can use to find in this day and age pretty much anybody's email, and I'll link to this after this lesson. But you have a lot of plug ins, such as this one over here that finds emails off linked in profiles. You have hunter over here that you go on a website and it shows you what emails are associated with the website and other tools like email extractor. Using that you can target somebody that might be a gatekeeper. That is, somebody that can make the decision to interview you are not interview or can refer you to somebody that has that decision because nothing beats getting your referral from someone, and the other beauty is that most big companies have incentives for employees who refer someone so they may actually be willing to help you. What I mean by that, for example, in my past company, if you are able to refer a developer, you got an extra bonus on that month salary because they're always looking for good employees. And they know that referrals usually turn out to be better candidates than somebody that just applies randomly all night By contacting some of the people that might be able to refer you, they actually may be interested as well, because they might get a bonus from the company for referring somebody that they're gonna hire and thus improve the company. Keep in mind that you don't have to just do this online. You can meet people at meet ups that you might have locally or even hackathons, where you can meet people in real life and ask them if the company they work for is hiring . There's just so many ways to do it and be smart about it again. Nothing beats getting a referral from someone. They just blindly sending out a resume. But let's go back to the slides. The methods we just discussed for emailing and getting referrals are pretty basic, so let's get creative. Instead of sending your resume, I usually email a company I'm interested in. And again, you can use some of the free tools that I showed you, such as email hunter. And instead of sending a resume instead, send them a personal website that you have a portfolio, Why you want to work for that company and ask them if you can come by for an interview, just asked them outright. You can send this message to the head HR or human resource is person or somebody on the development another way or even more creative way. Well, message Lee developers or SETI owes somebody in charge of the developers or engineers of the company that you're interested in working for them and let them know that you're interested in getting where they are professionally. Asked them to take them, or coffee or lunch, Or ask them if you can come by to the office to chat with them about their careers so you can learn from them. People love talking about themselves, and if you're not all right, asking for a job instead, you just wanna pick their brain or learn from them, you might be surprised how often you'd get the yes combined Let's have coffee. The key here is to just not ask him for a job and at the end of meeting them, perhaps inquire if they have anybody that the recommend you speak to. If they're not looking to hire, they'll direct you do someone else. And then finally, another way. That, like reaching out, is to perhaps message CEOs directly or president of a company. And this is something that works with smaller companies, big, large companies. This most likely won't work. But if you message the CEO of a startup and ask, perhaps what technical problems they're having, tell them what technologies you're an expert in and asked to solve a really life problem that they have free of charge, they can keep the work. And in return, all you asked for is an interview. I mean, they might take you up on it, because, hey, why not? I remember one time when I was a little younger, I messaged the CEO of a really big travel company, saying that the book that they rode really inspired me and that I'm starting my own travel company and the CEO, and I actually had a meeting, and we spoke for about two hours discussing whether I should join his company or not, and I never asked him for a job. It was just something that I sent out again, doing things that most people wouldn't do. But at the end of the day, the point of this is to not necessarily send out mass amounts of resume. Select the jobs that you want, personalize your emails and try to avoid sending a resume. If again, try toe bypassed formalities off the application process by trying to get her interview right away. Most likely during the interview, they will ask you for a resume, but by that point, it doesn't really matter. You've already gotten what you wanted the interview, By the way, you may have noticed that this is what cover letters should be. An email to introduce yourself cover letter should actually be just directed at someone and personalized, So don't bother creating a generic one. They're just simply emails to reach out to somebody to get referrals. To get that interview, just write an email or any way to get connected to show how you can help solve their problems. I'll see in the next video. No, my 11. 09 Where to find the jobs: Welcome back. We're gonna answer a question. That's kind of simple. Kind of not, depending on your situation. But I do get asked this question in a loss. I wanted to cover it. Where to find the jobs. Now, as an engineer, as a programmer, as a developer, we have the skills that are quite in demand. Most of the time you're not gonna find difficulty, or it won't be very difficult for you to actually find companies that are higher for your skill sets. The good news is that the better you get a programming, the better you become at engineering. Well, the more doors open up for you. So that's the good news. You can always improve your skills, and we have a highly in demand skill that allows us a lot of freedom. So when it comes to where to find the jobs there is a Thanh of resource is out there. But I'm gonna show you my favorite ones that I think are worth your time, because again, there's so many options that you want to focus on quality over quantity. Let's have a look. The 1st 1 is linked in, and it's something we've already talked about, But I really do think it's a great option that if this is available to you in your location , then you should be using it 100%. Another place that I like is hacker news. So hacker news. A lot of engineers and programmers hang out there, and they actually do a monthly who is hiring section. You can see over here when I'm recording this video that they have who is hiring, And it shows you all the companies or people comment with companies that are currently hiring. Ring out again. Really, really good. If you're interested, especially start ups. The sometimes have remote jobs as well, which is really good. And now they're great Resource. If you're specifically looking for startups than Angel List, is probably the best place to go. So signing up for Angel List, creating a profile and finding a job, you can work for some of the hottest startups a lot right now, If you're looking for remote jobs again, I'm going to leave a few more. Resource is after this video, but this is one of my favorite websites. If you want to look for remote jobs again, they're becoming more and more common that no matter where you are in the world, as long as you have an Internet connection, you can be a developer, a programmer and engineer and work from a company that's thousands of kilometers away. And I have MAWR more friends that work remotely as programmers now because more companies air becoming used to the idea of having remote workers. Another interesting way to apply for jobs are companies like hired triple bites or white truffle. They'll have pretty cool sounding names except for hired. That's pretty generic. But what they do here is they actually have companies reaching out to them to hire good developers. So you would take some sort of a quiz, a coding quiz with them. They give you some sort of our rank, and they create a profile for you so that companies reach out to them and look at your score and hopefully high you. I'm not the biggest fan of these because it does take a bit of time to take these quizzes. I like being direct and picking the companies that you want to apply for, but they do have some pretty respectable companies that use some of these websites to hire people. Then there's also meet ups again. Going to your local meet ups for a specific technology that you're working with is a great way to network, meet people from other companies and potentially see which companies are hiring. I personally am not a big fan of networking doesn't seem genuine and kind of seems like I'm faking relationship. But for other people, it works really, really well again, a great way to find people, connect with them and especially get referrals. Finally, one of my favorite ways is to do this type of search on Google. You see, over here I have sight not site site Lincoln dot com. So search linkedin dot com and then searched for Facebook. Recruiter. If I want to apply that Facebook, well, I see Over here. Colleen, Done and Juliana are regional recruiters recruiter at Facebook University recruiter, and I can find specific people that I want to get in touch with if I want to work at something like Facebook, and I can obviously change this to whatever I want, that's a great way to target your approach. Because remember, job hunting is a numbers game, a 2% chance of getting an interview. Means all you need to do is apply to 50 places to get an interview or something along those lines. You just want to increase your percentage. Your odds of getting that interview keep that a month. Just applying to companies blindly is not a good idea. I mean, you will get interviews, but it's not very efficient. If you have companies you love or you want to work for a specific company. Sometimes targeting your approach and focusing in on that company is a lot better. Mawr efficient way of spending your time. Hopefully, this was useful. I'm gonna list a bunch of these pre sources that I showed you and a few others in the next lesson and I'll see in the next video. But by 12. 10 When should you apply?: When should I start applying for a job? This is especially common for people who are looking for their first coding job because they're new. They're unsure how valuable their skills are. And we all have heard of the imposter syndrome where we think that everybody knows a lot more than us and that we're just on imposter pretending to be engineers. So I want to answer this question for you. A short version and a long version. Short answer. Oh, when should you start applying? Is well now because you need to start looking at interviews, not as a win or lose, fail or pass. Rather, as with anything, it is a skill that you can improve and get better at each interview that you go to will make you a better interviewer. Practicing is the key here, and the sooner you start interviewing, the better. Now there's a catcher, and we'll need to go into the longer answer for that one. Assessing readiness is related to calculating the actual value and salary over a developer , and that's tough to do. When will you know that your front and engineer or a back and engineer? Most of the time you see on the job description items that you don't even know off or are not the master off or requiring way more experience or midway more years of experience than you have first things first. Companies do this to filter out the weak candidate. As a matter of fact, if you're applying to a job where you check all of the boxes and you know everything, then that means you are getting a job where you already know what to do. You won't grow in this world as much as tougher positions, will you? So you need to change your mind set here. A job description is simply a guideline of what type of work you will be doing. Not what type of work have you done in the past? Would That said, If you don't know how to code at all and you apply for a developer position, well, don't expect a positive result. You need to have some fundamentals before you actually start applying. Luckily for you, the criteria is very simple. Do you know the fundamental building blocks of computer science like data structures and algorithms like we're gonna learn in this course in your specific domain. Have you built some projects and can build something on your own other than a simple hello world project? Do you have one or two big projects using the related technologies that the job description has? If that's the case, well, we should start applying. Your skills will continue to grow in acting count numerous times when people in my company got hired over people with more experience, because hiring developers or engineers is more than just technical knowledge. Once you meet a baseline, that is the minimum requirement. The rest comes down to nontechnical parts of the interview again, which we have a whole section on in this course. So when should you apply now? Use it as practice, just like with anything. If you wait until you feel you're ready, you already waited too long. Remember this quote? If you never ask, the answer is always no. So start applying. Now I'll see in the next video that way 13. 11 Summary: who were done with this section. Now let's review what we've learned. And before I do that, I'm gonna tell you something that is counterintuitive. Don't apply to 1000 positions online. Just sending out your resume everywhere. That's what most people do. Instead, pick 5 to 10 companies you want to work for and fully target and focus on applying to them . You see, that is the main goal that we started with. Increase our chances of getting an interview. All of our actions create that, and a week's worth of work will set us up for future success, setting up something like a good resume linked in profile. We keep our options open as people contact us. Like I said at the beginning of this section, most of this should take you a week to set up as you go on and you may get feedback can keep updating things. The only thing that may take you longer is perhaps 1 to 2 big projects for your portfolio. But that is a good investment because not only are you learning how to build things, but it will give you things to talk about in the interview, and you're actually coding instead of just typing up a resume that doesn't really help you as a developer or an engineer. We talked about email and contacting people directly and getting referrals as a better way to a plot than being completely anonymous. We talked about how to overcome the lack of experience when you're ready to apply, The short answer was now and where you can find jobs and the most efficient way to apply. If you've noticed, the focus is on quality over quality. Even though I said it's a numbers game, your time is better invested in focusing your approach. All right, all right, that's enough. I apologize for this section. I know it's not the most exciting section. It's really hard to make resumes exciting as a topic, but we're gonna get to the actual fund coding technical bar now. So thanks for sticking with me. It's gonna get a lot more fun and I'll see you in the next section. No, by 14. 00 Environemnt Setup: in this course. I don't wanna let me you to just one language because we all code in different languages and throughout your career, your most likely going to use multiple languages. Now, this course specifically, I will have to use a language to demonstrate, coat and write some coat. And I'm going to use javascript for this because it is similar with a lot of common languages, and it's also the most well known. However, you can use whatever language you want in this course and follow along. Even the exercises will give you solutions in different languages. So pick whichever one you want. But how are we gonna run all these different languages when you're following along? Maybe I'm demonstrating something in JavaScript and you're coding along and python. Well, we're going to use a couple of need little online tools. The 1st 1 I'm going to show you, and the one we're gonna use in this course is rappel dot i t rappel it as I like to call it , and you can pick any language that you want here to code along. And like I said, I'm gonna be using JavaScript for this course. But all you need to do is to sign up with your get hub account and you'll have a little I D that you can run your code it and you'll see me using this throughout the course. Another one that I really like is glaad dot io and it's open source, which I'm a big fan off, and you can see over here that we have a lot of different languages that we can use again. If I go to JavaScript, it gives me a nice little area for me to write code and run it. Another option, especially if you're using JavaScript, is to just go to view developer and developer tools and Google chrome, And this allows you in the console tab to just write JavaScript. So that's another great option. Or, if you prefer, you can always use your favorite text editor. Write your code and then run it whichever way you want again. Keeping in mind that this course is language agnostic, that means it doesn't matter what language he used. What we're learning are foundational computer science principles that you can take anywhere throughout your career and as you'll see whether you know javascript or not, I'm going to keep the code very general and simple so that it's easy to replicate it into other languages and also give you re sources and sources with other languages when we get into more nitty gritty Cody. All right, set up your environment. Get ready for some coat. I'll see in the next video. Bye bye. 15. 01 Introduction: In my opinion, this section is one of the most important topics for any software developer, our engineer. It also happens to be my favorite section of the scores. No matter what company you work in, where you live or even if you're coding 10 years from now, this is a concept that will be around for a long time and something that will truly make you a better developer. Big go is something that I learned about 2 to 3 years into my career as a developer. And it's so important. It has made me a better developer, a better engineer, and it will for you as well. Big companies like Google, Facebook, Alibaba, Amazon all know this, which is why you won't get by any of their interviews any of their phone interviews, any of their screening interviews without encountering this topic. So we're gonna learn all about this very important topic, and that's why it's at the beginning of the course. All right. Did I grab your attention enough? So what are we talking about here? It's gold, Big O, and the official term is big O asymptomatic analysis. If you want to sound super smart in and impress your friends. You see any coder given enough time console of a problem. What matters is, though, how well the problem is solved. And this is where big oh can help us. It can tell us how well a problem is solved. We're gonna find out about what that means in this section. We're going to talk about Big Oh, what it is, how we define it. And then we're going to use Bago. And it's different notation to distinguish back code from good coat, good coat from greatcoat. We're going to become comfortable with this topic that we're going to not be surprised when this comes up in our interviews. But we're also going to build this big foundation that is important to be a great developer . The reason this topic is at the beginning of this course is that you will see this big O notation come up again and again as we go into topics such as data structures and algorithms. Like I said, this is my favorite section. So get ready because it's going to be a lot of fun. See you in the next video double 16. 02 What is good code?: There are two main things we talk about when we say this is good coat. But before I show you, what do you think? Good coat is. Think about that. What would you tell somebody if you're asking them to write? Good coat. All right. I'll just give you the answer. You see, good code can be described in two things or two points. One is readability. Is your code just generally clean? Can others understand your coat? And then we have scalable coat. What does that meet? Well, big O notation is what allows us to measure this idea of scalable code that can scale something that we're going to get into and you're going to become more familiar with as we go through this section. We're also going to talk about readable code throughout this entire course, but touch upon it a little bit more in the next section. But for now, because this is the big O section were focusing on this idea of scalable coat. Okay, what does this really mean, though? Well, I want you to imagine we have a task where we want to bake a cake. We have a recipe over here and this recipe we're gonna use in our kitchen to bake a cake, and there's a good way of baking a cake and a bad way, right? We give it the instructions. That is the recipe, and hopefully this recipe and instructions work well with our kitchen so that we can bake a cake quickly and a good kick at that. Well, computers are machines, and these machines need to work in order to produce something for us. And computers work in the same way. We have these instructions that we give it through a code and these instructions that we give to our machines. Our computers give these instructions that provide for us some sort off an output, for example, to turn on the light. We give the computer instruction to say, Hey, turn on the light in our room. A coder is someone that gives these instructions just like there are many ways to take a cake into a kitchen. Or just like there are many ways to bake a cake in the kitchen with many recipes, ingredients and instructions, there are many ways to solve a problem through coat. They're efficient and inefficient waste to give instructions so Let's go to a coding example. I'm going to use rappel thudded. And if you're not familiar with this, make sure you check out the video that I've listed down below here, which explains how you can run your code in discourse. I'm going to just log in. And I already have my JavaScript environment set up over here, and I prefer having the dark theme. I think that looks better on your eyes for you at least. I hope you don't mind the darkness. But how can I demonstrate this idea of coat? Let's do something fun here using JavaScript. I'm going to say, Const. Nemo, we have an array that contains the String Nemo and we want to create a function here that is called Find Nemo. And this function is going to receive an array. And it's gonna be a very simple function. We're gonna create a loop that you'll see in most languages in JavaScript. Weaken Do that easily by saying four and we'll give let I equals zero. And as long as I is smaller than the array dot length, that is the length of our array and then we're going to increments. Hi. Every time again. This isn't a JavaScript course. So hopefully this is familiar to you. Any sort of loop that you want in your language. And we're just going to simply say that if array by equals Nemo. So if we find Nemo, we're just going to console dot log found Nemo. We're very excited with fun. All right, that's it. And if I just simply run the function now, find Nemo, and we'll just give it the array Nemo over here. And make sure that I spell length properly and we click Run here. We have found Nemo on the right. You make this a little bit bigger seeking. See? So we found Nemo. This is the instruction that we gave the computer. We told it that we have an array and we have a function in action that we want to perform called Find Nemo. That takes an array, which is Nemo. It's going to receive this array. Then it's going to loop over the array. We're going to say that I is going to equal zero, and because I is zero right now and the array dot length off Nemo is one. We're going to go through the loop. We're going to check if array index off zero, which is name over here. So this is going to turn into Nemo. And because this is true, we're going to console log found Nemo. Now, why did I just show you this example? Let me just bring this back to the way it waas. I showed you this example because this is a new instruction that we're giving our computer to find Nemo. You see, we call this the runtime. How long does it take to run a certain problem through a function or a task? How can we measure the Big O or something like this or the efficiency of this coat? In the next video, we're gonna get a little bit deeper. We're going to try and measure the performance of this coat and see what happens when the array gets larger and larger. And we're gonna tie things together as to what scalable means and how big. Oh allows us to measure the scalability. See you in the next video. But by 17. 03 Big O and Scalability: Welcome back. Let's continue our discussion of what this scalable idea meats. You remember that we talked about the kitchen and how similar to a kitchen. We have to give instructions to our machines to produce a result. And in the previous video, we talked about this function Finding Nemo. Let's measure the performance off this function. Well, JavaScript gives us ah, nifty little tool that comes built in to the browser, which is where we're running this code. So depending on your language, you might not have this option. But you will have different ways of measuring this. Don't get too hung up on this. We want to use this as an example to measure how long it takes for this function to run. We can do this in JavaScript by saying, Let's say time zero is going to equal performance that comes built in to the browser, and we just say now and this T zero is going to start this timer before the loop happens. And then when the loop ends, I'm going to have another timer called T one, and this is going to equal performance dots now. So we have two timers, one at the beginning one at the end after the function goes through the loop to find Nemo. And then at the end, we'll just do a fun little console dialogue and we'll say that the called to Find Nemo took and could just do a simple T one minus t zero. The man will say Milli seconds because it's going to give us the results and milliseconds. Let's see if this works. I'm going to run this code and me out of space in here, and we see that it took zero milli seconds for this. Go to run. Let me you run that again zero seconds again. Zero seconds, zero seconds. And if I keep clicking it, I see that now It takes a little bit longer, and that's because this is really fast, right? Our computers machines air extremely fast in this day and age, and because we're on Lee looping through this once, well, it takes almost zero milli seconds, and the display just Brown's this down. But what if we had a bigger array? Let's say that we have an array over here that has cost everyone and has a whole. The characters are released. A lot of the characters from the movie Finding Nemo, which, if you haven't watched it, Amazing movie. Highly recommended. Anyway, we see that we have a lot more characters now. So instead of just having a single array, let's have the array. Everyone in here and this array now has a lot more items. Has 123456789 10. That's 10 loops in here that we're going to do. If we run this. We see that the time is still the same. Pretty much zero milli seconds, sometimes a little bit more, and the time changes all the time. But we don't see that much of a difference, do we? I mean, we ran from one loop to now 10 loops, but it's still super, super fast and again. That's because our computers in this day and age are quite fast. The difference between one loop and 10 loops is not that big, but let's do a little fun trick. Here in JavaScript, we can create a large array. Let's just call it large, and we can create a massive array by just saying you array and we'll give it ah 100 items and this 100 items in the array we can fill it with, Let's say, Nemo. And this is just going to create an array that has Nemo ah, 100 times. So instead of everyone, let's do large and hit Run. All right, we see here that it's found Nemo Ah, 100 times because, well, we just fill their with Nemo. And at the bottom we see that it took 1000.5 milliseconds that took a long, longer didn't let's do even bigger. Let's do 1000 hit run. It took seven milliseconds. Now what if we do even bigger? What if we had a massive array of 10,000? If we had run 46 milliseconds, it's still pretty fast. And then just for fun, one more. If I had run, you saw that delay and how long that took that took 3 43 milliseconds or 3.4 seconds. Now what do we just see here? Well, we see that us. Our input grew. Our function find Nemo became slower and slower and slower are run time. How long it takes to run a certain problem through a function increased. But here's the problem here. If you take this code and run it on your computer. Well, your time is going to be different than mine. And I'll leave this code at the end of this video so you can play around with it. You're gonna get frustrated because every time you're on this code is going to be different , then my number. It might be a lot faster, a lot slower. You see, this all depends on how powerful the CPU in the computer is and what other programs are running on your computer. What programming languages you're using and many other factors. So there's all these factors that play here in our runtime. Therefore, if I speak my friend across the world, let's call him Johnny if I tell him. Hey, Johnny, my code is so amazing. I've created this find Nemo function and it runs in three seconds. 3.2 seconds with 100,000 inputs. How good of 1/4 am I? And then Johnny says, huh? That's really awesome. But you know what? Mime runs a lot faster. Runs in 1.5 seconds. So I went. What do you think? Do you think Johnny wins? Does Johnny have better code than I do? Well, here's the thing. Not necessarily. This doesn't really mean much because it matters what type of computer Johnny has. What other factors, as I mentioned before, the code is running it. So how can we determine who wins? Do I win or does Johnny Win? Who has better coat? And this is very common in the computing world we code on. Our laptops are computers, but that code doesn't necessarily run on those devices. If we have something like a server, we may have that code run somewhere else on a different computer around the world. So how could we make sure that there is a way for us to measure in terms off efficiency, what is get code and what is bad coat? And what is code that can scale that as the number of a raise or inputs increases, It doesn't constantly slow down mawr, and more big O notation is the language we use for talking about how long an algorithm takes to run. We can compare two different algorithms or, in this case, functions using big O and say which one is better than the other when it comes to scale, regardless of our computer differences, and we can measure a big go like this. I'm going to warn you that this will look really confusing at first. And this is the first time we're seeing this diagram. And don't worry, by the end of this section, this is going to make sense, and you're gonna be completely fluent in this. So just trust me in this keep following these videos. I know I'm kind of circling around the topic and not being directed to what it means, but I promise you, by the end of this, this is all going to make sense. And you're gonna be a big coat ninja. When we talk about big go and scalability of code, we simply mean when we grow bigger and bigger with our input. How much does the algorithm or function slow down? If the list of characters let's say elements here, so that is Nemo. So characters in Finding Nemo in our array as that increases, how many more operations do we have to do? That's all it is. This is what we call algorithmic. Efficiency. Big go allows us to explain this concept. I remember how in our function we initially had an array of just one, which was Nemo. So that is the number of elements, number of inputs in a function. It was right here. But then as we increase that array to have more characters and then we created that massive array of ah 100,000. So as that increases, you saw that the number of operations or the number off things we do in the loop increased over and over, and different functions have different big oh, complexities. That is, these number of operations can increase really, really fast, like this one, which is not good. You can see here that it's horrible and things that are quite good actually and dont increases much and we're gonna look at examples of different ones and how to actually measure this and what this entire notation meats. But to end this video so we can dive deeper into the topic. Just remember this point when we talk about big oh, and scalability of code, we simply mean when we grow bigger and bigger with our input, how much does the algorithm slow down? The less it slows down or the slower it slows down, the better it is. So instead of using performance done now and using time to measure the efficiency of our function. We can just calculate how many operations of computer has to perform because each operation takes time on a computer so big, oh allows us and concerns us with how many steps it takes in a function. All right, let's dig in deeper and deeper into this topic. I'll see in the next video bye bye. 18. 04 O(n): What would you say if I asked you? What is the big O of the function? Finding Nemo. Well, to make this a little bit cleaner, let's just remove performance done now, because we've learned that it's not very, very important. And we can remove the console log as well. And looking at this and this loop, what would you say? The big O is in this video. We're gonna learn about our very first big O notation. As we said, a runtime is simply how long something takes to run. How does this function? And it's runtime grow as our input increases as our ample goes from just a single item in an array Nemo to 10 items in array to 100,000. How does the efficiency of this function increase if we look at this graph? And we say we have four items in the array while the number of operations is going to be four, right, because we're gonna loop through each item and say, Is this Nemo? Is this Nemo? Is this Nemo? Is this Nemo? Four times, No matter what, we're looping four times, at least with the way that we have this code set up. If we have five items in the array, it's going to be five operations. Five loops. Six is the same. Six items is six operations seven is seven operations and ate his eight operation. Do we see a little bit of a pattern here? Well, we can draw a line through it. This is linear, right? As our number of inputs increase, the number of operations increases well. And here, ladies and gentlemen, we've learned our very first big O notation. We say that the Finding Nemo function has a big o notation of Oh, and okay, that's a little bit strange. This is just a notation that you have to get used to. But we say big go off n or but we called linear, linear time, it takes linear time to finding Nemo. Now, where does this end come from? This end can be anything. Really. I could put X. I could put fish in here if I want is just a arbitrary letter and we usually give end when it comes to big. Oh, this is just a standard that you'll see across the board and simply means the big O depends on the number off inputs the number off fish. So if we just had the Nemo array, this would just be one. If we had the everyone array, this would be 10 and we had the larger A will be 100,000. But as the inputs increase, you see that the number of operations increase linearly with it. Owen is probably the most common big O notation you'll find. If we go back to the graph, you can see that O. N is right here in the yellow region that says fair. As the number of elements increase, you see, that is just a straight line. The number of operations increases by the same a month. Because keep this in mind, Big O doesn't measure things in seconds. Instead, we're focusing on how quickly are wrong Time gross. We simply do this by using the size of the input which we call, and or anything else that we want, really. And compared to the number of operations that increase, that's what scalability meets. As things grow larger and larger, does it scale? So the Find Nemo function is o n linear time, and now the way to think about it is this if we had a compression algorithm. Let's say this function is this little compression and the input is this low box? What's the big O notation off this function? Well, if we had one element, it will just compress one item. If we had multiple elements again, we still have to run each box through the compression algorithm to compress the box. If we look at the function for the compress boxes, Well, we're using the E s five and s six Syntex here, but we're essentially looping through each box. And in the heart case, we're just Consul logging it. But he could see here that all of these all we're doing as the input increases the box is the number of Brock's increases the number of operations increase. And that is Oh, in linear time. Congratulations. You just learned your first big O notation and this is probably the most common, but there's a few others. So what other big oh notations do we have other than linear time for that? You're gonna have to keep watching. I'll see in the next video. But by 19. 05 O(1): Welcome back. We just learned our first notation. Oh, the end or linear time and we see here that we have a few others remaining. So let's talk about the next one. Another very common big O notation that you're going to see what happens if we have a function like this. A function that says compressed first box that receives on a ray of boxes. And this function simply has console dialogue boxes. Zero. So that is, it's logging out, just the first item in the box. What would you say the big o of this function is? How many steps or operations does this function take? If the box is increased from zero to maybe 10 to maybe 100 to 100,000? What would happen here? Ready for the answer? Well, this is what we call constant time. It's an O of one that is, No matter how many times the boxes increase year, or however many boxes we have, we're always just grabbing the first item in the array. If we look at this with an example, if we had an array of box this year and we run it through the function that just takes the first item in the array. Well, the number of operations is one, no matter how big this, the number of boxes are were only doing one thing. So it's a constant time. If we look at this on a graph, if we have one element or one box, we do one operation. If we have three again, we still do just one because we're just grabbing the first item in the array. If we have, let's say five, same thing seven. Same thing. And what about nine again? Same number of operation. And this is I don't know if he can see the line, but this is just constant time. It's not linear time like it was where it increases and increases. With the number of operations, the number of operations just stays flat. But I have a question here. What if we do something different? What if we do something like this? What if we fought? Have a function that says function, grab or log first two boxes and this takes on array of boxes and it's going to console dialogue, the first item in the array and it's going to console dialogue. Also, the second item India. Rey, how do we measure the big O of this function? Well, let me just comment the South for a second because we don't need this right now and just create an array called boxes. And this boxes has just a 01234 and five So five items or six in this case, because we include zero. And if we run this function, log 1st 2 boxes and we give it the boxes array and we click. Run! Here we have zero and one. So we've logged this one and then this one. What's the number of operations here? Well, we have, Oh, of one that is one operation here and then we have over here Oh, of one again. Each time this function runs to operations. So this function in total is actually running Oh, off to operations every time. So no matter how big the boxes get, the number of operations here is going to be, too. If we look at this on a graph instead of having o of one like we have before, we have oh, off to And then if we had three operations, l just be off three. But overall, It's still a flat line and this is something we're going to get into later on. But when it comes to constant time, we don't care about the nitty gritty O of one off two oo three of even 100. We round this down to just simply saying, Oh of one, that is, we have constant time. It's a flat line in terms of scalability. It doesn't matter. How big are inputs are. We're always going to do the constant amount of time on a function. And if we look at this on a graph, we see that of one over here is the dark green area. It's excellent. We love all of one because it's very scalable, right? It doesn't matter how many elements we have, it's always going to run. The same predictability when it comes to computing is very, very nice and over one is definitely excellent. Okay, so we've learned about linear time, O n and then constant time. Oh, off one. Let's do a bit of a fun exercise to really solidify our knowledge here 20. 06 O exercise: Welcome back. How much did you hate me after doing this challenge? Now this was specifically supposed to be hard and difficult and frustrating, and most likely you're not going to get right the first time around. This was done on purpose to illustrate a point. What we're actually doing here, well, you won't be asked to do in an interview. But I wanted to show you how to think about things, because later on I'll show you how it's actually a lot simpler than thinking about each individual step in a function to calculate things. There's not much math involved in. This is as Matthey as we're gonna get in this course. But again, I just want to show you the nitty gritty details so that you can think about it and have a nice foundation so that moving forward, we can simplify things a lot better. Now let's look at this function is the fun challenge function that takes some sort of an input. Their very first thing is within this function, when we run the fund challenge, let's just say we'll have fun challenge and we run this function and the input doesn't really matter. It could be Honore could be an object for now. Let's just keep things simple. Say it's an array of five now where were you brought this function? The first thing we're gonna do is an assignment. We're going to assign variable A as 10 now based on convention. And this is why you won't encounter this in an interview, because a lot of people interpret this differently. Some people say that assignment you shouldn't count towards big Oh, and some people say that you should, in our case, just to simplify things. Let's go every single step and what the function is doing. Let a equal Stan is just oh of one, because this is Onley running once. When we run fun challenge, that's it. Doesn't matter how big the impetus. This just runs once and then 50 plus three. We're reassigning a this once again is of one, and then we get into a loop. We know that with the loop, it looks like we're looking at the length of the input and looping over, depending on whatever the input is. In our case, this is going to be an O off n. Let's add that comment over here and this end is the input. Remember that I can change this to input. I can change this to acts. It doesn't really matter. It just reflects how big the impetus. That's how long this four loops going to take. And we know this by now that loops are linear time. And then within here, another function. We don't know what this function is, but it's calling to another function outside of the fund challenge function. This is also being called How many times? Well, it depends on how big our input is. So once again it's over. And what about this? Let variable stranger equal to true began another random assignment here. But this runs as many times as this loop happens. If import was five thistle run five times. So again, this will be oh, of n And then over here we have a plus plus, which in javascript simply means a plus one. So we're just incremental the whatever the number is at this time. So 53 well become 54 then, as we looked through it will keep increasing by 1 54 55 56 This once again runs 00 vent times It depends how many times their bronze by the input, because again we're looping through it. And then finally another thing that some people don't count, but just to keep it consistent every single step that we do return A This runs just once. Every time fun challenge gets run, the return statement only runs once. All right, so we have all these big o notation And now we're starting to think about how a function runs and how efficient a function is if we actually calculate all of these. If we total all these up, we see that we have 123 So we have three steps plus over when, over and over and over. And so that means we have and plus and plus. And so that means we are running the calculation and plus and plus am placenta, which turns out to be for so three plus four n is our big o notation. There it is like I said before, when it comes to big Oh, don't get too hung up on. Did I get this right because in an interview, you're not going to need to know this, but you are able to now think about how a function runs more deeply than just simply writing the coat. As we progress through the videos, you're gonna find out that this actually at the end of the day gets simplified to just oh, off and And we're going to go through that. And why that, IHS? 21. 07 O exercise2: now that we have a better understanding of how to calculate big Oh, let's look at another exercise. That should be a little bit easier than the 1st 1 that we did. What would you say? That the day go of This is Well, if we go one by one, we see here that we have of one again off one. And you know what if I keep typing, this is going to get tiresome. So I'm just gonna copy and paste. So ove one here we're just assigning variables. And then we also see here that we have a four loop that is running based on the input. We don't know what that input is, but we can just assume that we're looping based on, however, along this impetus in which case were running each one of these Oh, of end times or whatever along the input is so again, these are going to be run over in and over 10 times. And if we go down here again, same thing, we don't know what the impetus but these air being run off and times. And then finally, this last line is just run once, so it will be Oh, of one. So looking at this function, another fun challenge function we see that are over When our big O is 1234 So we have four plus because we're just adding up the steps here we have over and that's happening. 123 45 So five. And so the big O here is we have four Costin times and then five things that we're doing 10 times. Or however long the input is all right. That wasn't so bad, was it? Compared to the first time around, I think you're starting to get the hang of this. So let's dive into the next video. Let's start to figure out how we can simplify things for us so that we're not doing this mathematical step by step count. I'll see in the next video. Bye bye 22. 08 Simplifying Big O: Welcome back now, In the previous exercise and the exercise, we just did We see that we had to do a bit of calculation. It was kind of annoying where we had to add things up, then have this, you know, plus five end plus four in interviews. You're never going to do this. And you're asking yourself, Andre, why did you just teach me this? And you're right. But now you at least understand how big O gets calculate. But most of the time when you go into interviews, there's thes set of rules that you're going to follow where you don't need to do this, and you can just take a look at this function and immediately say what type of big Oh, it is. For example, this function actually just turns into O of end. This function again turns into just oh, of n and this is a nifty little trick. When we talk about Big O in interviews most of the time you're on Lee going to give one of these answers. You're most likely never going to actually calculate precisely 03 n or off three and plus two plus one. So how was I able to simplify our exercises and just say that there O N And luckily for you , they're just several rules that we can follow when it comes to Big O. And there's only four of them by following thes four rules. Instead of doing those small little calculations that we've been doing up until this moment , you can just simplify your life so that big old becomes really, really easy to calculate. Let's tackle the 1st 1 that is Rule number one. Worst case. Let's talk about that in the next video. 23. 09 Rule 1: Welcome back. Let's talk about the very first rule when it comes to big. Oh, that is worst case when calculating big Oh, we always think about the worst case. What do I mean by that? Well, if we go back to finding Nemo example and they find Nemo function, you may have been screaming at me while I was going through the function saying that, Andre, this is not efficient. What are you doing? Because if you look at this function, we're looping through the entire array to find Nemo. Remember how we had the everyone array with about 10 different characters from Finding Nemo ? Well, Nemo was only the 12 3/4 member on this array. And when we run this function, we found Nemo. But the funny thing is, this function ran 10 times, not four times. If I do a console log here and I say running, let's click this. We see that this function ran 123456789 10. I mean, we already found Nemo. All these runs are pretty wasteful, so we can make this function a little bit more efficient. In JavaScript, we can just have something called Break and again different languages have different ways off exiting out of a loop if a condition is met. In our case, if we find Nemo, just break out of this loop. If I do this and click Run. Look at that. Once we found Nemo, we're done. We're not gonna loop through the rest of the items. Congratulations. We just made our code a little bit more efficient. That's a good thing, right? Well, when it comes to Big O, although this is important and when you write good code, this is something that we want to do in the big scheme of things Big Go on. Lee cares about the worst case. What is the worst case year? Well, the worst case is that Nemo, instead of being the fourth item, is at the very end. So even if we have this break statement, we're still going to run. That's 10 times because Nemo at the end Best case is if Nemo's at the very beginning and we only have to live through it once. But worst case, we're still going to have to go through 10 loops Still big go off n. So this is our very first rule. The very first rule is we always care about what is the worst case scenario. Because when we talk about scalability, we can't just assume things are going well. Even though the Find Nemo function might be over one. If Nemo is the very first item in the your A, it doesn't matter. In the grand scheme of things, because we can't be certain of what the input is going to be. We're going to assume that off. Bingo is over and linear time again. If we're finding ah, yellow box and the yellow box is at the very end, we have to iterated through all the boxes. If the yellow box at the very beginning, you see that we don't have to iterated through these boxes. But Big o doesn't really care, even though this function yes is indeed more efficient. At the end of the day, when we talk about big Oh, we're talking about worst case, all right, I hope you got that point through. I feel like I've beaten it to a pope, so you should be comfortable with it by now. Let's talk about the next role in the next video 24. 10 Rule 2: Welcome back. Let's look a rule number two, that is Remove Constance. Let's see what I mean. I've written here the most ridiculous function ever. The function is print first item than first half. Then say hi Ah, 100 times. Probably not the best named function ever. But has the name describes? All we're doing is we're going to console log the first item and the array, and then we're going to print the first half of the items. So I'm finding the middle index of the items. So I'm saying items dot length divided by two. And I use math dot floor here in Javascript as a way for us to make sure that we get a whole number and we're going to say variable index zero, um, using a while, loop here instead of a four loop. And I'm saying, as long as middle index is greater than zero, I want you to console log the items, so that means console log the first half of the items. So we had 10 items. I'm going to console, log the 1st 5 items, and then I'm going to do another four loop and say, I'm consul logging. Hi. Ah, 100 times Pretty pretty useless, I would say not very useful function. What is the big O of this function? Well, looking over here, it's going to be big o of one over here. So we have one for just logging the first items. Then we have half of whatever the items is. So in that case is n divided by two. Because even though we have a for loop for a while loop were Onley logging half the items every time. So we can just do and divided by two. And then finally we're doing a four loop. But again, this is a bit of a trick. We're not looping over the items array. We just have 100. No matter how big the items a raise, this is going to be always 100. So I just say plus 100 that's another step, because again, we're just adding each of the steps that we see here. So this is our big go for this function. But rule number two states we want to drop the constants. We simply are saying that we don't really care that this big O is actually and divided by two plus 101 Remember in an interview. We only care about the things that we saw on the chart. Nothing specific like this. So this turns into one. And this, even though it's divided by half in the grand scheme of things we Onley care about when its scales, when the inputs are getting larger and larger. So as N gets bigger and bigger, we don't care about adding an extra 100. Because if N is a 1,000,000 adding an extra 100 on there, another 100 steps doesn't really matter. And same with dividing by two Oz and gets larger and larger, divided by two has a decreasingly significant effect. So we dropped the constants like this. So this becomes O of N plus one, okay, And because one if and was a 1,000,000 is very insignificant, we can just drop this as well. This function just becomes, oh, event. What if we had another function that had, let's say, oh, of a plus 50 or a or 50 with a ton of zeros? It doesn't really matter. We drop the constants. It's gonna be oh, over a What about this other situation? What if we have this function here compress boxes twice where this function actually has to four loops where it does the same thing. But it's 24 loops. So we have over in in this four loop and then over and in this four loop. And because these are two separate steps, well, we add them together, so becomes over and plus off and he goes off to end. But again in an interview, this doesn't really matter because we drop the constants. And if we drop the constants, what does this function equate to well is just, oh, event to prove that I'm not lying to you. If we look at this function on our graph, we see that the elements as Theo elements increase. We have two operations because we have 24 loops. If we have two elements in that case, we do four operations. If we have three, then we do 123456 and you see how it increases. But at the end of the day, even though the Linus steeper, we have a lot more operations to do, the way the line increases is still linear, and that's the key here with Big Oh, we don't really care about how steep the line is. We care about how the line moves as our inputs increase makes our lives a whole lot simpler , doesn't it? So remember, drop the constants. You're never going to really see numbers in big o notation. Most likely the notations that we've seen in the past before on our graph. Usually these and the only time you see numbers is when you have of one off and squared over. Oh, off to to the par event, which we'll get to later. Don't worry, I'll see in the next video, but by 25. 11 Rule 3: Welcome back. Let's talk about Rule number three. That is different terms for inputs, and this is one of the trickiest parts of an interview that a lot of people make mistakes on. But once you understand it, it becomes really easy to spot. So let's look at an example. I have the exact same function we saw in the last video compress boxes. Twice we have the boxes array, and we just have two loops here. I'm using the four each syntax and JavaScript. But we're just looping twice over the same array. And as I said before, the big goal of this is going to be to end. But because we dropped the constants, it becomes, oh, off end. But the third rule states that different terms for inputs and what that means is, Well, first of all, let me ask you a question. What if here I have boxes as the first parameter, and then we have boxes, too, as the second parameter. And maybe this 2nd 4 loop actually loops over the second boxes. What happens here? What is the Big O? And during an interview, a lot of people trip up and say that this is we'll still over and it's gonna be oh, to end dropped the constants, Colvin. Now, is this right? No, because the third rule states that different terms for inputs and remember boxes the 1st 1 and then the 2nd 1 are two different inputs. One could be, ah, 100 items long. Another one can be just one item. So this 1st 4 loop is going to depend on how big the first item or first input is. And then the 2nd 4 loop depends on how big this one is. And N is just an arbitrary letter that we decided on. In this case, the big O of this function would be something like a for the 1st 4 loop, which is the first input plus B. The big O of this function is actually a plus B or n plus M or boxes one plus boxes, too. So keep that in mind. Just because he to see 24 loops one after another doesn't mean that they're looping over the same items. Now you might be asking yourself, Andre, what happens if these loops are nested? So far, we've only worked with loops that are one after another What if this loop was inside of this loop? Well, let's get into the next video and talk about another common pattern we see with Big Oh, that is nested loops. 26. 12 O(n^2): one common interview question that you might get is something along the lines of log all pairs off array. No. What does that actually Meat? Well, if we had an array, I must say boxes and this array is just contains boxes numbered one through five. Now this array, If I want to log all pairs, it means that I want to log. 12 then 13 then 14 than 15 then 21 then 22 to 3 to 4 to 5. So on and so forth How we go about doing that and if you want, you can pause the video and try to attempt this problem yourself. Now, in this case, what we want to do is, well, we create a function and we'll say, Log all pairs of array that receives Honore Leisure Say array. So we're descriptive here and in here we will do a four loop. So four let high. He calls zero, and we've done this before. So if I is less than the ray dot length and we'll increment, I now in here, we want a loop. So now in the first iteration of the four loop will grab one, but then we want a loop through the boxes again and log. 1112131415 So we have another four loop and this time will say Let J. He calls zero if we want a loop from the beginning. Or I could even say one if we want to start off with 12 because we're starting off it. Index off one right here For now. We can just leave it zero and we'll say that as long as J is less than ray dot length and will increment JJ. And now finally in here. I can just say Consul dialogue Hi and J. Let's run this function and see what happens. I have to actually call this function. So let's do that log all pairs of array and I'll give it the boxes. No, and we want to make sure here that we're locking out the actual items and not the index off the array. So we'll just say our ray hi here, Andy array Jay here. And just so you don't get confused with the numbers, maybe we'll change these into letters so that it's more obvious what we're doing see de That's not D. That's D and we'll say e So if I click run here, we see that were logging all pairs A a a B a C a. D keeps going, keeps going until e You can see the log over here. What is the big O of this? And this is something that you're going to see a lot of and interviews in. A good rule of thumb is if you see Necid loops, that means instead of having to four loops one after another where we use addition, when you see loops that are nested, we use multiplication. So this becomes, oh, both end times, oh of end, which, when we multiply them becomes o n squared o to the end to the power of to. And that's a good rule of thumb. And if we go back to our graph, this function that we just created and I'm using the ES five syntax here instead of the four loops we did this over and squared is what we call quadratic time. That means every time the number of elements increase. So let's say we have two elements. We have four operations that we do If we have three elements, this actually increases. Could radically, that means instead of four operations, we now have 123456789 because we have three elements to the power off to. And you see here how the line is now bent and it increases well, quite fast. If we go back to our big O notation or big O graph, we see that 00 n squared. Well, it's horrible. As in, it's pretty slow. As the number of elements increases, the number of operations increases significantly. And a lot of interview questions are questions that ask you to solve a problem that initially is over and squared and make it faster by perhaps making it into something that is a bit lower over here. That is, is bad. Fair, good, excellent, but definitely not horrible if we go back to our rule Number three that we were discussing different terms for inputs. Well, going back to that example, we had in the previous video remember this Well, we said oh of a plus B because we had two different a race or inputs. Now if these loops were actually nested and they're not one after another. The big O would have been, oh, of a Times B, and that is rule number three, making sure to know that we have different a raise. That means different notation for each array because we don't know the lens, and an easy rule of thumb is any step that happens in the same indentation. So one after another, you add, and anything that happens with indentation that is nested, you multiply. So again, different inputs should have different variables. Let's move on to the last rule in the next video. 27. 13 Rule 4: Oh, we could feel the end almost were in Rule number four, the final rule in our rulebook. Drop non dominance or drop non dominant terms. What do we mean? Let's have a look. Let's say we have a function again with a really long name that says Print all numbers. Then all pair sums. Maybe not the best name for a function. We can probably work on the readability here, but let's see what this function does. Well, this function takes numbers, and these numbers variable. We're going to loop over them with a four East loop. So again, just looping over and logging out the numbers. And then we have another step which should remind you that's probably in addition that we're doing. We're adding another step, and in here were summing the pair sums. That is where adding each number one after another. Let's show you with a little bit of a demo here if let's say we create. Actually, we'll just print numbers and in here for the numbers. Let's just give it an array of 12345 If I click run here we see that these are the numbers . 12345 Because this is the step. We're just logging it out. Nothing too difficult. And these are their sums. All we're doing is adding one with one than one with two, which equal street one with three, which equals 41 with four, which equals five and one and five, which equal six. And then we move on to the next loop, which is two and one, which equals 32 into which equals four. And it keeps going on and on and on. So we see the loops that we've done here, and problems like this is something we're gonna do later on in the course right now, we're just worried about big Oh, what do you think the big O notation here is? Well, once again, if we do oh, off the first part is the four loop. So we can say that there's over an and then the second part, which again is another step. So we're gonna say add. Plus, this one has to four loops nested, so that means o to the power off to. All right, so that's our big O notation by rule number four states that we want to drop the non dominant terms. That means we care about the most important term in this case. We actually drop the n and just have and to the part of two. Because as the input increases, the size off end to the part, two is way more important than the end. So we always just keep the dominant term. Let me give you another example. What if we had a function that had a big o of, let's say, X to the power off, too, and then we'll say that it has three acts plus 1000 and maybe we'll say, plus X divided by two. All right, that's really, really confusing. That's math. We're not gonna want to deal with that too much. How do we simplify this? Based on the drop, non dominant terms, The fourth rule states that again we worry about the most important dominant term because X to the power of to is the most significant. That is, if X is five five to the power of to is 25 five times three is 15. This is Ah, 100 and five divided by two is 2.5. In this case, the dominant term is ah, 100. But remember with big Oh, we're worried about scale. And as things go larger and larger and larger So when this becomes 5000 well, 5000 to the par of two or 500 to the power off to that's 250,000. If I did the math right, three times 500 is only ah 100,500 Ah, 100 is now insignificant and 500 divided by two is 250. You see how this has grown significantly more again Because we're on Lee worried about scale here we drop everything else and we can just ignore completely. And this becomes X to the power of to how nice is that? Just makes things so much simpler. So there you have it. We have now a way to simplify everything. If we go back to our past examples, remember this one? I remember this one. It now makes sense why we've just said they go off and because we don't care about the insignificant items on Lee the most important ones. And same with this one, by the way, a fun little note here. If we had another loop inside off these two loops? Well, this would become, oh, to the power of X cubed or and cubed doesn't really matter what we have, but it's gonna be to the power of three because we have three nested layers and you can keep going to have to the par of four to the par five. But here's the thing. If you have three nested loops 99.99% of the time, that's usually a bad idea. It scales really, really badly, and most likely you're doing something wrong. And there you have it. We've gone over the four Rules, and with this in mind, we're going to take a look at the Cici that I've prepared for you. So from now on, instead of having to calculate everything and really look at every single detail of a function you can right away, figure out what the big O is or what the time complexity or a function is 28. 14 Big O Cheat Sheet: now I've created for you a nice big OCI cheat. Although we've taken a lot of time to go through everything of the end of the day when it comes to preparing for an interview, this is pretty much all you need to know. And you can use this to review some of the topics we've covered as well as what we're gonna cover for future section. We see here that the big goes there mainly these ones over here. Now we haven't gone through everything. We've gone through constant time, but we haven't gone through something like, Oh law again or Owen log in or go to the to to the par of end or even this one with the exclamation mark. It wonder what that IHS Well, we're going to get into that. But the reason I haven't talked about them yet is because they're going to come up when we talk about data structures and algorithms. These commented out big Oh, notations are very specific for certain algorithms and data structures to optimize coat. So we're going to get into that when we talk about these topics because they'll make more sense to you, such as old log in is used a lot when it comes to searching algorithms or O n Log in is used the law when it comes to Storting algorithms, and something like 02 to the par event comes into play when we talk about recursive algorithms. So again, don't get overwhelmed. We've talked about these three major ones, and we're gonna come back to the rest throughout the course. Now when it comes to Big goes, I want you to keep in mind two things when you're iterating through half a collection, it's still owe to the PA Rove or O to the end. Remember, Oh, and divided by two. It's still at the end of the day, Owen, Remember our rule book and again. Another trick that often comes up in interviews is that to separate collections should be a plus B or, if they're nested a Times B. So to separate inputs should have to separate variables in big O notation. And just to keep in mind what causes time in a function. Because that's what we're measuring right now. Well, operations compare since looping, we know that takes a while and things like outside function calls when you have a function inside of a function. And then finally we talked about our rule book. Always big. Oh, measures the worst case. We want to remove constants. We wanna have different inputs that have different variables. So a plus B a a and B are race if they're nested, are a time speed against something that we've mentioned up here. The easy way to remember this is addition for steps in order and multiplication before nested steps and then finally rule for is to drop non dominant terms. Pretty simple, right? I'm gonna bring this big Ochichi back when we start talking and filling our gaps with the rest of the big old notation. But for now, let's get into the next lesson. 29. 15 What does this all mean?: Welcome back. You may have noticed something while talking about they go scalable means we worry about large inputs. What does the end of the graph look like? So if our function is Onley worried about really small inputs or you know that are inputs are only going to be, let's say, an array off five items big owo matter as much does it because over here, if the elements are small, all these lines that kind of bunched up together they're all the same. But is that really life? No. Because us humans, we tend to think in here and now we tend to think that Oh, our websites only going to have ah 100 users. That's it. But what if that user base gross? What if our inputs grow? We never know when we write code. We want to write code that can scale so that we don't have to constantly go back and fix things. Or when things get out of hand, the code breaks. And that's why big oh is so important To write scalable code means thinking outside of just the small little section over here, it means thinking, long term thinking big about your code And what could happen in the future? No, you're thinking to yourself right now. Hey, Andre, I feel like I just learned a whole bunch of theory and no practical information. Andre, I want to know exactly how I can use this in my day to day life as a coder. I'm kind of getting bored here. Well, with this new fund knowledge, you're going to look a code different, Leela. Right? Let's have a look. You see, now, when we look at methods that we get in a language such as methods in an array, When it comes to javascript, we have things like push pop shift on shift. You see, all these methods which are functions, have a cost associated with them a big oh cost. For example, when it comes to a race, when we search for an item over me, access the first item in array, for example, it's o of one. But when we use something like on shift, well, it actually turns out to be oo ven and why that is we're going to get into when we talk about the data structure array in the data structure section. But you're going to start to see for the rest of this course how we use big go to measure why one data structure might be better than others. Why should we use an array instead? Off, Let's say on object. Maybe object has better functions that we need for our data. This graph that we've talked about up until now is actually part of big Ochichi dot com. And if we scroll down here, you'll see that each data structure that is an array and in this case, objects on this table is a hash table again, something that we're gonna cover in the data structure section. But we see that we have different big O notation for different data structure, and some data structures have really good search. Big Oh, some have insertion, Some have deletion, and you can see here that there's different pros and cons to each of these data structures . As you'll find out in this course, data structures are simply ways to store data and algorithms are simply functions or ways to use that a structures to write our programs remember our restrictions for machines for our computers and great programmers have this knowledge where they pick the right data structure, the right algorithms to write good programs. Remember our two rules of good coat readable and scalable. And what we've learned is the foundation for us to make a decision off which data structure is going to be best when we get into the data structure section, because we're going to know, Oh, a raise allows us to access at O and one constant time. But when it comes to searching through an array, it's going to give us linear time versus perhaps, maybe a knob checked. So behind the scenes, even though this section maybe a little bit theoretical and boring, what we've just learned is going to lay the foundation for the rest. The course for us to be able to write good coat for the rest of the sections. We're gonna use big Go to see what is a good solution to a problem and what is a bad solution to a problem. And most interviews have this core concept. What's the right data structure? What's the right algorithm to write good programs? Google hires engineers and developers, then know this because they have a lot of scale that they have to think about a lot of inputs and people that know how to handle these programs are the ones that are going to be able to build great programs. I'll see in the next one. Bye bye. 30. 16 O(n!): Let's quickly talk about a big O notation that you're most likely not going to encounter. And if you're writing any code that has this big O notation, you're definitely doing something wrong. It's the most expensive one. It's the steepest of them all. And this is called factorial time or as I like to call it, the Oh, no, we're not even gonna do a demonstration on this because you're just not going to encounter it. I just want to show you that it exists with Oh and Factorial. And this is a mathematical notation with the exclamation mark. You can search for it and see how it works underneath the hood. But with this, it means that we're adding a nested loop for every input that we have. Yeah, that sounds pretty terrible, doesn't it? Again, just to keep in mind and to get this out of the way. Oh, and Factorial probably never going to see it. But it's still it's there, and it kind of looks cool so we can cross another one off our Tichy. Owen factorial. You're adding a loop for every element that your iterating over. Yeah, it's an expensive one I'm not going to see and much. So I'll see him the next video. Bye bye 31. 17 3 pillars of coding: what is good coat? By this point, you should be able to talk a little bit, especially about scalable, right? I mean readable. We're gonna talk about in the next section, but scalable, we understood was Bago, right? Well, here's the thing. Don't hate me, but I may have slightly lied or simplified things, but but not that much. So don't worry. We can build on that. When I say scalable. There's actually two things that we want to consider as engineers. One is speed. That's what we've been talking about up until now. How fast is our runtime on the code? How much time does it take for a function to run? How many operations does it cost? Well, there's another aspect when it comes to machines, too. Valuable resource is one is the time and speed off our code, and the other one is memory. You see, computers have a limited memory. Back in the day, when computers were just being born, memory was very, very expensive. We only had a little bit of it, and as time has gone on, we have mawr and more memory. But it's not infinite. Our computers run based on speed, which is usually dictated by the CPU and memory, based on how much memory such as RAM and random access memory the computer has. And those air too valuable resource is. So how can we talk about memory? We've talked about speed or about memory, and the good news is that memories fairly simple, not as complicated a speed, and it won't take us long to learn as much as we have about speed. Right now, which code is best can be answered with the three pillars of coat something that I don't want you to take with you for the rest of your career and something that's going to grow you as an engineer because from now on, when you write code, you're gonna have these three things in mind. One is your gonna write readable, clean code that others can read. That is maintainable. The other one is speed. The type of code that we call time complexity has a big, oh, time complexity that is efficient. It scales well. But we're gonna talk about quickly about this third pillar, and that is memory. What's the memory usage of code? If it uses a lot of memory, that's not good. We might have limited memory on our machine. With this one, we use big go once again to talk about space. Complex city, the same notation but different Topic one is space. The other one this time one a speed. The other one is memory. I'm gonna give you a quick little preview. Most programming code solution. There's usually a trade off between speed and memory. You want things to go faster? Well, then you might have to sacrifice more memory. You want less memory? Well, then you might have to sacrifice with increased speed. Let's get into the nitty gritty of how we measure space complexity. 32. 18 Space Complexity: when a program executes, it has two ways to remember things. The heap and the stack. The heap is usually where we store variables that we assign values to, and the stack is usually where we keep track of our function calls. Sometimes we want to optimize for using less memory instead of using last time talking about memory or space. Complex city is very similar to talking about the time cost. We simply look at the total size relative to the size of the input and see how many new variables or new memory were allocating how much memory is being used. So let's look at an example. Up to this point, we've talked about time, complexity and how. If we want to compress, let's say some boxes. We just talked about how fast and how many operations this would take. But in real life there's this other factor off memory, and we have this pink little box of how much this function can take, how much input it's able to take. For example, if we had a Thanh of boxes that we have to create to run this function well has limited capacity and it might overflow by the way things like Stack Overflow is something we're gonna be talking about and how it's an issue. When it comes to memory, something will cover when we get into Rikers. What causes this space? Complexity? Well, luckily for you, I added this to our teaching. What causes space complexity? Well, adding variables, adding data structures like a raise objects hash tables. Again. Things will talk about function, calls and allocations. I don't need this period, but let's actually code something and show you an example. In the next video, we'll go through some space complexity exercises and figure out how we can give Bago notation to the subject. 33. 19 Exercise Space Complexity: Welcome back. Let's talk about space complexity. What if I have a function that has the name of Boo and all it does? It's It takes a name put, and within this input it's going to simply have a loop that we've seen before And this loop . Let's make sure that do this properly and say that and at length and we'll say I plus plus . And this function is a really useless function that just simply logs out consul dialogue. Do scary function. So now in here. If we just run the function and just give it an input off, let's say one, 2345 and run it well. We have boo running five times, and we know that the space complexity of this function or time complexity of this function is a win. But when it comes to space complexity, let's think about this. What is the space complexity of this? Now try to guess before I go into the topic. The one gotcha when it comes to space complexity is that when we talk about space complex city, we're talking about additional space, so we don't include space taken up by the inputs. So we don't really care how big the input is. I mean, we do care, but when it comes to this function, we don't really have a control over what sort of input it receives. We only have control of what happens inside of this function. So within dysfunction are we adding any space? Well, not really. The only thing we're really doing is we're creating this. Let I equals zero variable, and that's it. Other than that, we're not really adding any more memory. So this function has a space complexity of 01 nice and simple. But what if we have a different function? What if we have something like this this time we'll have a function that says array of gonna give it another terrible name. Hi. And times God, that's a terrible name. But let's say that this function takes again an input, and within here we're going to create a new variable. We're gonna say, Let High Array is going to equal an empty array and within here, we're gonna have a loop. I'm just gonna copy this for now, so I don't have to bore you with my typing. And in here I'm going to simply say hi array in the index. So as we're looping, we're going to fill it up with high. And we're going to return this Ray Hi, gray. All we're doing is we're creating a new array and for the number off items in our input, we're going to just fill up high array with repeatedly high, high, high, high strength. So if I do this again and I say array of high end times and I give it, let's say we'll give it And you know what? Instead of length here, let's just leave it as a number. So I'm going to say end and I'll say six times. So if I run this code, we see that even though we have the boo boo boo over here from the beginning, the other function array of high end times returns us a new array with six items, and each item just simply says hi. What is the space complexity of this? Well, this should give you a hint. Remember, our Cici variables, data structures, function calls, allocation those things take space. And in our case, we created variables in our loop variable. I equals zero. But we've also created data structures, right? We created a new array. So now if we go back, we see that in here. We've created a new array, and we fill this array with and loops and again because of our rules. When it comes to big Oh, we ignore the constant time. Let Article zero space and instead this becomes, oh of in because we're creating a new data structure and adding memory. So each item is an additional memory space on our computers and times. And you know what? That's pretty much it when it comes to space complexity. I think you're getting the idea, and we'll get a little bit more into when we talk about Rikers in. But when it comes to space complexity, you're either adding additional memory that you need to use. And that's sometimes a big concern. And sometimes there isn't and something that comes up a lot and interviews and something that will talk about in the next section. That is, sometimes there's a trade off between saving time and saving space, so you have to decide which one you're optimizing for. Let's get into some fun examples based on what we've just learned in the next video, See you on that one. But by 34. 20 Twitter exercise: All right, let's do a fun exercise to show you that you've actually just become a better engineer. Let's have a situation. Let's say you're working at Twitter. I hope everybody knows Twitter here. If you're working at Twitter and your boss asked you to build a feature, perhaps a feature that allows anybody to click a button next to their name and retrieve their most recent tweet and their oldest tweet. So that is their very first tweet and their very latest tweet, based on big O notation and what we know about big O notation. What can we assume about this problem? Well, without coating anything, we know that we have to find first and then find and or whatever the last item miss. Now we don't know how the tweets are stored in our database or whichever way Twitter organizes these things. But based on how they are stored, we might be able to just grab, let's say, the tweets, where in an array Solis a const array and we'll have an array of tweets. And let's just say we have three tweets here. There you go. Just three simple tweets will say that this one is the oldest, and this one is the most recent. If we have an array here, we know that it's going to take us. If the tweets are stored in an array, it's going to take us. Well, if we go Ferree zero, we get the the oldest tweet. And if we go array array dot length minus one. We get the three minus one. So that is two, that is 012 This is gonna be to We're going to get Teddy the most recent tweet. And because of the way a raise work, we know that both of these operations will be, oh, one time. And this one will also be, oh, one or constant time. So a total of 02 operation. But we again use our rulebook and simplify it to constant time. So that's great. Rebuild a nice little simple Twitter application and we can get that information very easily. But now our boss comes back to us and say, Hey, I want you to compare the dates of tweets. So I want you to look at every tweet now within each array, there's a knob checked with each tweet. Now we have, and this person does not tweet a lot. Three tweets in ah in six years. But now we have to compare each tweet with all the other tweets and compared their dates. What is the big go off this operation? Well, because we're comparing each item in the array with the other. This just sound familiar were doing nested loops. So this is going to take Oh, and square time, at least with what we know right now. So we know that this is gonna take a lot. And it's a person that has a lot of tweets, a lot of inputs in the array. This operation might cost us a lot of money, a Twitter. So you might want to tell your boss who we might have an issue here. We might need to do something else, perhaps store this information in a better format or do something different with our program in order to avoid something that might be inefficient. They might be expensive for the company. And just by thinking like this, now you have this ability to think long term, think scalable coat, by the way, as a fun one. What happens if I ask you what is the what is the operation and what's going to cost us. If I have a string and I do dot Glenn thier and JavaScript, that just means what is the length of our string that is 20. That means we have 20 items in the string. What do you think the big O notation of this is? And this is a bit of a trick question and something that you might get asked in an interview, because the answer to this is depends. It depends on the language that you're working with. We need to know how the method works on the string here, and that's built into JavaScript, and you'll have a different built in method for your language. Based on how the language is built, this dot length might go one by one and iterating over each letter and count 0123 for 56789 10 all the way until 20. But Java script actually has dot length property built in to each strength. So for JavaScript, this doll length property is just a simple look up. It's not a function. We're not running this function to calculate things. Instead, it's simply a property often object. And because of that and again, if you're not super familiar with JavaScript, this may be a little bit confusing, but don't stress out. The idea is that this operation in JavaScript is oh, constant time. But without knowing how your language works, you don't know how this property, my work how perhaps if you had a method, how that my work. But now you have a powerful foundation, powerful pillar, to start thinking about code in a different way. Start looking at space and time of something that are valuable to us as engineers. As resource is that we must be careful we don't have infinite amount of resource is we have to be careful when we code how we use up these resource is and that alone makes you a better engineer. I'll see in the next video. But by 35. 21 Review: Big O says which function algorithms or code is best. We learned that when it comes to good code, were concerned about readability and scalability, and Bago allows us to measure the idea of scalable coat. And why do we care? It's because there is no such thing as a free lunch. You save time and money for a company. Juries superstar Knowing how much time your coat takes, how much memory it uses is very, very critical. Those are expensive things for a company or a product. Now, Big Go is a very important concept that you won't find in your day to day job. But it's something that should always be in the back of your mind. And good developers and engineers always have this knowledge. That is why it is such a popular topic. During interviews, Bingo is used to describe how efficient we can run her coat. It saves companies a lot of money if people they hire know how to ride a fishing coat. And in this section we learned about the idea of time, complexity and space complexity how we can use big go to measure, both thinks, but each one is a trade off between the other and Big Oh describes the upper bound of our estimates. We're always looking at the worst case scenario. We want to be pessimistic and say What is the worst case scenario here with our code so we can be prepared when the time comes. Now Time, complexity and space complex city time is how long it takes the algorithm to run, and space is the memory that it was required by the algorithm. The important thing that we learned here is that Big O is about how you can scale. It doesn't necessarily mean that O. N is better than oh and square, because scalability wasn't the only factor rate. Readability is something that we were concerned with as well. Sometimes readability, maybe matters more than scalability. Maybe time complexity is less important than space complexity, and that's something that you want to be careful of. Now, with this new found knowledge, premature optimization can be the root of all evil. It's a famous quote that a lot of developers no sometimes optimizing for time or space, can negatively impact the readability of code. So if you're working at a young startup, for example might be more important for you to write code that's easy to ship and perhaps easy to understand later. Perhaps not take as much time to write the code and think about the code and its implications for long term. Because maybe the startup has limited budget and needs things done fast. That doesn't mean startups don't care about Big Oh analysis. A great engineer at a start up or at a big company knows how to strike the right balance between run time, space and, of course, readability. The thing to keep in mind is that data needs to be sufficiently big to talk about Big Oh, it's about scaling if you're function is linear time, but the input is always, let's say, seven items, then the linear time algorithm might be better than the constant time algorithm. So really, really depends on your situation. I introduced Big Oh here because we're going to be using it throughout this course, and as we learn more about data structures and algorithms, we're going to learn more about Bago and some other things we saw in this graph that we haven't talked about. But I hope you now look at a code differently and you had a few ah ha moments throughout this section. It's certainly my favorite section in a great topic that really made me a better engineer once I learned this topic, so I hope it did for you as well. Had the end of this all, you have a way to look at code differently. And when someone says, Hey, how good is my coat? You have a nice new way of looking at things and measuring things I'll see in the next one , but by 36. Optional: Javascript Loops: welcome back. I just wanted to show you a quick video, especially for those that are familiar with JavaScript, that there are many, many ways to do loops and JavaScript and same with other languages as well. There's many ways to do these loops, so I just want to show you some quick ones that you might see throughout the course just so you're familiar with them. For example, the Find Nemo function that has a four loop can also be written with something like a for each function. So I can say Const. Find Nemo to takes in Honore. And we can say that for each array for each, which is pretty much the exact same thing is a four loop but requires you to not have to type this entire thing for each item in the race. So we'll say I we're going to say if hi equals Nemo, because in this case with for each, we're not taking the index were taking the item in the array. So maybe you could just say fishing here just so it's more or it makes more sense. And if that is the case, will just console dialogue found Nemo again that is the same thing as this four. Each just allows us to simplify things a little bit. There is also another way that we can do this in JavaScript with the four off loop. If we just copy this code and do find Nemo three this time the array that we're going to take, we're going to say instead of the for each, this time we're going to say four. Let I of Array and again, this gives us the same thing the I or we can just a fish year. Just so it's more clear. Is he called to Nemo? We're going to say, Found Nemo. And if we run these functions, let's make sure that if they both work, so find Nemo to find a more three and we also run Find Nemo. If I click run when I don't need the bracket for this one, if I click run, we see that we found Nemo all three times different ways of solving this problem. All of them are using loops, but he can see some are more readable than others, and that's something that we've encountered before, right? Remember, a good code means something that is scalable, but also something that is readable depending on your situation, and something will get into later on how maintainable and how others on your team can understand this code. There's different ways of doing things so that it's easier to work with. But I hope that if you see this Intacs throughout this course, your least are familiar that at the end of the day, all we're doing is just loops I'll see in the next one. 37. 01 Introduction: What is a data structure? A data structure is a collection of values. Algorithms are the steps or processes we put into place to manipulate thes collection of values. It's what allows us to write programs. Ah, person who knows how data structures and algorithms work and how to use them can write programs, great programs. The beauty is that these are timeless, no matter what programming language you use, whether you prefer one library over the other, whether you write code in angular or react in the front end development world or you are a game developer underneath it all its all data structures and algorithms. If you understand these, then you can really easily adapt and tackle all sorts of technical problems. It is why companies like Facebook, Amazon, Netflix, Google ask questions specific to data structures and algorithms. Because although it may be important to know the latest and greatest JavaScript syntax or maybe the latest and greatest library, those things change if you know the fundamental. So then they can throw you any problem, any situation, and you're able to make the right decision. This knowledge is extremely valuable. The longer you are in the field the more and more you realize that you need these fundamental principles of data structures and algorithms in order to be a great developer or engineer. So let's get started with that. Over the next few sections. We have a long way to go to get familiar with data structures and algorithms. So I came right. Great programs. Let's get started. 38. 02 What are companies looking for?: So what are companies looking for? Most people tend to think it's just coding skills, but as you can see here, there's actually four things that they're looking for. One is analytic skills. That is, how can you think through a problem and analyze things? And when you're coding jury and interview, they want to hear your thought process and how you go from not knowing the answer to solving the problem. They're also looking at coding skills, which is, Do you code? Well, is your code clean while organized, readable. They also want toe obviously know their technical skills or technical knowledge, that is, Do you know the fundamentals? Did you just memorize things? Or do you understand the pros and cons of different solutions? And then, finally, your communication skills? Does your personality match the company's personality? Can you communicate well with others with the team? Most likely, you won't be working by yourself. You're working with others with other teams with bosses with managers, and they want to know whether you're the type of person that's going to fit well and work well within the company. Again, most people get hung up on the idea of learning every single algorithm data structure doing 1000 problems to practice before an interview, and these are important. But in most companies you own actually need to know how to write a binary search tree or write a sorting algorithm from scratch. I mean, we're gonna go through that in this course, but most of the time you learn it on the go on the job when you actually need it. And let's be honest, as engineers, we know that most of the time when a problem presents itself, we're good at searching the Web on Google for answers. Not a single one of us that everything memorized in our head cos notice they're not dump. What they're looking for are people who know how to look for answers. And they want to know that you know your data structures and algorithms and you know of their existence. That's the key. They want to know when you should use a certain data structure over the other. Why should we use a certain algorithm over another at the end of the day? Companies want smart people. They want people that can solve problems, that they cannot solve themselves because that's what they're paying you. And having worked at companies and also hiring people, it's surprisingly hard to find people that can solve problems themselves without holding their hand or walking them through a problem entirely. So moving forward, I ask of you to just do this one simple thing. Do all the exercises in the course, pause the videos if you need to re watch the videos if you need to. You need to understand the why of doing things. Why are we learning this? Why is this the answer to the problem? Why is this answer better than the other again? Don't worry. We're going to practice this muscle throughout. Okay, let's dive into the next video to see what we're gonna learn. I'll see in the next video, but by 39. 03 What we need to learn: in order to solve coding problems, we need to learn these data structures and these algorithms it doesn't look that bad, does it? Here's the big secret. They're a lot more data structures in this and a lot more algorithms than this. But just like when you learn a new language, you don't read through the dictionary and learn every single word in that dictionary in that language. Instead, you focus on being able to communicate with others. You only focus on things that are being used most of the time. And when it comes to data structures and algorithms, these are where you're going to get asked on an interviews. Because these are the ones that gay use the most and 90% of the time to solve a really complex problem. You're only using these things. Doesn't look that bad, does it? All you need is the base line skills, and companies just want to know that you prepare for the interview and can succeed within their system. A lot of people complain about quoting interviews or whiteboard interviews and how useless they are because they never use some of these algorithms or data structure in their day to day job, but they're just a way to weed out people that aren't willing to work hard. Look at this as an advantage. Not many people work on their interview questions. You're going to work harder than 99% of the people out there because you know that getting a good job, we'll have a big impact on your life. And I mean, that's why you're taking the course. And as you see here, the good news is that it's not as hard as you think. You just have to put your time and effort into the right things as long as we learned are right data structures when and why to use them, how to implement them, how to solve problems with them and same with algorithms. And we combine it with our Cici that I'll create for you when we compare our code that is readable, that is, memory efficient and time efficient. Using big O between these two, that's all interviews are. That's all coding interviews ask for. If we go back to our online of the course, we're now getting into the technical interview section, and when I click over here, it's gonna look overwhelming at first, and we're going to go over this diagram so it all makes sense. We're going to talk about different data structures that we have. Let's zoom in a bit. Here. You can see we're going to talk about a raise, trees, stacks and graphs and a lot more. We're going to talk about the big O off each one of these data structures. We're going to talk about different algorithms when to use what? And like I said, this is going to look overwhelming at first. But we're gonna go through this step by step so that at the end, all of this makes sense to you. We're also going to use the cheat sheet right over here to help us solve these coding problems. Now, in this cheat sheet, we've already covered the three pillars of good code. We already talked about what skills the interviewer is looking for, but we haven't talked about this part. So let's start with this section in the next video 40. 04 google interview exercise: Welcome back. We're going to do a fun little exercise here now instead of me just reading off what I wrote, I have a little asked for you. You're gonna use this cheat sheet and look at the step by step through a problem, which is a 15 step guide of why you should do when you're in a coating interview to solve a problem. And I want you to use this as you watch a little video. Now this video is actually produced by Google, and it demonstrates it's 24 minutes, so it's a little bit long, but it demonstrates how you should answer a coding interview. And in my opinion, this is the best coding interview that I've ever seen. Now I want you to watch this and keep in mind that because we haven't learned data structures and algorithms yet, this is going to be quite difficult for you to understand. And that's the goal here. When you watch this, it's gonna be really, really hard to follow the actual coding. Maybe some of the language that they use. I believe they're writing the code in C plus plus, if you don't know C plus plus it might be difficult, but that's not the point. The point for you here is to watch this video, but also read the step by, Step through a problem and see how the interview E in this case in this video follows these steps. And these steps are what you're going to do when you solve a problem in a coding interview . The fun thing is that at the end of this course, we're going to revisit the video, this video, and you're going to notice a difference from this very first time. You you're gonna wash this video to the very end where, what? The interview he does become second nature. You understand what they're coding in what they're doing to solve the problem and all these little steps so that I succeed if you completely get this video and you understand how to run a successful interview at a company like Google or any large company, or maybe even start up depending on what you like, So to get started, I'll be right back. You go watch this video, you follow the 50 steps, and after this, we're going to do a little problem of our own and follow the guide. The 15 step Guide to Solve Our own little problem. I'll see you that one, but by 41. 05 Problem Solving: welcome back by this point that you should be familiar with how a typical successful, quoting interview should look like, especially how to solve a problem in front of a Nintendo you and we're going to do a fun little exercise here. An interviewer just asked us a question. And this is the question right here given to raise creative function that lets a user no true or false, whether these two race contain any common items. For example, if we had to race here one containing ABC X and the other one Z y and I, it would return false because there's nothing common between these to race. However, in this example, array one an array to both contained X, and because they have a common item, it should return True. So an interviewer just asked you this question. How will we go about solving it? Well, let's go step by step through her little guy. When the interviewer says the question, Write down the key points at the top. Make sure you have all the details. Show how organized you are. Well, in this case, I've kind of done this for you over here. Ideally, you would write this out. How's your coding? And make sure that you show the interviewer. Okay, if I had this example, they should return. False. If I had this example, it should return. True. Now let's say the inch fear on Lee gave you these points and no other information. At least now you have an idea of what our problem is going to look at and whether we want her return, false or true. But we have two things that we want to do with our function. One is we have to parameters and this function is going to return true or false. Now, in the second point, make sure you double check what air the inputs. What are the outputs? Well, we've kind of already done that, and we've confirmed with our interfere that we have two inputs which are a race we can even ask the interviewer that Are they always going to be a raise? Is it possible that the input might not be a race? Maybe an object, maybe a string, and we can confirm with the interior what those cases are. In our case, let's say that the interview says that these two parameters are always going to be a race, and we always want to return true or false. And number two is really important here because we don't ever want to jump straight into coding. Even if you think you know the answer or you've seen this problem before, you know exactly what to do. Don't jump straight. Encoding. First, explain your approach like I'm doing here, talking it out. Because if there are any problems with your approach or with your understanding of the question your interviewer is going too often, point them out to you here before jumping straight in and looking you your code and saying that No, this is wrong This way. Both EU and the interview know exactly what the steps are that you need to follow. Now let's look at Point number three here. What is the most important value or the problem? Do you have time, space and memory to run this function? What is the mingle now? Because this is a simple question. We might want to ask the interviewer how large this arrays going to get, because if danger of your says the array is never going to be more than five items, well, then maybe we don't have to worry about big O R. Time, complexity or space complexity as much. And then you can ask the interviewer, is our goal here to be a sufficient as possible with our function? What's more important to us is time complexity more important to oris space complexity. More important, maybe they interview or might tell you that we just want the most efficient function that you can come up with, assuming that the array can get very, very large. So let's say in here we have two parameters arrays that have no size limit, so these rays can get really, really big. And in terms of returning to her false, that's all we want. We just want a Boolean return now. Number four. Don't be a knowing when asking too many questions, and we're kind of getting to that territory where we've asked a lot of question to the interviewer, and we kind of have an idea of what we want to do. We can keep asking them question, but remember, you usually have a time limit. You don't want to keep bothering them and knowing them and just asking them all these small little questions before we start coating, keep time in mind. And I think at this point we have information that we can move on with our assumption to start solving the problem. So number five start with the naive brute force approach. First thing that comes into mind, it shows that you're able to think well and critically. And you don't even need to write this code. Just speak about it. This is always a case when a niche of your ask your question, they usually have une easy solution that we call the brute force which is not the most efficient but usually is the easiest one or the 1st 1 that comes up in my So in our case, if we look at this during an interview with a time limit, you might say this looks like a nested loop where we're comparing a with Z and then a with why than a with I. And then we go to be with Z B with Why be with I and then so on and so forth so immediately ? This looks like we're comparing two different a raise and we're gonna have 24 loops, one nested on top of each other and right away. We know that that's a big O, which we've talked about of O and Square, most likely during an interview. Nested for loops is something that we want to avoid. Just telling the interviewer this solution, even though it's not the best solution already shows that you're thinking clearly about the problem, and it also gives you a point from where to improve From now. You don't necessarily have to code this part, and it's usually enough just to describe how it works. Kind of like I just did now. But depending on your time, you may or may not want to code. This is well, the important thing is that you let the interview or no, that this is the brute force or the easy, naive solution that may not be the most efficient. At least this way you have the right answer than running out of time and not even having an answer number six year is tell me. Tell them why this approach is not the best. So in our case, we said that the code might be not efficient or we might have not readable or a code that is going to be really complicated and hard to read for other developers with my demonstration because I just want you to think about this and so I could be more clear off why this is Owen squared. I'm going to just code. And most likely, you wouldn't do this in an interview. I'm just gonna code the brute force solution so you can see what I meet. I'm going, Teoh have a function, and this function is going to say contains common item, and it's going to receive to race are a one and a ray, too. Now we are going to take the first array and do a four loop, so I'm gonna say four. Let I groups let hi equals zero and we'll say that as long as I is less than the array one dot length So that's the length of the first array. We're gonna increment I And within this loop, we're gonna have another four loop. So in the first time around, we're gonna grab a from the first array, and we're gonna compare it to the second Ray Z, Y and X. So we're gonna have a for loop here and we'll say that we'll have the same Think lit this time instead of I will say Jay equals zero And this j As long as it's smaller than array to dot length, it's going to increment. Every time we looked through it and finally within here, we're going to do a bit of a comparison. We're gonna compare a to Z than A to why than a two X So if I go over here and say if array one index of I so a ray one at index of I so the first time around, I is going to be zero. So that means array one is going to contain a Let's actually grab this so we can see it better at the top over here. I'm going to have to race here, and we're going to say that Array zero first time around is going to grab a and if that equals array to But whatever Jay is, Jay is the index off array to so first time around is gonna compare it to Z so and see, and then as this increments is going to compare to and why and then this going to increment compare a two X and then we go to the top loop again. I gets incremental so it becomes one now. So we're going to start comparing B to Z B to I B two X and then see two zc too high. See two accents a lot. If that's the case and if this is true, which one are return true? Otherwise, if we looked through this and this never matches well, in that case, we can just return False here. Now let's see if this works. I'm going to just say contains a common item, and we're going to give it the to race array one and array to If we run this and let's make this a little bit smaller, seek and see if I run this, I get true because there's a common item of X. If I change this to now, have our and I click run, I get false again. If we change this to a and click run, we get true because a and a match up looking at this and we look at number six over here that IHS let's make this screen a little bit more organized so we can read this. Number six is tell them why this approach is not the best. Now again, you might not have time to even code this, but we can right away see that we have to four loops, one nested after another. And because we've already talked about this in the big O section, we know that we have a big oh when it comes to time complexity here, off while we have an array A and another Ray. So that means multiplied by B again. This is a bit of a trick because these two rays can be different sizes. We can just say Oh and square, because these two arrays can have again, like I said, different sizes. So this is a bit of a trick, and it's a good thing that we wrote it out because now we see that instead of Owen squared , this is more like, oh, a Times B. If the erase sizes are the same, they will be the same as all went square, so that's pretty slow. So number seven walk through your approach common things and see where you may be able to break things. Any repetition, bottlenecks like Owen squared or unnecessary work. Did you use all the information the interviewer gave you and so on and so forth. Now, looking at this, I can say that we could probably do better. You might not see a solution right away, And that is because you need to practice a few of these problems to understand a common pattern. But one of the most common patterns when it comes to nested for loops is that you might be able to use something called hash tables which will get through in JavaScript. They're called objects in order to speed things up. Is there a way to turn this? Oh, a times B time, complexity, and do something faster. We are doing a bit of unnecessary work where we just keep looping a Z a y a and then we go BZ b y b a and we're doing this comparison in the same work over and over. What if we have a better solution? I'm going to comment this out for now and scroll all the way to the bottom. And we don't need this anymore and try a different solution. Gonna bring the array down here just so we can see it now before we start actually coding. Let's think about what steps we want to take. Well, what if we had a function that takes the first array? So let's say Array one is going to be converted, Teoh on object, and this object is going to contain something like this will contain. And let's make sure we comment this out. It's going to contain a equals true. Then be close to true, see close to true. And then finally it's going tohave acts equals to truth. Now, if we create an object like this, we can now use this object without array to to just say array to Can we check each item in array to to this object and see if a property exist? Ideally, we can do something like a ray, too Index and see if this equals any of the object dot properties. Okay, let's let's walk through this one more time. This is a common pattern that you're going to see ah lot when it comes to improving time complexity. So if you don't get this right away, don't stress out. This is something that will become more more familiar to you as we do more problems. But if I'm able to convert to the first array into an object that looks like this. Now, instead of having to loop over both the race, I can just loop through the second array and just simply check if the property Z exists on this object that we created. No, it doesn't. Does the property Why exist on the Serie No Dozen? Doesn't property a exist on this object? Yes, it does. That means we have a common item now to show you how this actually works and why this solution would be better than the 1st 1 I need to actually start coating it. But as we go through number eight, we see that before you start coding, we wanna walk through your code and write down the steps you're going to do. So let's start doing that. I'm going to say that we're gonna create a new function. Contains a common item in this one. I'm gonna add to, because is our second function. It's going to take in an array of one and a ray, too. And now this function, let's make this a little bit smaller, so looks nicer. There you go. This function is going to say first, I want you to loop through first array and create object where properties equal items in the array. And then the second thing will be to loop through second array and check if I m in second array exists on created object. Now, before we even start coating this, I can right away. Since that we're gonna have a better performance than the first Ray, That was Oh, a time Speak, because what we're gonna do is have two loops. But these two loops aren't going to be nested. Remember, in the first solution we had nested for loops in this solution in our second solution, we're gonna have to separate four loops. And if you remember, our big oh analysis when we have steps one after another instead, off nested the big O becomes a plus B. We have a potential solution here. Have a time complexity off a plus B instead of a time Speak. Those are big savings. We need to start actually writing this code to see if we can solve this problem. And because this video is getting long, we're going to do this in the next video. But I want to show you right here What? We've just done. And that is, although we haven't given a clear solution, we've been talking about how we solve the problem. The interviewer sees how we think sees what steps we take and sees that we're making smart , critical decisions to go from understanding the problem, to solving the problem in a naive way, understanding why this might not be the best way and then start to think about possible solutions. And the beauty of this approach is that no matter whether we get this part correct, maybe our assumptions are wrong and we can't do this. We're showing the interviewer that we're thinking through a problem, and we're making small, logical steps towards a solution. And this is a lot better than just coating right away. Trying a solution and see if you get a right or wrong an interview is gonna have a good understanding of your abilities and your thought process this way. And these are the type of people that they want to hire. So in the next video, let's finish out this problem. Let's coated and see if we can make this solution mawr efficient by converting it to a way plus B I'll see in the next one. But by 42. 06 Problem Solving 2: Welcome back. Let's get back to where we were. We want to start actually writing our coat, keeping in mind that the more you prepare and understand what you need to code, the better the white board will go. So never start a whiteboard interview not being sure of how things are going to work up. So we've talked it out. We have a plan in mind. Let's start to code this. Let's do the first loop over here. That is, We want to look through the first array and let's remove this. Go just so it's a little bit cleaner. We want to look through the first ray, create an object where properties are going to match the items in the erect. I'm going to create an object. Let's just call this map and this map we've created it. But we want a loop through our array song. One say, Let I equals zero and we've done this before. I is Les said array dot or a ray one dot lane. We're gonna increment I now with in here we're first going to say if there is no property, so we want to check whether map dot a exists map dot be exists. Map dot c exists map dot Exe exists. So if that doesn't exist in javascript, we can just use this Intacs weaken Say, if no map. Hi. So again, if map I which the first time Iran is going to be a so if map dot a is the opposite. So this exclamation mark in Java scripts means the opposite. If map a exists, it's going to return true. If it doesn't exist, it's going to say false. So this is this might be a little bit confusing, but we want to say if this doesn't exist in that case, we want to do something now the way. If statements work in javascript, it's needs to be true in order to execute whatever is in here. So we add the exclamation mark here to turn false into true. I know that can be a little bit confusing. You can read up on it, but essentially what we're doing is we're just checking for the property if it exists or not, if it doesn't exist, and then we're going to add it. So I'm gonna say const item equals array one I so that is hey and this item is going to have map hide him equal. Too true. What do we just do here? What we said if map A doesn't exist in that case, let's make a ray one I, which is a equal to item so map item is going to equal to chew. All we're saying is map A in this case equal to truth. So by the end of this, we're going tohave an object that is going to have property a true and we're gonna keep looping through it until we have an object called map that has all these items. Map a map, be map, see map X equal. Stay true. All right. It looks like we're able to achieve this. And we can just console dialogue here just to check what we have. I'm going to say, Consul, dialogue, map. If I run this function, let's do contains a common item to array one array to and let's minimize the syllabus so we can see. And if I around this Oh, I'm gonna make sure I spell that right array to Let's run. We see that we have a true be true See Tru X True, Awesome! So now we have that working. Let's go through the second step. And actually, I just notice here that this the way it is right now is checking I, which is 0123 But instead we want to check ABC X. So instead of I hear it should be array one bracket notation I So that is a B C X as the property of the map. Lots of brackets here, but I hope that makes sense. So if I run this, we should still get the same answer. Perfect. Now let's look at the second part here. Want toe loop through the second array and check if the item in the second array exists on the created object. This should be fairly simple. All we need to do and let's remove the consul dialogue map here. All we need to do is to loop over the second Array. Let J equals zero. J should be less than her a two dot length, and then we're gonna increment J. And so we're going to say is if map what do we want to check what we want to check if it contains the first item in the secondary that is Z as part of its properties. Remember, our map object contains these properties. So all we're going to say is we're going to check the array to and we're gonna change Check the J index. So the first index zero over a two is going to be see then why then a And if that's true, if it does contain those things because remember, when we evaluate this is going to return True if it exists If not, we're just gonna get on defined. We're going to say return true otherwise of the very end. We can just say return False go. Let's see if this actually works Going to just click run and I get true Okay, so I see that a in a match What if I change this to something that doesn't exist like our If I click run, I get false. What if I change this to see I get true If I get this two x, I get true. If I change this to w, I get force awesome. So we've just coated something new a new function that if we look at, makes things possibly better, right, because we have 24 loops, one after another, which is a way plus B vs. Before where we had nested for loops, which has o a time speak. At this point, we can tell the inch fear. If the arrays are substantially large and we can get really large erase than this solution when it comes to time, complexity is better. How cool is that? Now? Let's go through the next steps because we're not actually done yet. Let's make this a little bit bigger. Number 11 is Think about air checks and how you can break this code never makes obss options about the input. Assume people are trying to break your code and that Darth Vader is using your function. How will you safeguard it? So always check for false inputs that you don't want. But essentially, I now look at this code and save How can I break this? Well, let's think this truth If I go through this code and let's say what if I have to Ace year and I run, does this still work? Okay. What if I have a and a here? What happens? All right, I get true. That's good. Um, but what if I have a number here instead of a string. We just assumed that the arrays gonna contain strengths. I get false. Okay. What if I do one here? Get true. Okay, so that works. What if I, um, doing empty array here? Okay, I get false. What if I do another array here? Okay, I get true. What if I do know here and javascript, which is a little tricky. Okay, I get false. What if I do know I get true? Okay, that works. If we go back to what we have before, we want to now tell the interviewer how we might be able to break this coat. For example. What if we don't receive a second array? What if this function is called with just wondering what happens? Oh, we get an air. We want to start thinking about how ares might arise. We want to make these functions as error free as possible and during an interview usually won't have time to do all the checks that you want, But you might want to tell the interviewer possible solutions or possible ways to go around this. Such as Can we assume always two parameters in the function is what happens if in the second parameter I pass zero Okay, I still get false. What if I pass? No. Oh, I get an air that says I can't read length of no. So you want to start thinking about and maybe discussing with the interviewer how you may break this function and how you may improve it, such as doing checks such as? If statements to make sure that what the inputs you are getting are what you are expecting Now. This is when testing comes in and testing your coat comes in during most interview. That's usually beyond the scope of the interview, and it's You have limited time so you can do this, but it's good to tell the interviewer what you would do. This is one of those things that it's simple enough that you can just tell the interviewer . This is why you would do versus coating it, and they will essentially give you full marks for it. Let's look at the next step. Don't use bad, confusing names like I and J O write code that reads Well, now when I look at this function, it's okay Now I say don't use variables like I and J. And although I'm using I and J exactly here, this is being used for four loops and four loops. Using I hear is okay, because it is a bit of a standard, especially in JavaScript. And these air just simply indexes. But perhaps if these parameters had meanings such as, maybe this was the user array and this was the Items array. Naming these as more useful, more meaningful variables or parameters might be better. Maybe this map very bold can be called tally or something more meaningful specific for the coat again. This is one of those things that you can talk to the interviewer about and let them know that you're thinking about the sinks, and that's very, very important again. As long as you're thinking about that name and you're telling the interviewer that you're considering these things, you're getting full marks for it. Let's keep going. Test your coat checks for no Paramus zero undefined, no massive. Erase a cinco so on and so forth. And we kind of covered this in the previous step. But you want to just check with the interviewer that we're making some assumptions here, but let them know that you're thinking about that You're thinking about the fact that this function might not always be run with two race. How can we test this function? And how would you test this function To make sure that it gives the expected result that we always return true or false. And this is where you might say that you're gonna test your code and run some unit tests. Finally, even though I say finally here there is another point, but finally talked to the interviewer where you would improve the coat. Does it work? Are there different approaches? Is it readable? What would you do or what would you Google to improve? How can performance be improved? Well, looking at this code, I can start telling the interviewer that Okay, the downside to this solution is that, well, Onley numbers and strings and billions can be used correctly because we're using an object , especially in JavaScript and adding properties. ABC and acts to this object now object properties, especially with the way we're using a JavaScript object right now, might not work if we're using non literal values, maybe not strengths, maybe a javascript expression. And you might also argue that this code could be a little bit more readable. For example, although this code is better in terms of time, complexity. When it comes to JavaScript, there's actually a more readable, cleaner way of doing this. Let me show you. This is something that is language specific. That means depending on how much you know about the language that you're working with, you might be able to use methods to simplify this process. So you can tell the interviewer I would Google specific methods on, let's say, a race to see if I can just clean up this code and make it readable. For example, I can do this exact same function and we'll call it contains common item three that takes in a ray one Ray too. And in one line I can just return Ray one dot some, which is a new feature. I think he has sex with JavaScript, and I can say item using arrow functions, which come with the S six and I can say loop through array to dot includes and check if it includes the item. Oops, not that item. Now what do we just do here? Well, we're using some built in JavaScript methods to do essentially what we've done above, which is check the first array. It array through each item in the ray and if some of them include the items in our A to just return to her false. If we actually check this to with our array and I run this and let's comment out the 1st 1 if I hit play here, I got to make sure that this is includes not include. I get false because our array, it doesn't have any matches. If it does have a in a match, I get true. Look at that. I just created a nice little function using JavaScript here. How cool is that? This is what we talk about when we say there's different solutions to a problem. We now have a way to measure different solutions to a problem. We can say that there's actually another solution using some of the built in methods that comes with JavaScript, that is, some would say, more readable, more concise. If you're working on a team that really knows their JavaScript, this is a lot easier to read than this, right? So maybe readability is more important. You might say that this is a better solution. Another thing you may have noticed is that we've talked about time complexity here, and we haven't really talked about space complexity, and this goes into a final point. If your interviewer is happy with your solution, the interview are usually ends here. It is also common, though, that the interviewer asks you extending questions such as How would you handle problem if the whole input is to lush to fit into memory? Well, if we talk about space complexity here, we can see that in the first solution that we had let me comment this out. We have space complexity off, Oh, one, because we're not creating any new variables were just using the inputs a raise. Technically, additional space complexity for our function is a one. It's constant. But if we scrolled on to this one, well, we're creating a new object here, and we're adding the first array into an object which takes up memory. So this solution actually has space complexity of Oh, a, which is the first ray the space complexity. So if an interviewer says if there's limited mayor memory or memories expensive, you can just tell him or her. Well, this solution, although faster in terms of time complexity, is more heavy in terms off space complexity. Now this point here that we forgot to mention, is something that again is really good to mentioned your your interview module. Arise your code from the very beginning. Break up your code into beautiful small pieces and add just comments if you need to. What does that mean? Well, we have the solution over here that we have worked on, and we've commented it out. We've modular eyes saying that this first block a code is going to do something than this block of code is going to do something else. But as code gets more and more complex, it becomes increased signally important to write in a modular way that is small bits and pieces that read like English. You see long, really hard to read. Code costs, companies a lot of money because it's not just you working on a code base. It's most likely tens hundreds, if not thousands, off developers and engineers. So companies want to hire somebody that is able to write clean code that is readable. That is easy for anyone to pick up and code along with, for example, here. What we might want to do is actually separate. Piece out into different functions may be creating a function in here that perhaps says map array to object that receives in the first array item. And then maybe here a another function to the outside world that says Compare array to object. Now you don't really have to do this during an interview, but it's good to mention it and talk about the idea off module arising Your coat. If a function is doing too many things, that's not ideal. When we say modular, we wanna build small piece of the code that do one thing and one thing really well. Ideally, a function takes an input and returns an output, and inside of that block does just one thing. If it has to do any extra actions, will perhaps you have another function that lives on the outside world, and this function also does one thing really well. And this creates really testable clean code that is modular again, something that is really good to mention and talk about in your interview who, All right, I know this is a lot and it's a lot to think about, because now you start thinking, Am I gonna have to worry about each code that I write and analyze it this deeply? No. In your day to day life, you're not going to do that. But I wanted to demonstrate to you that this is the kind of thought process that really good developers have and what companies are interviewing for. If you are able to think clearly through these steps, like Avalon outline for you and you're able to solve problems this way, you see how much more impressive it is. Then, if I just wrote down this solution without any explanation, even if you don't get to this part and time runs out during your interview, you've demonstrated to your interviewer that you're able to think clearly. You have the fundamentals to think like an engineer, and these air great qualities that companies love to hire for and skills that are very rare . I hope you had fun with this exercise. You might have to come back to these videos later on, but for now I'll see in the next one. But by 43. 07 Google revisited: Hello. I know. I know. I know. The last two videos were kind of long, very technical. If you weren't familiar with JavaScript, maybe they were a little bit tougher. But the point was the process off solving a problem in a coating interview. And over here, I've created a little playground for you. Do you remember the Google interview video that I made you watch? Well, I've implemented the solution that the interviewee created in here we have the naive solution, which is the nested for loops and then a better solution that uses just 14 loop at the expense of creating something in javascript called New Set. I left this here for you, for you to play around with and if you want coated in your own language. But I want to challenge you to see if he can implement this on your own, just like the person in the Google interview did in your own language, the naive approach, and then the better approach and try to follow these steps as you code along. Even though you already know the answer. Even though you have watched the interview video by practicing the steps and how you go from the naive to the better solution. By following these steps, you're going to improve that interviewing muscle. All right, I'll see in the next video. Bye bye. 44. 08 Review: all right, another section done. And in this section we talked about the technical interviews and how to solve problems specifically, one big misconception is that you're either a good problem solver or you aren't. But as with anything, it's a muscle that you can train that you can practice. So with enough practice and knowing the tips and tricks that we covered in this section, you can solve problems a lot better. That shows the interviewer you know what you're talking about. The key in the section was this. Teach eat and the step by step walk through of a problem. We looked at how a Google interview might look like, and then we mimicked some of the techniques used there to solve our own problems. The idea was to show how you work, think out loud and try to comment the steps as you go along to solve a problem. Communicating throughout the process as much as possible and not worrying about finishing a problem fast is the key to interviewing and solving problems in an interview. Now we should have also got in the idea that we don't want to memorize problems because if you do 100 problems and try to memorize them. But it won't really help you long term. But you're also taking a gamble, right? You're hoping that interviewer asks you a question that you've seen before. Instead, we want to take control of our destiny in practice and be ready for anything by building the fundamentals we talked about. How, by using the Big O and the lessons we learned here, we can now move on to that of structures and algorithms and use them during our code interviews. We also talked about some of the skills that interviewers are looking for and demonstrated how it wasn't necessarily just coding skills. There's a lot of other aspects that interviewers are looking for, and we cover these items and how to show them during our practice. Injury question. Finally, we're now ready to dive into the exciting part of data structures and algorithms. We have a nice foundation, and we know that all we need is to learn these data structures and algorithms to really be interview ready. And we're also going to be using the cheat sheet that I gave you in this section throughout the rest of the course and at the foundation of this cheat sheet is the idea of readability , of code space, complexity of code and time, complexity of coat. And although we don't cover everything in the cheat sheet, we have a few items here of the end. You'll see that as we go through the data structure and algorithm questions, certain type of patterns will emerge that although questions may be different in an interview, usually the way to optimize things or tricks to make your answers better can be narrowed down to specific steps. So don't get overwhelmed. There's an easy, clear checklist and heuristics that we're gonna go over later on. But by this point, I think we're ready to move on to data structures and algorithms. How do we write good coat? Create good programs, create value for the companies that were interviewing for See you in the next section. My wife 45. 01 Introduction: What is a data structure? A data structure is a collection of values. Algorithms are the steps or processes we put into place to manipulate thes collection of values. It's what allows us to write programs. Ah, person who knows how data structures and algorithms work and how to use them can write programs, great programs. The beauty is that these are timeless, no matter what programming language you use, whether you prefer one library over the other, whether you write code in angular or react in the front end development world or you are a game developer underneath it all its all data structures and algorithms. If you understand these, then you can really easily adapt and tackle all sorts of technical problems. It is why companies like Facebook, Amazon, Netflix, Google ask questions specific to data structures and algorithms. Because although it may be important to know the latest and greatest JavaScript syntax or maybe the latest and greatest library, those things change if you know the fundamental. So then they can throw you any problem, any situation, and you're able to make the right decision. This knowledge is extremely valuable. The longer you are in the field the more and more you realize that you need these fundamental principles of data structures and algorithms in order to be a great developer or engineer. So let's get started with that. Over the next few sections. We have a long way to go to get familiar with data structures and algorithms. So I came right. Great programs. Let's get started. 46. 02 What is a Data Structure: welcome back. What is a data structure? A data structure is a collection off values. The values can have relationships among them, and they can have functions apply to them. Each one is different in what it can do and what it is best used for. Most important thing to take away is that each data structure is good and is specialized for its own thing. All right, Andre, you just said a bunch of wars and I don't really understand. Well, let's show you a couple of images to simplify this. You see, you can think of data structures as any sort off compartment or container. A data structure is simply a file cabinet off different types. You have a back back, a place where you put maybe your school books. You have drawers where you put your clothes, a fridge where you put your food. Ah, folder for your files and a packing box. Maybe for your toys. Each one of these containers are useful for its own thing. For example, I'm not gonna put my food in a drawer over here because that yogurt is going to go bad here . Likewise, I'm not gonna put all my papers and files in my backpack or perhaps a toy box, because it's just going to get crumpled up. Each one of these containers are specific for its own thing, and that's what data structure really is. It's a way for us to organize data so that we can go into the back back and retrieve that data really easily. We can go into the fridge and grab that Popsicle or ice cream really fast. We can put things and data structures, and we can take things from that of structures. And that's all it really is. And there are a Thanh of data structures, just like in our real life, how we have all these containers hold these places to put things in in programming. We have a ton of them. If we go to Wikipedia, for example. Well, if we scroll through here, we see a Thanh of data structures, and this is going to look overwhelming. But don't worry. Most of these well, I've never encountered myself, and they're very, very specific. You probably only have about five or six data structures that are really, really important that we're going to go over, and you may have even heard off Bitcoin. And how would he uses Blockchain technology? This magical work we'll block Shane at the end of the day is simply a data structure away to hold information. So in our programming world data structures, we can store things like numbers, strings, bullion types, just like we saw when we coated in JavaScript with arrays and objects. A raisin objects in JavaScript are each a form of a data structure that allows us to store information you see as humans. This is what we do on Earth, right? We take the chaos and the disorder and make order out of it. At least we try to. We organize our farms to produce food. We package the food and we deliver them to the grocery stores and organize them in the grocery store so that humans can grab those and can then purchase these groceries and give money to put in a compartment and a bank. That's what programs there were modeling riel life scenarios and the more advanced a developer you become, the more Tom you'll start thinking and spending time talking about data structures. This is why interviewers love to talk about data structures now as I always like to mention , they're always trade offs. Every programming question has a tradeoff. Remember our three pillars of readability, memory and speed when we talked about what code is best? Well, we have the same thing with data structures. One is better than the other in some aspects and the other better than the other. That's why they exist, each one for its own specific case. And there are two parts to understanding data structures. One is how to actually build one. How can we build with code some of these data structures and two is how to use them how to use these data structures. We're going to do both of these in this course, but the second point is the most important, right, because data structures are usually just tools, and most of the time they're already pre built For us, the most important part is how to use them, one to use one over the other. And we kind of saw a little bit of that in the previous section when we talked about how to solve problems where we used on object versus an array to make our code more efficient. The goal in this course is to understand data structures so that you can pick the right data structure for your problem. Based on different scenarios, data needs to be stored in a specific format. We have a handful of data structures that cover our need to store data in different formats , so let's get a little bit deeper into this topic. 47. 03 Down the rabbit hole: In order to truly understand the value of data structures, we have to go deep down into the way computer works of the fundamental level. In order for a computer to run code, he needs to keep track of things like variables like numbers, strings, array. These variables are stored in what we call random access memory or ramp for short. That's how programs run. We remember this from space complexity video right on top that we also have storage where we store things like our video files, music files, documents and this storage can be a disk drive, a flash drive or a solid state drive that own storage is permanent or what we call persistent. So when you turn off your laptop or computer, it's still going to be there. When you turn it back on in RAM, you lose the memory when the computer turns off. So why wouldn't we just always use storage so we don't lose any data? Well, the problem is that persistent storage is slope because you see a computer is run by its CPU. You can think of the CPI was the little worker that does all the calculations that we need it does the actual work inside our computer, and this CPU needs access to the ram and the storage, but it can access the ram and the information in the ramp. Ah, lot faster. But let me give you an example as if we're using Google when we run Google Chrome, for example, a browser that Google Chrome browser has a piece of coat. Now here I've simplified it and we just have a variable A equals one. We're just assigning this variable one, but we can imagine how we have hundreds thousands of lines of code of Google chrome. Now, in order for our computer to run Google Chrome, we run the CPU for it to do so. Now, when a variable is declared in, let's say, a script to Ron Google Chrome. It's going to hold that in memory in our random access memory. But once we turn off or close Google Chrome, we want to be able to we open it right Well, that's what we do when we save an application on our computer, we save it to storage, so that next time we open up a Google chrome, the CPU is going to grab the program from the storage so that it can use it again. And for Google Chrome to run fast and run smaller scripts, it's going to keep that information and random access memory. We're going to see this on our computers as well. If I go to about this Mac my computer, we can see here that we have the processor, which is my CPU. We have my memory, which is my ramp. And if I go to storage, this is my flash storage, my persistent storage on my computer. So you can think of RAM in the computer as a massive storage area, kind of like a data structure rate. Well, this massive storage area has shelves that are number. We call these address or addresses, and it's a really, really big shelf that holds a lot of information, and it allows us to run programs on our computer. No, each of these shelves holds what we call eight bits or numbers. If you see here 12345678 Each one of these numbers is a bit, and a bid is a tiny electrical switch that can be turned on or off. But instead of calling it on or off. We call it one or zero, and eight bits is called a bite. Each shelf has one bite of storage, and the CPU is connected to something called a memory controller. And a memory controller does the actual reading off this memory as well as writing this memory. Because sometimes this shelf might be blank and doesn't have anything. Now. This direct connection to the CPU is important because the CPU asks the ram, Hey, what's in shelf number zero? And the memory controller actually has connections individually to all of these shelves again, that's really important because it means that we can access the zero shelf and immediately access the seven shelf or 10,781 shelf without having to climb down or stepped out. That's what the name random access memory means. We can access memory really fast because we have these connections, any shelf we want, we just need to know which shelf we're looking for. We can access the bits at any random address in memory right away, even though this memory controller can jump between far apart memory addresses really fast program stand to access memory that is nearby. The closer the information is to the CPU, and the less that has to travel, the faster a program can run. So computers are actually tuned to get extra speed boosts when reading memory dresses that are close to each other. For a computer to access zero and one is a lot faster than a computer for it to access zero and 1000 because of these air a lot closer together. And to further optimize this, our computers also have. We call a CPU cash where the CPU has a tiny, tiny memory where it stores a copy of stuff that is really, really recent. And this is called a cash, a common one that you might here is something called El Are you cash? So again, if we use Google Chrome as an example, we turn on Google chrome with Let's say we have the application downloaded on our storage. The CPU loads it up. And because we've visited hacker news dot com is going to load up the information for that hacker news and put it into memory, or maybe even cash if it can hold it. So why is this important for data structures. Well, data structures are remember ways for us to store information. For example, if we want to store variable A equals one well, in our modern computers, usually we represent integers. That is the number one in 32 bits that is this block size of ramp. And, by the way, this is now convey 64 bits with more and more recent upgrades. But this way we can store the number one within this blocks off 32 bits. Why 32 bits? Because eight bits, which is one bite times 1234 So eight times four is 32 bits. We can store 32 bits of information and this bit of one you can see here. 00000000 and one is stored now in memory. 0123 or the address Sierra 123 If we have another variable B equals to seven. We with store it in the next block over here in our ramp and doing this, you can now think about how systems that are eight bit can hold 255 bits of information, things that are 16 bit well they can hold a lot more information, and now we have systems that are 32 bits. You can see here that we can hold a Thanh of information and then if we have 64 bits, that is instead of having four little shells over here, we have eight shells, shelves, times, eight bits. Well, that's a lot of information that we can store. And the bigger this is, the more diverse that information is. If we had an eight bit system, well, the number 256 we can't really store that. That's really hard to do. And I can demonstrate this to you with JavaScript. You see, there's something called integer overflow Now JavaScript technically doesn't have integers . It only has what we call a 64 bit floats. But the idea is that a computer can Onley store a certain number of information. So using this syntax in javascript, we have math dot power, which is a function that returns the base to the exponents power that is the first parameter is the base to the power off the second parameter, so we can create really large numbers like math dot power. So five to the power of 100. If I run this, we see the number over here. If I increase this to, let's say six again. Another large number. Now what if I keep going and change this to six to the power of 1000? We get infinity. What? What is that? Well, as the number becomes too large to store in our ram, then we need to represent this number that we cannot store into something that is tangible in Java scripts case it is infinity. We can Onley store this much information. And no matter how big I make this, any number above a certain threshold is going to just say infinity. How cool is that? Now let's go back to the slides. I showed you all of this because other data types other than numbers work the same way. Each data type has a number of bits associated with it, and that needs to get stored in the system. And the system allocates that storage. And then the CPU reads from that storage. Now I'll leave a link for you after this video so that you can get more information if you want. We don't want to get too deep in this. But a data structure is this. The data structure is an arrangement of data. You can define the way you interact with this data and how it is arranged in ramp. So some data structures in RAM are organized right next to each other. Some are organized apart from each other, and they have different pros and cons on access and right. Our goal is to minimize the operation that we need to do for the CPU to get the information for the CPU to write information. And that is why data structures air so powerful. We're thinking about the low level, and I don't know why you but this to me when I learned about this, was really, really exciting. Because we have a weight now to think how data structures actually affect the process of our computers and how we can use what we know about computers now to write greatcoat. I'll see in the next video. Bye bye 48. 04 Data Structures in Different Languages: Welcome back. There are quite a few data structures that you may be asked in an injury, and we saw how many of them there are on that Wikipedia page. But luckily for you, the list isn't actually that intimidating. All you need to learn are these ones over here. These are used, I would say 90% of the time, and this is what we're gonna talk about in our course now. There may be specific once within these groups, and each one of them has trade offs. But as long as you learn these and you learn when and why you should use them, then you're gonna be miles ahead of most people. It's gonna be a lot of fun. Now, before we get going, I want to note one last thing. You see, each language has their own data types or built in data types. JavaScript, for example, has numbers. Strings has bowl Ian's, which are true false, and then some strange ones, like on defined. And each language has data structures to organize these data types. So, for example, in javascript we have a raise and objects that we use, and they are data types. It allows us to structure and organize information such as our primitive data types, or even hold more complex ones, like having an array that contains multiple objects. And we're gonna talk about this in more detail. But I want to show you that we do have different languages that have different access to some data structures. You can see over here some of the other languages that we can use in this course and whether they have them available. We'll see that Java has a raise, has linked lists, stacks. We have priority queues and many other types. Now, does that mean that if we're using JavaScript, we can Onley use a raise and objects? Well, no, not really. Although these languages come with data structures built in, we can also built our own. And most languages have enough data structures and data types for us to build and create our own data structures. So if javascript doesn't have stacks, well, we can build one now to finish this section and finally dive into our first data structure . I wanted to just remind you that we have a little map over here of what we need to know for the coding interview. Now, in this map, I have a little present emoji next to each one of the data structures that we're going to talk about. As you can see, there aren't that many of them, and many of them are quite related or our Children off the other. But use this as a reference for you to just draw a map of how things are connected and what the data structures are that we're going to talk about. But let's get our hands dirty With our first data structure, I'll see in the next one. No, by 49. 05 Data Structure Operations: what, er, the various operations that could be performed on different data structures. Because, as we learned in our previous lectures, that a structures air simply waste to organize our data on our computers and the data structures will see throughout this course are simply variations off. How we store this data on our computers. This information and each data structure has their trade offs. Some are good at CERN operations. Others are good at other operations. One type of action that we're gonna performed with data structures well is insertion. Add a new debt item in a given collection off items such as us adding the apple item and memory here, another one. All deletion. We want toe sometimes delete data such as remove mango from our list. Another type of action might be traverse ALS, and we're going to see this a lot. Traverse ALS simply means access each data item exactly once so that it can be processed. Another useful one is searching. We want to find out the location off the data item if it exists in a given collection. And then we also have things like sorting that is having data that is sort of kind of like it is on the left hand side, over here versus the right hand side, where there's not much sorting going on, at least from what we can see. And obviously the main one and probably the most important is access. How do we access this data that we have on our computer now? Each data structure that we're going to go through in this course will have different pros and cons for each one of these. And if we take a look at our big Oh Tichy, well, we're very familiar with this diagram over here or this graph. And if we scroll down, we have all these data structures that it lists and don't get too overwhelmed. We're going to go over most of these data structures, and you see that half of them are mainly trees and variation of trees. And within here we see that each one of them has access, search, insertion, deletion, average and worst case. And because we understand big Oh, we can see that. All right, we're seeing which ones good for what? And what is bad for what. And as we go through our data structures and we're gonna go over these pros and cons so that you build the foundation to be able to decide which data structure should I use on your next problem. We're gonna get started with our very first to data structure in the next lesson. I'll see you on that one, but by 50. 06 Arrays: Woo Hoo! It's finally time to learn our very first data structure, and one that most likely you're very familiar with a race. A raise, which are sometimes called list, organizes items sequentially. That means one after another in memory, kind of like we have here. We have some sort of data to index zero, Let's say juice and then right after a two index one, we have something else, maybe Apple. Maybe this is a grocery list in our computers. Memory will be one after another. Because, remember, our ram is a lot bigger than just seven slots and their razor, probably the simplest and most widely used data structures. And luckily for us, we're starting with this because the rays have the least amount of rules, and because they're stored in contiguous memory that is in order. They also have the smallest foot brain of any data structure. So if all you need is to store some data and iterating over it, that is, go one by one step by step. A raise are the best choice, especially if you know the indices that is here on the left, off the items your story. And just as a quick glance and we'll go over this in more detail in later videos. But look up or access with a race are constant. Time of one. It's super super fast. Other actions or methods that we're gonna go over so just push are also fast, but then inserts and deletes r o of n or linear time. But in order to demonstrate a race, let's actually use code to show you an example. We have our little playground over here and again. You can use whichever language you prefer. I'm just going to demonstrate this In JavaScript. We can create a simple a rain. Let's call it strings and this array again. Using the square bracket notation will have a then be then see and de and we just We've just created an array in JavaScript. Now, looking at this and based on what we've learned so far, we can make a couple of assumptions, for example, to store the letter a Let her be letter C letter D. That's 12344 items. If we were on a 32 bit system, that is, we have 1234 shelves to store the letter A and zeros and ones. Well, if that's the case, we just multiply four times for so four items and each. I am taking up four shelves in our memory. That means we're using up 24 16 bites of storage. If we remember in our little example here that with a 32 bit system, we have 1234 shelves to store this this number again. This is a bit of a simplified version of looking at it, but I hope you see what we're doing here were simply storing a B c D in sequential order. In our ramp are random access memory. So the computer now knows where to find these items. Therefore, when I do strings to I'm telling the computer, Hey, go to the array. Cold strengths. We should know where that is, because underneath the hood you stored it for me and grab the third item. Remember, the indexes are 012 So I grabbed the third item from where the array is stored on your memory. And if I run this, I'll get C. The computer is going to grab that information for me because here it's stored it for me and here, it's grabbing it for me. All right, so let's do a few more operations with a race and see what the pros and cons are. Well, in JavaScript, we have a few methods that we can use with the race. One is push, which simply allows us to add something at the end of the array, so strings dot push e. And if we just remove this and let's have a console dot log of strings. If I run this, I get a B C D e this string push operation, because it just adds it at the end. Off the array is an O one operation. All we're doing is adding whatever item we want at the end, we're not looping through anything, so hopefully that makes sense. Why, that would be, 01 that's very convenient. What's another method that we get? We can also use Pop and pop is the opposite of push Pop will simply mean to remove the last item from the strengths from the wreck. If I click run here, you see that the was moved. If I do string stock pop again and hit run, we see that this time around we've added E. Then we removed E and then finally did to be left with a B and C. What do you think the time complexity of this operation is? Once again, it's o of one because we're not looping through anything. We're just removing the last side him. Remember, our computer knows where last item is stored. We're simply saying, Go to index of, Let's say, seventh the very last item and remove the bread. But let's do something interesting here now. What if we want odd an item at the beginning of the rain? Maybe in here we want Oh, add the letter X Well, we have something called on shift in JavaScript and depending on your language, you'll have perhaps something different. But the idea here is we simply do strings dot on shift. And by the way you see here, how rappel that I t actually gives you the parameters that you can enter In this case, it just says what items, which is a strength should I enter. In our case, I'll say I want to on Shift X, which is saying, Just add acts at the beginning of the array. If I click run here we see that X has been added at the beginning of our very what do you think the time complexity of this operation is? And by the way, as we go through data structures and because we know big O notation, isn't it pretty cool that we're able to think about code beyond just Oh, I'm just doing this. We can think deeply about what's happening underneath the hood. Why might this operation be longer than this operation? I find that fascinating. And when I first understood this point, it really made me a better engineer. And I hope you're starting to get this Ah ha! Moment for you as well. Especially if this is your first time with data structures now on shift. What are we doing here? Well, remember, strings are essentially stored. If I move this to a new line, the computer knows that this is a zero. This is at index of one. This is an index of two, and this is at index of three. When I add X with the on shift, I'm all of a sudden adding X into our array. But we now have to shift these numbers because the indexes are still like this, But this time around, we have to say, OK, zero is now, but X A is now one B is now, too. And C is that Index three and D is that index for And just by me doing this, you might have seen something. We just iterated loop through everything and reassigned the indexes. And I did 12345 moves or five operations to realign the indexes. And this should give you a hint. That is, this operation is oh off. And depending on the size of the array, that's how long it's gonna take to do that. Operation were looping so right away. We know that with the rays, maybe it's not the best data structure for adding items at the beginning of the array. What if we wanted to add something in the middle of the array so we can use the method spicier? Let me scroll down a bit and with spice I can say strings dot spice And again I got a hint of what I can do. The first is the start number. So I want to start at index off to remember, we have this array here X a b c. So we're starting at B and the second parameter is the delete count. What do we wanna delete? Or how many things from this index do we want to delete? In our case, we don't want to delete anything which want to add, so I'll say zero and then the items that we want to add. So let's just add a string that says Alien. And let's remove this X from our original array. That's better. Let's hit, run! And there we go. We have X because we've unsifted a than alien B C. So spice told us go to index of 2012 where be was initially and add alien instead of B and just shift things over. So what we've done here is if we go back to our example, we have the X in our array, and we shifted these indexes of X and they are still the same. But we shifted be over and said in here, I want you to add alien, and we now had to go over everything and say to for a Lee and we want 34 B four for C and five for deep So what's our big Oh, here. We don't need this coming. Well, our big Oh, in this case, we did half of the operations because we changed half the array. We looked through half t ray, so it would be, oh of and divided by two. But remember our rules when it comes to big Oh, we remove constants and simplify to just 11. Worst case, it's going to be over an operation. All right, I'm going to leave this for you second in play around and try different methods on a race. But I hope you understand how they work and how there's some good things that we can do, such as accessing the array that is ove one because it's, well, extremely fast. We know exactly where it is in memory. We can push and pop, but when it comes to on shifting or splicing or even deleting because with splice, we can even do deletes. That's going to be event. And if we go back to our chart, we should now have a better understanding of why it raised lookups are extremely fast. We know where they are. We know why push adding at the end of the array is extremely fast, but why insertin