1 00:00:00,000 --> 00:00:02,350 2 00:00:02,350 --> 00:00:03,430 DAVID MALAN: All right. 3 00:00:03,430 --> 00:00:04,870 Well, hello, world! 4 00:00:04,870 --> 00:00:07,810 This is CS50's now annual workshop on how 5 00:00:07,810 --> 00:00:09,940 to prepare for technical interviews. 6 00:00:09,940 --> 00:00:13,660 This is an opportunity that we hold traditionally on campus and nowadays, 7 00:00:13,660 --> 00:00:17,710 also on Zoom, for students here at Harvard, at Yale University, as well 8 00:00:17,710 --> 00:00:22,300 as now anyone online who are thinking about pursuing summertime opportunities 9 00:00:22,300 --> 00:00:25,990 in the technology world or full-time opportunities after school 10 00:00:25,990 --> 00:00:28,570 or perhaps are pivoting later in life and are exploring 11 00:00:28,570 --> 00:00:31,240 computer science and programming and software engineering 12 00:00:31,240 --> 00:00:34,010 and want to ultimately move into that world. 13 00:00:34,010 --> 00:00:37,300 This workshop is specifically on how to prepare for the kinds of interviews 14 00:00:37,300 --> 00:00:39,440 that you might encounter in industry. 15 00:00:39,440 --> 00:00:42,370 It's one thing to take classes like CS50 or anything 16 00:00:42,370 --> 00:00:46,438 else that sort of prepare you indirectly for a foundation in software 17 00:00:46,438 --> 00:00:47,480 engineering and the like. 18 00:00:47,480 --> 00:00:49,522 But it's another thing to actually ready yourself 19 00:00:49,522 --> 00:00:52,390 for the concrete opportunities that might be of interest to you 20 00:00:52,390 --> 00:00:55,060 at a tech company or really any other company at which you might 21 00:00:55,060 --> 00:00:56,860 be applying your technical skills. 22 00:00:56,860 --> 00:01:00,070 So thanks to CS50's own Tommy MacWilliam, 23 00:01:00,070 --> 00:01:02,550 who was one of CS50's former head teaching fellows today, 24 00:01:02,550 --> 00:01:04,300 we should have an amazing workshop for you 25 00:01:04,300 --> 00:01:08,260 that should give you the mindset of how to go about preparing for interviews, 26 00:01:08,260 --> 00:01:11,350 how to go about preparing your resume, and really, ultimately, how 27 00:01:11,350 --> 00:01:14,770 about applying what you might learn fairly theoretically in school 28 00:01:14,770 --> 00:01:18,640 to the actual practical world of interviewing and ultimately working, 29 00:01:18,640 --> 00:01:19,220 as well. 30 00:01:19,220 --> 00:01:20,928 And wonderfully we're joined here by some 31 00:01:20,928 --> 00:01:24,400 of our other former and current head teaching fellows, Maria and Connor. 32 00:01:24,400 --> 00:01:28,870 So allow me now to introduce our friend and former colleague, Tommy MacWilliam, 33 00:01:28,870 --> 00:01:31,600 who most recently worked at companies like Quora.com 34 00:01:31,600 --> 00:01:34,690 and most recently his own startup, Serenade.AI. 35 00:01:34,690 --> 00:01:37,870 Tommy is hands-down one of the smartest people and best engineers 36 00:01:37,870 --> 00:01:38,980 I've ever met. 37 00:01:38,980 --> 00:01:42,280 Indeed, in preparing for today's interviews, 38 00:01:42,280 --> 00:01:45,310 I got to thinking that I'm not sure if Tommy interviewed me, 39 00:01:45,310 --> 00:01:47,000 I would get the job. 40 00:01:47,000 --> 00:01:50,560 And so it's always quite interesting to hear about the advice he has, 41 00:01:50,560 --> 00:01:53,140 the types of experiences he's had, because not only was 42 00:01:53,140 --> 00:01:55,420 he a former student and a former teaching fellow, 43 00:01:55,420 --> 00:01:59,020 and now go out there in the real world, hiring and building software, 44 00:01:59,020 --> 00:02:00,470 he's really seen it all. 45 00:02:00,470 --> 00:02:02,740 And so I think we're fortunate to have, not only him, 46 00:02:02,740 --> 00:02:05,590 but also Maria and Connor joining us here today. 47 00:02:05,590 --> 00:02:09,205 And so without further ado, Tommy, welcome back to CS50. 48 00:02:09,205 --> 00:02:11,830 TOMMY MACWILLIAMS: Thanks, David, it's always great to be back. 49 00:02:11,830 --> 00:02:14,247 I love doing this interview workshop and helping everybody 50 00:02:14,247 --> 00:02:17,620 think about how to prepare their resume, get ready for interviews, 51 00:02:17,620 --> 00:02:22,127 do a great job interviewing, and then think about what to do after that. 52 00:02:22,127 --> 00:02:23,710 I've been on both sides of interviews. 53 00:02:23,710 --> 00:02:27,040 I've probably done thousands of interviews as the interviewer. 54 00:02:27,040 --> 00:02:30,400 I've also been on the other side, and I've also bombed interviews myself, 55 00:02:30,400 --> 00:02:32,230 so I know exactly how that feels. 56 00:02:32,230 --> 00:02:35,620 And helping with this workshop, I'm really 57 00:02:35,620 --> 00:02:39,070 hoping to help everybody just give the best interview performance they can 58 00:02:39,070 --> 00:02:41,740 and really demonstrate the skills that you have as an engineer. 59 00:02:41,740 --> 00:02:43,990 So joining me today are Maria and Connor, 60 00:02:43,990 --> 00:02:46,978 so I'll turn it over to Maria to introduce herself, as well. 61 00:02:46,978 --> 00:02:49,270 MARIA ZLATKOVA: Hi, everyone, super awesome to be here, 62 00:02:49,270 --> 00:02:51,040 and very excited for our session today. 63 00:02:51,040 --> 00:02:55,775 I used to be [INAUDIBLE] in CS50 years back until 2018, 64 00:02:55,775 --> 00:02:58,840 since then have worked at Instagram as a software engineer 65 00:02:58,840 --> 00:03:03,010 and most recently as a co-founder of my own startup called Kangaroo. 66 00:03:03,010 --> 00:03:06,580 And I'm very excited to be here today. 67 00:03:06,580 --> 00:03:09,970 As Tommy said, I've also bombed my very fair share of interviews. 68 00:03:09,970 --> 00:03:12,880 I have some very clear memories of the ones I bombed. 69 00:03:12,880 --> 00:03:15,940 I've also been on the other side, done probably hundreds, definitely not 70 00:03:15,940 --> 00:03:18,488 thousands, at Tommy's level just yet. 71 00:03:18,488 --> 00:03:20,530 But the interview process is definitely something 72 00:03:20,530 --> 00:03:24,700 that I'm eager to help everyone master, so I'm excited to be here. 73 00:03:24,700 --> 00:03:26,810 And I'm going to hand it off to Connor. 74 00:03:26,810 --> 00:03:28,310 CONNOR LEGGETT: Right, hi, everyone. 75 00:03:28,310 --> 00:03:29,260 I am Connor. 76 00:03:29,260 --> 00:03:35,770 I am currently a head CA for CS50 at the college, 77 00:03:35,770 --> 00:03:40,280 and I am currently a junior at the college. 78 00:03:40,280 --> 00:03:44,230 So I am applying for internships for next summer, 2023-- 79 00:03:44,230 --> 00:03:47,290 or yeah, 2022, sorry. 80 00:03:47,290 --> 00:03:51,940 And so I have been having several interviews a week for the past week, 81 00:03:51,940 --> 00:03:53,320 so I'm right in the middle of it. 82 00:03:53,320 --> 00:03:56,650 And just like other people have been saying, 83 00:03:56,650 --> 00:03:59,950 I've had some of those interviews go very, very well and some of them 84 00:03:59,950 --> 00:04:01,970 go very, very badly. 85 00:04:01,970 --> 00:04:05,170 So I'm really excited to learn more about how 86 00:04:05,170 --> 00:04:10,090 to help those go a little bit better than they could, possibly, 87 00:04:10,090 --> 00:04:14,037 and also to help all of you get started in interviews. 88 00:04:14,037 --> 00:04:17,079 TOMMY MACWILLIAMS: So today, we're going to cover a few different things, 89 00:04:17,079 --> 00:04:20,029 sort of the entire interview process from end to end. 90 00:04:20,029 --> 00:04:22,912 So first we're going to talk about how to choose companies and pick 91 00:04:22,912 --> 00:04:25,120 opportunities that are great for you and where you're 92 00:04:25,120 --> 00:04:26,620 going to have a great experience. 93 00:04:26,620 --> 00:04:28,580 Next, we're going to talk about resumes. 94 00:04:28,580 --> 00:04:32,110 I'm not going to spend a ton of time on this, but just some quick simple rules 95 00:04:32,110 --> 00:04:34,210 for putting together a great resume. 96 00:04:34,210 --> 00:04:36,760 Then we'll talk a bit about how to prepare 97 00:04:36,760 --> 00:04:39,170 before a tech interview happens. 98 00:04:39,170 --> 00:04:43,330 Then we'll walk through during the interview, what's expected for you, 99 00:04:43,330 --> 00:04:46,720 as well as some tips and tricks for doing well in the technical interview 100 00:04:46,720 --> 00:04:47,512 portion itself. 101 00:04:47,512 --> 00:04:50,470 Then we're going to have a couple of mock interviews, so one with Maria 102 00:04:50,470 --> 00:04:51,310 and one with Connor. 103 00:04:51,310 --> 00:04:53,950 We'll simulate an actual tech interview. 104 00:04:53,950 --> 00:04:56,900 We'll use real questions that I've used in the past, 105 00:04:56,900 --> 00:05:00,040 so these just aren't fake, random questions, 106 00:05:00,040 --> 00:05:03,380 but these are real questions that you could see at a tech company, 107 00:05:03,380 --> 00:05:06,330 and we'll go over some techniques there. 108 00:05:06,330 --> 00:05:10,220 And then last, we'll wrap up with some things you can do after the interview 109 00:05:10,220 --> 00:05:15,110 and looking ahead as you improve your interviewing skills. 110 00:05:15,110 --> 00:05:19,000 So the first thing I want to talk about is choosing companies. 111 00:05:19,000 --> 00:05:21,970 So obviously, as you're looking around at internships 112 00:05:21,970 --> 00:05:25,960 and full-time opportunities, there are so many companies and opportunities 113 00:05:25,960 --> 00:05:26,680 out there. 114 00:05:26,680 --> 00:05:31,780 And so what you want to do is help narrow that down into a small set. 115 00:05:31,780 --> 00:05:34,663 Nobody wants to be doing 500 interviews a month. 116 00:05:34,663 --> 00:05:36,580 You're going to exhaust yourself, it's tiring. 117 00:05:36,580 --> 00:05:40,120 And so the more you can narrow down your selection up front, more efficient 118 00:05:40,120 --> 00:05:42,320 you can be in your interview process. 119 00:05:42,320 --> 00:05:45,010 So I come up with here just four questions 120 00:05:45,010 --> 00:05:47,530 that you can ask yourself as you're evaluating 121 00:05:47,530 --> 00:05:51,020 the space of possible companies. 122 00:05:51,020 --> 00:05:53,110 So the first thing you'll want to ask yourself 123 00:05:53,110 --> 00:05:58,993 is, what are you looking for out of this internship or this full-time role? 124 00:05:58,993 --> 00:06:01,660 So for some folks, especially if you're early on in your career, 125 00:06:01,660 --> 00:06:03,952 the thing you might be looking for out of an internship 126 00:06:03,952 --> 00:06:05,827 is you really want to maximize for learning. 127 00:06:05,827 --> 00:06:07,660 You really want to go somewhere where you're 128 00:06:07,660 --> 00:06:10,270 able to have a lot of mentorship, where you'll 129 00:06:10,270 --> 00:06:14,740 be in a space that emphasizes learning and even 130 00:06:14,740 --> 00:06:16,750 failure as a learning mechanism. 131 00:06:16,750 --> 00:06:18,730 And that might be different than somebody 132 00:06:18,730 --> 00:06:22,900 who, say, is five or six years into their career, and rather than learning, 133 00:06:22,900 --> 00:06:27,250 they're looking for something more of a leadership role or to be in a place 134 00:06:27,250 --> 00:06:30,820 where they can have more impact and take on more responsibility. 135 00:06:30,820 --> 00:06:33,850 So I'll say that everybody here is different. 136 00:06:33,850 --> 00:06:36,130 You might have friends who are also interviewing, 137 00:06:36,130 --> 00:06:40,605 and maybe what they're looking for is an opportunity in some specific city, 138 00:06:40,605 --> 00:06:41,980 and they really want to be there. 139 00:06:41,980 --> 00:06:43,810 And then you say, oh, should I should I go there too? 140 00:06:43,810 --> 00:06:45,227 That's where my friends are going. 141 00:06:45,227 --> 00:06:45,970 Not necessarily. 142 00:06:45,970 --> 00:06:47,720 Everybody is really, really different. 143 00:06:47,720 --> 00:06:49,750 And I think when I was interviewing in college, 144 00:06:49,750 --> 00:06:52,858 something that I kind of got bogged down in is, well, I think I want this, 145 00:06:52,858 --> 00:06:55,400 but my friends are doing all these things that are different, 146 00:06:55,400 --> 00:06:57,490 so maybe I should do that too, when the reality is 147 00:06:57,490 --> 00:06:59,240 that everybody is really different. 148 00:06:59,240 --> 00:07:01,870 And so just ask yourself, what are your goals, 149 00:07:01,870 --> 00:07:04,990 and what are you looking to get out of your next internship 150 00:07:04,990 --> 00:07:07,960 or full-time opportunity? 151 00:07:07,960 --> 00:07:10,300 The next question that I would ask yourself 152 00:07:10,300 --> 00:07:14,050 is, would you be excited to work with this team every day? 153 00:07:14,050 --> 00:07:16,420 You're going to be in an internship or a full-time role, 154 00:07:16,420 --> 00:07:19,360 you're going to be working with these people a lot on their mission 155 00:07:19,360 --> 00:07:20,890 and on their products a lot. 156 00:07:20,890 --> 00:07:24,850 And so I'd make sure that you're as excited as you can be about that. 157 00:07:24,850 --> 00:07:28,540 During the interview process, you'll have a lot of opportunities 158 00:07:28,540 --> 00:07:31,810 to meet with different people on the team and hear their stories 159 00:07:31,810 --> 00:07:33,250 and ask them questions. 160 00:07:33,250 --> 00:07:37,180 And that really is an opportunity for you to get more information about, 161 00:07:37,180 --> 00:07:39,970 is this a team that I'd be excited to join? 162 00:07:39,970 --> 00:07:43,330 Is their working style something that aligns with my working style, 163 00:07:43,330 --> 00:07:45,560 their goals align with my goals? 164 00:07:45,560 --> 00:07:49,150 And so it's really a good opportunity to ask yourself that. 165 00:07:49,150 --> 00:07:51,490 I think a similar question here is whether or not 166 00:07:51,490 --> 00:07:54,440 your values align with the company's values. 167 00:07:54,440 --> 00:07:58,090 So in many, many, many tech companies, you can find on their website 168 00:07:58,090 --> 00:08:01,060 or on their careers page something with values. 169 00:08:01,060 --> 00:08:06,580 And a value is basically something that this company values more 170 00:08:06,580 --> 00:08:08,020 than other companies. 171 00:08:08,020 --> 00:08:11,560 So for instance, a company value might be something like-- 172 00:08:11,560 --> 00:08:14,680 an early Facebook one was, done is better than perfect. 173 00:08:14,680 --> 00:08:18,010 And what that communicated was that we're not a bunch of perfectionists. 174 00:08:18,010 --> 00:08:22,120 If you're the type of person who wants to get everything perfectly correct 175 00:08:22,120 --> 00:08:24,970 and be super pedantic, then this isn't the company for you. 176 00:08:24,970 --> 00:08:28,120 Because we're the type of people who are going to get things done just as 177 00:08:28,120 --> 00:08:30,160 much as they need to be, maybe 80% of the way 178 00:08:30,160 --> 00:08:33,070 there, and then ship it and iterate and get feedback. 179 00:08:33,070 --> 00:08:35,510 And that value isn't necessarily good or bad. 180 00:08:35,510 --> 00:08:38,840 It's just something the company has decided about their own workflow. 181 00:08:38,840 --> 00:08:40,570 And so you can look at the company values 182 00:08:40,570 --> 00:08:42,970 and can compare that to your own internal values and say, 183 00:08:42,970 --> 00:08:46,550 is this going to be a good fit for me? 184 00:08:46,550 --> 00:08:48,890 The last thing to ask yourself is whether or not 185 00:08:48,890 --> 00:08:52,730 this company size matches what you're looking for. 186 00:08:52,730 --> 00:08:55,600 I've talked to a lot of candidates in the interview process. 187 00:08:55,600 --> 00:08:58,650 So I'll ask them, what size company are you looking for? 188 00:08:58,650 --> 00:08:59,900 And they'll say, I don't know. 189 00:08:59,900 --> 00:09:00,942 It doesn't really matter. 190 00:09:00,942 --> 00:09:04,830 I could join a four-person company or I could join a 4,000-person company. 191 00:09:04,830 --> 00:09:06,420 And the answer is, it does matter. 192 00:09:06,420 --> 00:09:08,602 That's maybe a bad answer to that question, 193 00:09:08,602 --> 00:09:11,810 since your day-to-day experience at a four-person company and your day-to-day 194 00:09:11,810 --> 00:09:15,210 experience at a 4,000-person company, they're just going to be really, 195 00:09:15,210 --> 00:09:15,980 really different. 196 00:09:15,980 --> 00:09:19,207 No matter how much the large company says, oh, we're just like a small team, 197 00:09:19,207 --> 00:09:21,290 or no matter how much a small team says, but we're 198 00:09:21,290 --> 00:09:24,560 really organized and stable like a large company, the reality is just 199 00:09:24,560 --> 00:09:28,550 there's some things that become possible and impossible at various company 200 00:09:28,550 --> 00:09:30,050 sizes. 201 00:09:30,050 --> 00:09:33,440 So this is a chart that I really, really like. 202 00:09:33,440 --> 00:09:36,560 I think it was originally published by Dustin Moskovitz at Asana. 203 00:09:36,560 --> 00:09:40,922 But it breaks down startups into these three different categories, 204 00:09:40,922 --> 00:09:42,380 based on how many people are there. 205 00:09:42,380 --> 00:09:48,890 So you can see, at a small company, mentorship doesn't really exist. 206 00:09:48,890 --> 00:09:50,690 People help you as you need it, but there's 207 00:09:50,690 --> 00:09:54,560 no sort of formalized internship program. 208 00:09:54,560 --> 00:09:57,170 Your autonomy is just like, whatever you've got to do, 209 00:09:57,170 --> 00:09:59,990 you figure out what you have to do, and then you go and do that. 210 00:09:59,990 --> 00:10:02,450 It could involve wearing a variety of different hats, 211 00:10:02,450 --> 00:10:04,190 being in a variety of different roles. 212 00:10:04,190 --> 00:10:05,898 And then on the other end of the spectrum 213 00:10:05,898 --> 00:10:09,440 is a large company, where you're going to be hired into a specific role, 214 00:10:09,440 --> 00:10:13,310 onto a specific team, where maybe you're a backend engineer hired 215 00:10:13,310 --> 00:10:16,400 onto the infrastructure scaling team for the machine learning 216 00:10:16,400 --> 00:10:19,550 at this company, which is much more narrow. 217 00:10:19,550 --> 00:10:23,810 Your agency there is, you're going to have much more clear goals set 218 00:10:23,810 --> 00:10:25,550 by the team, set by management. 219 00:10:25,550 --> 00:10:27,798 So it's very much not to just figure out whatever 220 00:10:27,798 --> 00:10:29,090 you need to do, and then do it. 221 00:10:29,090 --> 00:10:30,590 It's going to be, here's our team's goals 222 00:10:30,590 --> 00:10:32,900 for the quarter, here are the metrics we're trying to hit, 223 00:10:32,900 --> 00:10:36,180 here are the projects that we think are going to make those metrics possible. 224 00:10:36,180 --> 00:10:38,180 And mentorship can be much more formalized. 225 00:10:38,180 --> 00:10:40,910 You might be assigned a formal mentor on your first day, 226 00:10:40,910 --> 00:10:44,480 have a variety of different support systems, internal documentation, 227 00:10:44,480 --> 00:10:46,110 things like that. 228 00:10:46,110 --> 00:10:48,530 And again, something I really want to emphasize here 229 00:10:48,530 --> 00:10:51,920 is that there is absolutely no right answer. 230 00:10:51,920 --> 00:10:54,030 Everybody is really, really different. 231 00:10:54,030 --> 00:10:55,910 And as your career progresses, what you're 232 00:10:55,910 --> 00:10:58,165 looking for might even change over time. 233 00:10:58,165 --> 00:11:00,290 So definitely don't look at this chart and say, oh, 234 00:11:00,290 --> 00:11:03,320 the small company's the best or the medium company's the best. 235 00:11:03,320 --> 00:11:06,500 It's more about what's the best for you, not 236 00:11:06,500 --> 00:11:09,920 the objective, correct answer for what to do after you graduate college 237 00:11:09,920 --> 00:11:12,980 or what to do as the second company you join in your career. 238 00:11:12,980 --> 00:11:16,220 You'll probably read a lot of blog posts on the internet claiming 239 00:11:16,220 --> 00:11:19,340 there's some objective truth here, but I promise you, there is not. 240 00:11:19,340 --> 00:11:24,850 And so it's more about reflecting on what you're looking for yourself. 241 00:11:24,850 --> 00:11:26,370 So that's it on choosing companies. 242 00:11:26,370 --> 00:11:29,460 I think really the takeaway here is just spend a little bit of time 243 00:11:29,460 --> 00:11:32,820 up front narrowing down your search and also reflecting 244 00:11:32,820 --> 00:11:35,220 on what you're looking for personally. 245 00:11:35,220 --> 00:11:38,250 As we'll see later, a really common question in interview 246 00:11:38,250 --> 00:11:41,300 is, what are you looking for, and why would you want to join this team? 247 00:11:41,300 --> 00:11:43,410 And so the more you can reflect on that up front, 248 00:11:43,410 --> 00:11:47,110 the better you're going to do on those types of questions. 249 00:11:47,110 --> 00:11:50,580 So next we're going to jump into resumes. 250 00:11:50,580 --> 00:11:55,930 And the first thing I'll say about resumes is they are not that important. 251 00:11:55,930 --> 00:11:59,760 So a lot of people spend a ton of time agonizing over, 252 00:11:59,760 --> 00:12:03,120 should this be a em-dash or a semicolon in my resume? 253 00:12:03,120 --> 00:12:04,680 Which is going to get me the job? 254 00:12:04,680 --> 00:12:08,400 The answer is that it doesn't really matter that much. 255 00:12:08,400 --> 00:12:10,890 I think on average-- we've talked to a lot of recruiters, 256 00:12:10,890 --> 00:12:12,510 I've been a hiring manager myself. 257 00:12:12,510 --> 00:12:14,940 I'd say the average amount of time I spend 258 00:12:14,940 --> 00:12:17,460 reading a resume is about 30 seconds. 259 00:12:17,460 --> 00:12:22,140 And so as you're creating your resume, really, really optimize for that. 260 00:12:22,140 --> 00:12:25,530 The person reading this is not going to spend more than a minute 261 00:12:25,530 --> 00:12:28,090 or so reading it. 262 00:12:28,090 --> 00:12:30,630 And so what I've done is I've created these 10 resume 263 00:12:30,630 --> 00:12:33,480 rules that are all pretty simple. 264 00:12:33,480 --> 00:12:37,668 As long as you follow them, you'll probably have a pretty good resume. 265 00:12:37,668 --> 00:12:40,710 But before I jump into my rules, I'd love to turn it over to the audience 266 00:12:40,710 --> 00:12:44,610 and hear, what are some resume tips that you've heard in the past? 267 00:12:44,610 --> 00:12:47,010 DAVID MALAN: Tommy, Martin mentions one page. 268 00:12:47,010 --> 00:12:50,610 Jessica notes that resumes mean a lot in South Africa. 269 00:12:50,610 --> 00:12:53,100 Anna proposes that it be easy to read. 270 00:12:53,100 --> 00:12:55,530 Johnny mentions keywords. 271 00:12:55,530 --> 00:12:58,050 Rocky mentions targeting for the job. 272 00:12:58,050 --> 00:13:00,150 Assard mentions concise. 273 00:13:00,150 --> 00:13:03,390 Jessica also notes to add skills in it. 274 00:13:03,390 --> 00:13:06,390 Abhishek echoes the sentiment that it should be one page. 275 00:13:06,390 --> 00:13:08,370 Keep it plain says, Tamika. 276 00:13:08,370 --> 00:13:13,710 Moaz says one page, also nothing too colorful; concise and clear; 277 00:13:13,710 --> 00:13:17,310 not to make it too long; skills at top; focus on the role you played; 278 00:13:17,310 --> 00:13:20,070 tech stack on top; clear font; has to be concise. 279 00:13:20,070 --> 00:13:22,070 I think we can keep going and going here, Tommy. 280 00:13:22,070 --> 00:13:24,237 TOMMY MACWILLIAMS: Yeah, lots of great advice there. 281 00:13:24,237 --> 00:13:28,410 I love a bunch of people piling on the concise, simple, and often takes 282 00:13:28,410 --> 00:13:29,610 the form of one page. 283 00:13:29,610 --> 00:13:33,550 I think if I had to give one piece of advice, it would be that, as well. 284 00:13:33,550 --> 00:13:36,600 So here are my 10 rules that, as long as you follow these, 285 00:13:36,600 --> 00:13:39,160 your resume is going to be in good shape. 286 00:13:39,160 --> 00:13:42,300 So number 1-- one page, no exceptions. 287 00:13:42,300 --> 00:13:43,320 There's a lot of folks-- 288 00:13:43,320 --> 00:13:45,570 and again, this is going to vary a little bit by role, 289 00:13:45,570 --> 00:13:48,570 so I guess here's an exception to my no exception. 290 00:13:48,570 --> 00:13:52,530 If you're in academia, for instance, a really long CV is much more common. 291 00:13:52,530 --> 00:13:55,200 But if you're looking for a typical tech job, 292 00:13:55,200 --> 00:13:58,200 one page, and don't make any exceptions there. 293 00:13:58,200 --> 00:14:01,920 The author of Python, the person who created the Python programming 294 00:14:01,920 --> 00:14:03,895 language, he used to be at Dropbox. 295 00:14:03,895 --> 00:14:06,270 And at some point, he published his resume and just said, 296 00:14:06,270 --> 00:14:08,560 oh, here's what mine looks like, and his is one page. 297 00:14:08,560 --> 00:14:11,227 And so if the person who created the Python programming language 298 00:14:11,227 --> 00:14:16,290 can put all of his achievements and skills onto one page, so can you. 299 00:14:16,290 --> 00:14:18,390 Number 2-- I think folks mentioned this, as well-- 300 00:14:18,390 --> 00:14:20,160 is make it really easy to skim. 301 00:14:20,160 --> 00:14:23,280 As I mentioned, the person reading this resume, 302 00:14:23,280 --> 00:14:26,920 they're not going to spend hours poring over every little detail. 303 00:14:26,920 --> 00:14:30,930 And so if you make it really hard to find key information like, 304 00:14:30,930 --> 00:14:35,530 what is your name, what is your email, what roles have you had in the past, 305 00:14:35,530 --> 00:14:38,880 what are your technical skills, if that's hard to find on your resume, 306 00:14:38,880 --> 00:14:41,820 they could just end up giving up on your resume 307 00:14:41,820 --> 00:14:44,020 and not taking the time to try to find it. 308 00:14:44,020 --> 00:14:46,860 So keep in mind, the person reading this, they're trying to go fast. 309 00:14:46,860 --> 00:14:52,150 Make it easier on the reader of your resume to find important things. 310 00:14:52,150 --> 00:14:54,442 Number 3, make your contact info obvious. 311 00:14:54,442 --> 00:14:57,150 I've had resumes in the past where I've said, wow, this is great. 312 00:14:57,150 --> 00:15:00,570 Some recruiter just passed it along to me, this resume looks great-- 313 00:15:00,570 --> 00:15:02,910 no way of contacting the person on the resume. 314 00:15:02,910 --> 00:15:06,442 There is no phone number and no email, no link to a portfolio, anything. 315 00:15:06,442 --> 00:15:07,900 So it's like, OK, now what do I do? 316 00:15:07,900 --> 00:15:10,950 And the recruiter had to go and track them down, which was a pain. 317 00:15:10,950 --> 00:15:13,800 So the whole point of your resume is to get in the door 318 00:15:13,800 --> 00:15:15,263 and start the interview process. 319 00:15:15,263 --> 00:15:17,430 So make sure it's really easy for the company you're 320 00:15:17,430 --> 00:15:20,780 applying to actually reach you. 321 00:15:20,780 --> 00:15:24,380 Number 4, you want to highlight specific accomplishments. 322 00:15:24,380 --> 00:15:29,880 The more specific and concrete your resume can be, the better. 323 00:15:29,880 --> 00:15:35,390 So rather than having a line on your resume like "improved company 324 00:15:35,390 --> 00:15:37,185 metrics"-- it's really vague-- 325 00:15:37,185 --> 00:15:38,060 what are the metrics? 326 00:15:38,060 --> 00:15:39,080 What does improved mean? 327 00:15:39,080 --> 00:15:40,235 Improved by how much? 328 00:15:40,235 --> 00:15:42,500 As much as you can, be specific on your resume. 329 00:15:42,500 --> 00:15:48,170 A line that said, "improved the performance of our critical machine 330 00:15:48,170 --> 00:15:51,920 learning ranking system by 23% by implementing 331 00:15:51,920 --> 00:15:56,240 backend optimizations like improved caching," that was super specific. 332 00:15:56,240 --> 00:16:00,140 I gave a metric, I said what the system was, I said what I actually did there. 333 00:16:00,140 --> 00:16:03,590 The more specific you can be, the more that a recruiter or a hiring manager 334 00:16:03,590 --> 00:16:06,770 can understand what your actual impact was, and that often 335 00:16:06,770 --> 00:16:08,240 reflects well on you. 336 00:16:08,240 --> 00:16:11,840 I will say that some companies will have nondisclosure agreements, where 337 00:16:11,840 --> 00:16:14,300 you might be working on a project that hasn't launched yet. 338 00:16:14,300 --> 00:16:18,000 Or some metrics might be confidential and internal to the company. 339 00:16:18,000 --> 00:16:21,170 So certainly don't break any of those nondisclosure agreements. 340 00:16:21,170 --> 00:16:25,010 But many times, metrics of the form-- 341 00:16:25,010 --> 00:16:29,558 improved performance or scaled some system to some number of users-- 342 00:16:29,558 --> 00:16:31,850 those are the types of things that are typically public 343 00:16:31,850 --> 00:16:33,475 and that you can put on a resume. 344 00:16:33,475 --> 00:16:36,350 If you have any doubts, you can also just ask your manager or someone 345 00:16:36,350 --> 00:16:37,610 at the internship you're at. 346 00:16:37,610 --> 00:16:39,230 Just say, hey, this is my resume. 347 00:16:39,230 --> 00:16:43,900 Is it OK if I disclose this particular metric? 348 00:16:43,900 --> 00:16:47,320 Next, definitely include interesting personal projects. 349 00:16:47,320 --> 00:16:50,470 So especially for folks who are a little earlier on in their career 350 00:16:50,470 --> 00:16:53,500 and might not have experience at multiple companies yet, 351 00:16:53,500 --> 00:16:57,010 definitely include personal projects that you've worked on. 352 00:16:57,010 --> 00:17:00,037 Maybe that could be an interesting final project for a course. 353 00:17:00,037 --> 00:17:02,620 Maybe it could just be something you built in your spare time. 354 00:17:02,620 --> 00:17:04,453 But it's something that's great to highlight 355 00:17:04,453 --> 00:17:07,240 to show that you have a lot of passion for what you're doing 356 00:17:07,240 --> 00:17:10,450 and show off what you're capable of building. 357 00:17:10,450 --> 00:17:12,849 I will say, I'll caution against, if you're 358 00:17:12,849 --> 00:17:15,220 able to have a project that's a little more unique 359 00:17:15,220 --> 00:17:18,640 and something that you designed yourself, compared to-- 360 00:17:18,640 --> 00:17:22,000 many courses have a final project that everyone builds the same thing, 361 00:17:22,000 --> 00:17:23,460 and it's kind of standard. 362 00:17:23,460 --> 00:17:25,869 I would highlight something that you created yourself, 363 00:17:25,869 --> 00:17:29,230 rather than some kind of standard final project, if you're able to. 364 00:17:29,230 --> 00:17:30,650 But if you're not, that's OK too. 365 00:17:30,650 --> 00:17:32,650 Something here is certainly better than nothing. 366 00:17:32,650 --> 00:17:35,330 367 00:17:35,330 --> 00:17:38,240 Next, no charts or ratings-- 368 00:17:38,240 --> 00:17:41,420 this is maybe my number one resume pet peeve. 369 00:17:41,420 --> 00:17:47,870 A lot of people have on their resume some chart that says, I'm a 5 out of 10 370 00:17:47,870 --> 00:17:51,620 at JavaScript, and I'm a 7 out of 10 at CSS. 371 00:17:51,620 --> 00:17:54,080 To me, this is just a total waste of space. 372 00:17:54,080 --> 00:17:57,710 I have no idea what your 7 out of 10 at CSS means. 373 00:17:57,710 --> 00:17:59,960 Is the inventor of CSS a 10, or is someone 374 00:17:59,960 --> 00:18:01,652 with three years of experience a 10? 375 00:18:01,652 --> 00:18:02,610 It just makes no sense. 376 00:18:02,610 --> 00:18:07,370 A lot of people try to do this as a way of kind of creatively expressing 377 00:18:07,370 --> 00:18:08,480 their tech stack. 378 00:18:08,480 --> 00:18:11,030 I really don't like it at all, and it doesn't 379 00:18:11,030 --> 00:18:15,830 communicate the information you think is communicating, more likely than not. 380 00:18:15,830 --> 00:18:19,550 Next, I would not have a specific objective on your resume. 381 00:18:19,550 --> 00:18:22,730 Many resumes I've seen have at the top some objective 382 00:18:22,730 --> 00:18:27,320 that says objective, colon, to secure a spot as a software engineer 383 00:18:27,320 --> 00:18:29,783 able to have impact on this company. 384 00:18:29,783 --> 00:18:30,950 It's a total waste of space. 385 00:18:30,950 --> 00:18:34,550 We know that the objective of you handing me a resume 386 00:18:34,550 --> 00:18:37,430 is to get a spot at the company that I work at. 387 00:18:37,430 --> 00:18:39,147 So it's a total waste of space. 388 00:18:39,147 --> 00:18:40,730 You've only got one page to work with. 389 00:18:40,730 --> 00:18:43,158 Putting that there doesn't really offer a lot of value. 390 00:18:43,158 --> 00:18:45,950 Again, there might be some exceptions here in different industries, 391 00:18:45,950 --> 00:18:48,700 where maybe it's not actually clear what role you're applying for. 392 00:18:48,700 --> 00:18:51,742 But in the case where you've gone through some sort of online application 393 00:18:51,742 --> 00:18:54,992 that says, here's the role I'm applying for, or you're talking to a recruiter, 394 00:18:54,992 --> 00:18:57,300 and it's really clear what role you're applying for, 395 00:18:57,300 --> 00:19:00,950 don't waste space with an objective on your resume. 396 00:19:00,950 --> 00:19:04,490 Number 8, use a professional email address. 397 00:19:04,490 --> 00:19:07,175 I remember one resume I got-- 398 00:19:07,175 --> 00:19:09,050 I forget what the person's name is-- and they 399 00:19:09,050 --> 00:19:14,185 said it was their name, 123456789, 87654321, 400 00:19:14,185 --> 00:19:15,560 and that was the email they used. 401 00:19:15,560 --> 00:19:16,977 And I was like, you've got to be-- 402 00:19:16,977 --> 00:19:20,180 I instantly think less of this person, because this is their email. 403 00:19:20,180 --> 00:19:25,130 If you're still using the same gmail address you used 20 years ago, 404 00:19:25,130 --> 00:19:26,330 just create a new one. 405 00:19:26,330 --> 00:19:28,010 First initial, last name is great. 406 00:19:28,010 --> 00:19:29,630 Last name, first initial is great. 407 00:19:29,630 --> 00:19:30,830 Your full name is great. 408 00:19:30,830 --> 00:19:33,920 It's super easy to create a professional looking email 409 00:19:33,920 --> 00:19:35,840 using Gmail or free email service. 410 00:19:35,840 --> 00:19:36,770 Definitely do that. 411 00:19:36,770 --> 00:19:39,910 Don't have some kind of cute joke email. 412 00:19:39,910 --> 00:19:43,130 Number 9, include relevant links if you have them. 413 00:19:43,130 --> 00:19:47,270 So if you have a LinkedIn, a GitHub profile, a personal portfolio, 414 00:19:47,270 --> 00:19:49,960 especially if you're applying for a design role, 415 00:19:49,960 --> 00:19:51,430 include them on your resume. 416 00:19:51,430 --> 00:19:54,190 I think sometimes a hiring manager, before they interview you, 417 00:19:54,190 --> 00:19:58,872 they might spend a quick 30, 60 seconds skimming through your portfolio 418 00:19:58,872 --> 00:20:01,330 so you'd have something to talk about during the interview. 419 00:20:01,330 --> 00:20:05,080 I've certainly clicked on someone's GitHub, saw, oh, they created 420 00:20:05,080 --> 00:20:07,517 this library for progress bars of the command line. 421 00:20:07,517 --> 00:20:08,350 That's kind of cool. 422 00:20:08,350 --> 00:20:11,200 And I'll ask them about that during our interview. 423 00:20:11,200 --> 00:20:14,320 So that just helps your interviewer understand a bit more 424 00:20:14,320 --> 00:20:16,660 about your background. 425 00:20:16,660 --> 00:20:20,230 And last, definitely don't sweat the aesthetics 426 00:20:20,230 --> 00:20:22,180 and the visuals of your resume. 427 00:20:22,180 --> 00:20:24,610 And many times simpler is much better. 428 00:20:24,610 --> 00:20:26,710 Simpler is often very easy to skim. 429 00:20:26,710 --> 00:20:31,720 But don't worry about things like colors and photos and fonts. 430 00:20:31,720 --> 00:20:34,450 You can create a really simple resume that gets your point across 431 00:20:34,450 --> 00:20:37,480 without having to worry about all of that. 432 00:20:37,480 --> 00:20:40,260 So next I have, a couple example resumes, 433 00:20:40,260 --> 00:20:43,440 and I'd love to hear from folks in the audience things that 434 00:20:43,440 --> 00:20:48,450 are good and bad about these resumes, taking into account these 10 resume 435 00:20:48,450 --> 00:20:49,050 rules. 436 00:20:49,050 --> 00:20:50,883 And I will note that these are fake resumes. 437 00:20:50,883 --> 00:20:52,090 These are not real people. 438 00:20:52,090 --> 00:20:54,580 So we're not roasting anyone on the internet right now. 439 00:20:54,580 --> 00:20:56,915 So here is the first one. 440 00:20:56,915 --> 00:20:57,790 What do people think? 441 00:20:57,790 --> 00:21:00,520 What is good and bad about this? 442 00:21:00,520 --> 00:21:03,850 DAVID MALAN: Tommy, the answers are starting to fly in here. 443 00:21:03,850 --> 00:21:05,890 The skill graph is commented on. 444 00:21:05,890 --> 00:21:08,890 Ratings are bad, too hard to read, the skill bar, the rating 445 00:21:08,890 --> 00:21:11,800 bar is TOO MUCH AT ONCE, in all caps. 446 00:21:11,800 --> 00:21:14,920 Bad, in a word, hard to find information, 447 00:21:14,920 --> 00:21:17,140 charts and ratings are bad, using charts, 448 00:21:17,140 --> 00:21:23,470 two columns are good, more used space, font, CHARTS BAD, all caps, bars, 449 00:21:23,470 --> 00:21:26,320 scale bars equal bad, hard to skim. 450 00:21:26,320 --> 00:21:29,290 Progress bar must not be included, BAD in all caps-- 451 00:21:29,290 --> 00:21:30,910 I think I'm now encouraging it. 452 00:21:30,910 --> 00:21:33,880 And there seems to indeed be a theme developing. 453 00:21:33,880 --> 00:21:38,180 TOMMY MACWILLIAMS: Yes, I'll go through a few things about this. 454 00:21:38,180 --> 00:21:39,910 So the first thing that I like about this 455 00:21:39,910 --> 00:21:42,910 is that under the work experience and education, 456 00:21:42,910 --> 00:21:44,560 it's pretty easy to skim there. 457 00:21:44,560 --> 00:21:47,770 So I can see they worked as a data scientist. 458 00:21:47,770 --> 00:21:49,660 For some reason, in the two work experiences, 459 00:21:49,660 --> 00:21:52,090 they changed the order of the role and the companies. 460 00:21:52,090 --> 00:21:53,500 That's a little weird. 461 00:21:53,500 --> 00:21:56,860 But otherwise, I like that it was really easy to see what their experience was, 462 00:21:56,860 --> 00:21:58,390 where they worked. 463 00:21:58,390 --> 00:22:03,400 The content of the resume here, I'd say it's reasonably specific. 464 00:22:03,400 --> 00:22:06,770 I'd say, saying that they collected and studied interpreted large data sets 465 00:22:06,770 --> 00:22:08,455 to develop new forecasting models-- 466 00:22:08,455 --> 00:22:09,580 I think that's pretty good. 467 00:22:09,580 --> 00:22:11,788 I'd say the part, I'd make it a little more specific, 468 00:22:11,788 --> 00:22:14,500 because if you can be specific about how big the data sets were 469 00:22:14,500 --> 00:22:16,442 or exactly what you did to analyze them, I 470 00:22:16,442 --> 00:22:18,400 think that would make this a little bit better. 471 00:22:18,400 --> 00:22:21,520 But I just call this reasonably specific. 472 00:22:21,520 --> 00:22:26,170 This profile at the top, this top left, I think this is a waste of space, 473 00:22:26,170 --> 00:22:29,758 saying that they're a highly accurate and experienced data scientist. 474 00:22:29,758 --> 00:22:32,800 And I look at here, and they have three years of data science experience, 475 00:22:32,800 --> 00:22:34,925 so I don't need to be told how experienced you are. 476 00:22:34,925 --> 00:22:36,490 I can look at this from the resume. 477 00:22:36,490 --> 00:22:38,560 So I don't think that's a good use of space. 478 00:22:38,560 --> 00:22:41,330 Then yeah, I included this one on purpose, because it has charts. 479 00:22:41,330 --> 00:22:42,730 I don't really know what these charts mean. 480 00:22:42,730 --> 00:22:44,022 I don't know if you do, either. 481 00:22:44,022 --> 00:22:46,540 But this person looks like they're a fantastic team player, 482 00:22:46,540 --> 00:22:48,100 but they don't have attention to detail. 483 00:22:48,100 --> 00:22:51,100 And so like they say, well, do I want someone who doesn't have attention 484 00:22:51,100 --> 00:22:53,020 to detail being a data scientist? 485 00:22:53,020 --> 00:22:53,710 I don't know. 486 00:22:53,710 --> 00:22:57,040 I'm not really sure this communicates with what they wanted to communicate 487 00:22:57,040 --> 00:22:58,642 if this person were a real person. 488 00:22:58,642 --> 00:23:01,350 DAVID MALAN: Can I relay a couple of questions now from the chat? 489 00:23:01,350 --> 00:23:02,740 TOMMY MACWILLIAMS: Go for it. 490 00:23:02,740 --> 00:23:06,220 DAVID MALAN: Sergei asks a question about the CV. 491 00:23:06,220 --> 00:23:12,670 Do we need to adapt content in key words for ATS, application tracking systems? 492 00:23:12,670 --> 00:23:15,280 TOMMY MACWILLIAMS: Yeah, that's a good question. 493 00:23:15,280 --> 00:23:17,170 So in many companies, they'll have what's 494 00:23:17,170 --> 00:23:18,550 called an ATS, which is, as you mentioned, 495 00:23:18,550 --> 00:23:19,780 an applicant tracking system. 496 00:23:19,780 --> 00:23:24,280 So it might be Lever or Greenhouse, just some software that you apply to. 497 00:23:24,280 --> 00:23:28,030 And some of these will kind of look at your resume and filter out for keywords 498 00:23:28,030 --> 00:23:31,690 and, say, if it doesn't have the word JavaScript, throw it in the trash. 499 00:23:31,690 --> 00:23:32,980 So I wouldn't go overly-- 500 00:23:32,980 --> 00:23:37,600 I wouldn't go crazy and try to put every single keyword on your resume. 501 00:23:37,600 --> 00:23:42,010 But at the same time, just having a short list of languages you know 502 00:23:42,010 --> 00:23:43,570 or technologies you've worked with-- 503 00:23:43,570 --> 00:23:47,500 I think even I have this on my resume, just listing out the languages 504 00:23:47,500 --> 00:23:48,820 you've worked with in the past. 505 00:23:48,820 --> 00:23:53,937 If you want it to have a little bit of this or proficient with this language, 506 00:23:53,937 --> 00:23:56,770 or I'm new to this language or something, maybe a little bit of that 507 00:23:56,770 --> 00:23:57,190 is OK. 508 00:23:57,190 --> 00:24:00,357 But in general, just having a quick list that doesn't take up a lot of space 509 00:24:00,357 --> 00:24:01,720 is what I'd recommend. 510 00:24:01,720 --> 00:24:04,595 DAVID MALAN: And Tommy, another question was asked, which might vary, 511 00:24:04,595 --> 00:24:05,690 I imagine, by country. 512 00:24:05,690 --> 00:24:08,923 Provolika asks, should I add a photograph to the resume? 513 00:24:08,923 --> 00:24:11,090 TOMMY MACWILLIAMS: Yeah, this might vary by country. 514 00:24:11,090 --> 00:24:14,890 I would say that if you're applying to a US tech company, I wouldn't do that. 515 00:24:14,890 --> 00:24:17,110 It just falls into the same category. 516 00:24:17,110 --> 00:24:18,780 It's a waste of space. 517 00:24:18,780 --> 00:24:21,730 You can probably change that photo and put much more detail 518 00:24:21,730 --> 00:24:24,220 about the impact you had at an internship or a company. 519 00:24:24,220 --> 00:24:27,178 But again, this is going to vary a bit by country, and it's hard for me 520 00:24:27,178 --> 00:24:29,050 to speak to too much outside the US. 521 00:24:29,050 --> 00:24:31,460 But within the US, I would definitely not do that. 522 00:24:31,460 --> 00:24:33,760 DAVID MALAN: I'll continue to chime in, Tommy, as more questions arise. 523 00:24:33,760 --> 00:24:34,885 TOMMY MACWILLIAMS: Awesome. 524 00:24:34,885 --> 00:24:40,503 So let's jump to the next resume, things about this that are good and bad. 525 00:24:40,503 --> 00:24:42,920 DAVID MALAN: And as the comments start to come in, Tommy-- 526 00:24:42,920 --> 00:24:48,380 too long, verbose, too convoluted, too much text, it's a dissertation, 527 00:24:48,380 --> 00:24:49,520 unstructured. 528 00:24:49,520 --> 00:24:52,310 Is that a page from a novel, question mark? 529 00:24:52,310 --> 00:24:55,370 Hard to read, hard to skim, looks like a wall of text. 530 00:24:55,370 --> 00:24:58,140 Your school email will eventually expire, 531 00:24:58,140 --> 00:25:02,570 so I wouldn't use that, hard to read, very hard to read, hard to skim, 532 00:25:02,570 --> 00:25:04,130 it's too much. 533 00:25:04,130 --> 00:25:06,200 And there seems here to be a theme. 534 00:25:06,200 --> 00:25:11,890 In fact, Jose perhaps says it best, TLDR, too long, didn't read. 535 00:25:11,890 --> 00:25:15,140 TOMMY MACWILLIAMS: Yeah, I think that's sort of the same reaction I have here. 536 00:25:15,140 --> 00:25:17,630 I'll start with the things that I like about this. 537 00:25:17,630 --> 00:25:20,855 The sort of middle section here where it says "core expertise," 538 00:25:20,855 --> 00:25:22,070 I actually like this. 539 00:25:22,070 --> 00:25:24,250 If you were-- this is an engineering manager, 540 00:25:24,250 --> 00:25:26,750 and so their expertise here might be a little bit different. 541 00:25:26,750 --> 00:25:29,990 But seeing that they have experience in vendor relations 542 00:25:29,990 --> 00:25:33,437 or global projects and managing different time zones, 543 00:25:33,437 --> 00:25:34,520 that's pretty interesting. 544 00:25:34,520 --> 00:25:36,590 If you're an engineer a data scientist, a designer, 545 00:25:36,590 --> 00:25:39,440 this is probably where I'd put your languages or technologies you've 546 00:25:39,440 --> 00:25:40,100 used in the past. 547 00:25:40,100 --> 00:25:43,100 But this is actually kind of a nice way of-- maybe the only part of this 548 00:25:43,100 --> 00:25:46,565 that skimmable, but this is a reasonable list where I can quickly skim. 549 00:25:46,565 --> 00:25:48,860 Yeah, my main feedback on this resume is basically 550 00:25:48,860 --> 00:25:51,860 what everyone else mentioned, is that there's just so much text here. 551 00:25:51,860 --> 00:25:53,780 The font is really, really small. 552 00:25:53,780 --> 00:25:55,910 It's not really skimmable. 553 00:25:55,910 --> 00:25:58,678 To find the companies they worked at is shockingly difficult. 554 00:25:58,678 --> 00:26:00,470 Even though they're in all capital letters, 555 00:26:00,470 --> 00:26:06,292 it's pretty hard to see where they actually worked. 556 00:26:06,292 --> 00:26:08,750 A good thing is that their name and the contact information 557 00:26:08,750 --> 00:26:10,490 right at the top-- that's nice. 558 00:26:10,490 --> 00:26:13,100 But then again, this sort of top section here where they're 559 00:26:13,100 --> 00:26:16,790 writing, "merging visionary leadership with technical software engineering 560 00:26:16,790 --> 00:26:20,970 expertise," my reaction is like, OK, don't need to have that. 561 00:26:20,970 --> 00:26:22,770 It doesn't really add any value. 562 00:26:22,770 --> 00:26:24,950 So that that section at the top could be removed 563 00:26:24,950 --> 00:26:28,970 in favor of making this a little bit easier to skim, not having so much text 564 00:26:28,970 --> 00:26:30,540 crunched in here. 565 00:26:30,540 --> 00:26:31,970 So I'll pause for any questions. 566 00:26:31,970 --> 00:26:32,635 Yeah. 567 00:26:32,635 --> 00:26:34,760 DAVID MALAN: Some questions came up from Remington. 568 00:26:34,760 --> 00:26:37,070 If I'm a non-CS major, what would be the best 569 00:26:37,070 --> 00:26:40,640 way to add courses such as CS50 to my resume, and perhaps 570 00:26:40,640 --> 00:26:43,223 massive open online courses outside of college more generally? 571 00:26:43,223 --> 00:26:45,265 TOMMY MACWILLIAMS: Yeah, that's a great question. 572 00:26:45,265 --> 00:26:48,110 I put it in that same section where languages you've used, 573 00:26:48,110 --> 00:26:50,970 technologies you've used, courses you've taken, 574 00:26:50,970 --> 00:26:54,170 especially for undergrads or even people making a career shift, 575 00:26:54,170 --> 00:26:56,480 where they don't have a lot of that experience yet. 576 00:26:56,480 --> 00:26:58,820 We'd love to see courses, especially online courses, 577 00:26:58,820 --> 00:27:00,795 to show that you've taken the initiative, 578 00:27:00,795 --> 00:27:02,670 and you've gained some certain set of skills. 579 00:27:02,670 --> 00:27:07,190 So I remember when I was an undergrad, I had, basically, name, contact, and then 580 00:27:07,190 --> 00:27:09,170 languages I know, courses I've taken. 581 00:27:09,170 --> 00:27:13,340 I'd say CS50, Introduction to Computer Science, CS61, Systems Programming. 582 00:27:13,340 --> 00:27:16,790 And since the course number might not mean something to anybody, so just 583 00:27:16,790 --> 00:27:20,890 highlighting the courses you've taken as an undergrad can be great. 584 00:27:20,890 --> 00:27:23,390 DAVID MALAN: And Tommy, a couple of folks, Pragya and Achin, 585 00:27:23,390 --> 00:27:26,390 have asked about tools to use when writing a resume. 586 00:27:26,390 --> 00:27:30,260 Should they use an online resume maker, LawTech, Microsoft Word, 587 00:27:30,260 --> 00:27:31,280 something else? 588 00:27:31,280 --> 00:27:34,820 TOMMY MACWILLIAMS: Yeah, I would say to use what you're most comfortable with. 589 00:27:34,820 --> 00:27:37,258 I was a pretty big LaTeX person in college, 590 00:27:37,258 --> 00:27:38,550 and so I was a big fan of that. 591 00:27:38,550 --> 00:27:40,040 And so my resume was used in that. 592 00:27:40,040 --> 00:27:43,040 But I wouldn't recommend like, oh, I'm going to learn some new tool just 593 00:27:43,040 --> 00:27:45,830 for the purpose of creating this resume, since you might end up-- 594 00:27:45,830 --> 00:27:48,300 it might be harder than the tool that you already know. 595 00:27:48,300 --> 00:27:50,822 So I'd recommend just sticking with what you know already. 596 00:27:50,822 --> 00:27:53,780 If you don't know anything yet, even something as simple as Google Docs 597 00:27:53,780 --> 00:27:55,755 can produce a pretty good-looking resume. 598 00:27:55,755 --> 00:27:58,130 DAVID MALAN: And a formatting question, too-- a few folks 599 00:27:58,130 --> 00:28:03,190 have asked about two columns versus one column in the use of color or graphics. 600 00:28:03,190 --> 00:28:04,190 Your thoughts there too? 601 00:28:04,190 --> 00:28:07,800 TOMMY MACWILLIAMS: Yeah, a little hard to give a blanket answer there. 602 00:28:07,800 --> 00:28:11,810 I would say, write the content of your resume first. 603 00:28:11,810 --> 00:28:14,390 The first thing, most important thing is the content, 604 00:28:14,390 --> 00:28:17,480 where you work, highlighting those specific achievements, 605 00:28:17,480 --> 00:28:20,190 listing out those key skills you have. 606 00:28:20,190 --> 00:28:23,570 So do that first, and then try a few different layouts. 607 00:28:23,570 --> 00:28:26,990 I think people with a ton of experience or a lot of content 608 00:28:26,990 --> 00:28:30,015 might land on a different layout than somebody who is just getting 609 00:28:30,015 --> 00:28:31,890 started and doesn't have as much of that yet. 610 00:28:31,890 --> 00:28:36,320 So I would say, try a few things, see what looks best for the content 611 00:28:36,320 --> 00:28:37,430 that you have. 612 00:28:37,430 --> 00:28:39,430 But if your resume is starting to look something 613 00:28:39,430 --> 00:28:41,630 like this, just this wall of text, then I 614 00:28:41,630 --> 00:28:43,940 would take a step back and reconsider. 615 00:28:43,940 --> 00:28:46,190 DAVID MALAN: And perhaps one final question right now, 616 00:28:46,190 --> 00:28:49,730 amalgamated from Harsh and Kyle, who asked questions along the lines 617 00:28:49,730 --> 00:28:54,530 of, should your resume be job-specific or applicable to any role in tech? 618 00:28:54,530 --> 00:28:57,920 And if someone has unrelated experience, for instance, 619 00:28:57,920 --> 00:29:00,740 from chemical engineering, should you, or how should you 620 00:29:00,740 --> 00:29:03,110 include that on a technical resume? 621 00:29:03,110 --> 00:29:06,240 TOMMY MACWILLIAMS: Yeah, that's a really great question. 622 00:29:06,240 --> 00:29:08,000 So I've seen the spectrum here. 623 00:29:08,000 --> 00:29:12,110 When we were at Quora and also at Serenade, 624 00:29:12,110 --> 00:29:15,980 I've seen resumes that are literally like for Serenade, people 625 00:29:15,980 --> 00:29:20,030 who will talk about, explicitly, Serenade, their background, 626 00:29:20,030 --> 00:29:22,880 and why it's the right fit for exactly our company. 627 00:29:22,880 --> 00:29:23,900 I'd say you can do that. 628 00:29:23,900 --> 00:29:24,650 You don't need to. 629 00:29:24,650 --> 00:29:27,350 I think if you're applying to 10, 20 companies, 630 00:29:27,350 --> 00:29:31,550 doing a good job on 20 different resumes is a lot harder than doing 631 00:29:31,550 --> 00:29:33,890 a good job on one resume. 632 00:29:33,890 --> 00:29:38,050 So where I would make it specific is for the role, not the company. 633 00:29:38,050 --> 00:29:40,080 So if you're applying to an engineering role, 634 00:29:40,080 --> 00:29:43,800 try to put as much engineering-related experience as possible. 635 00:29:43,800 --> 00:29:46,860 If you're applying to a design role, and their resume just 636 00:29:46,860 --> 00:29:48,950 has a bunch of backend engineering stuff, 637 00:29:48,950 --> 00:29:50,700 I don't know if that makes a ton of sense. 638 00:29:50,700 --> 00:29:53,280 I'd try to put in some design side projects you've worked on 639 00:29:53,280 --> 00:29:57,750 or courses you've taken or projects you've built. 640 00:29:57,750 --> 00:30:01,590 And then the question around unrelated experience, I'd say it depends. 641 00:30:01,590 --> 00:30:03,930 I think for some people, they've had a career in, 642 00:30:03,930 --> 00:30:06,273 let's say, I think you mentioned chemical engineering, 643 00:30:06,273 --> 00:30:09,190 and they're looking to make a career transition into another industry. 644 00:30:09,190 --> 00:30:11,940 If that's the case, then for sure, show the experience you have, 645 00:30:11,940 --> 00:30:15,987 show the impact you've had at companies, and make it clear to the recruiter, 646 00:30:15,987 --> 00:30:18,570 or make it clear to whoever you're talking with at the company 647 00:30:18,570 --> 00:30:20,460 that you are making a career pivot. 648 00:30:20,460 --> 00:30:22,738 You've worked in this field for some time, 649 00:30:22,738 --> 00:30:24,780 and here's why you're looking to make this pivot, 650 00:30:24,780 --> 00:30:26,490 and here's what you're excited about. 651 00:30:26,490 --> 00:30:28,500 But definitely don't submit a blank resume, 652 00:30:28,500 --> 00:30:32,940 just because the experience isn't exactly in that precise field. 653 00:30:32,940 --> 00:30:36,360 At the same time, I think if you're earlier on in your career, 654 00:30:36,360 --> 00:30:40,372 and you're an undergrad, I wouldn't just put every club you've ever joined 655 00:30:40,372 --> 00:30:42,330 and everything you've ever done on your resume. 656 00:30:42,330 --> 00:30:45,873 I try to keep it focused to the role you're applying to. 657 00:30:45,873 --> 00:30:47,790 So I guess my answer is a little bit different 658 00:30:47,790 --> 00:30:50,275 if you've had a career that's several years, 659 00:30:50,275 --> 00:30:53,400 and you're looking to make a pivot, versus you're just starting to graduate 660 00:30:53,400 --> 00:30:55,470 college and start to break into tech. 661 00:30:55,470 --> 00:30:56,940 DAVID MALAN: We have an infinite supply of questions, 662 00:30:56,940 --> 00:30:59,610 but why don't we let you go on, and I'll weave them in over time. 663 00:30:59,610 --> 00:31:02,568 TOMMY MACWILLIAMS: For sure, and I'm sure it will save time at the end, 664 00:31:02,568 --> 00:31:03,090 as well. 665 00:31:03,090 --> 00:31:04,090 So that's it on resumes. 666 00:31:04,090 --> 00:31:09,220 Like I said, resumes are really just a tool to get your foot in the door. 667 00:31:09,220 --> 00:31:13,390 When I say they're not that important, that's basically what I mean is that. 668 00:31:13,390 --> 00:31:16,640 I've never been in a meeting where we're talking about a candidate and saying, 669 00:31:16,640 --> 00:31:18,598 well, they really didn't do well in interviews, 670 00:31:18,598 --> 00:31:20,440 but their resume font was just so perfect, 671 00:31:20,440 --> 00:31:21,732 we've got to give them the job. 672 00:31:21,732 --> 00:31:23,648 So when I say that they're not that important, 673 00:31:23,648 --> 00:31:26,530 I mean once you're in the door, your resume no longer matters. 674 00:31:26,530 --> 00:31:30,172 Obviously, your experience does, but the specific typeface on your resume 675 00:31:30,172 --> 00:31:31,130 doesn't matter anymore. 676 00:31:31,130 --> 00:31:33,310 So when I say not that important, just to be clear, 677 00:31:33,310 --> 00:31:34,360 I don't mean spend no time on it. 678 00:31:34,360 --> 00:31:36,160 But I mean, that's the extent to which they matter 679 00:31:36,160 --> 00:31:38,118 is that they're getting you into the interview. 680 00:31:38,118 --> 00:31:41,830 They're not going to carry you through the whole interview process. 681 00:31:41,830 --> 00:31:45,030 So next, let's talk about what to do before the interview. 682 00:31:45,030 --> 00:31:48,400 So the first thing I want to talk about is what to expect. 683 00:31:48,400 --> 00:31:52,680 So with timing, it's always better to interview early. 684 00:31:52,680 --> 00:31:55,650 So especially if you're still in school, whether that's 685 00:31:55,650 --> 00:31:59,970 an undergrad or a grad program, try to interview as early as you can. 686 00:31:59,970 --> 00:32:03,150 To put concrete numbers on this, for a summer internship starting 687 00:32:03,150 --> 00:32:07,410 in May or June, people interview as early as the previous summer. 688 00:32:07,410 --> 00:32:12,660 So I've interviewed people in August 2020 for an interview for an internship 689 00:32:12,660 --> 00:32:15,390 starting in May 2021. 690 00:32:15,390 --> 00:32:19,407 I'd say the peak season is around October, November 691 00:32:19,407 --> 00:32:21,990 of that year for that following summer internship or following 692 00:32:21,990 --> 00:32:23,100 full-time opportunity. 693 00:32:23,100 --> 00:32:26,710 So as much as you can, if you can get into that wave, that's great. 694 00:32:26,710 --> 00:32:30,390 If you can't for some reason, something comes up, or coursework is there 695 00:32:30,390 --> 00:32:34,200 and you have to interview in, let's say, February or March 696 00:32:34,200 --> 00:32:37,020 for a role starting in June or May, it's still possible. 697 00:32:37,020 --> 00:32:40,345 But keep in mind that some companies might fill up their internship class, 698 00:32:40,345 --> 00:32:42,720 and it might be harder to get a role once a lot of people 699 00:32:42,720 --> 00:32:44,620 have already accepted their offers there. 700 00:32:44,620 --> 00:32:46,110 So if you can, interview early. 701 00:32:46,110 --> 00:32:48,780 If you can't, it's not the end of the world. 702 00:32:48,780 --> 00:32:52,350 Also, especially if you're in school, plan interviewing into your schedule. 703 00:32:52,350 --> 00:32:55,950 I'm not going to say try to take some easier courses at the same time 704 00:32:55,950 --> 00:32:58,470 you're interviewing, but if you were to do that, that 705 00:32:58,470 --> 00:33:01,710 wouldn't hurt your interview chances. 706 00:33:01,710 --> 00:33:04,170 It can be really hard to just assume interviews and, like, 707 00:33:04,170 --> 00:33:05,730 oh-- an interview isn't just an hour. 708 00:33:05,730 --> 00:33:07,770 You're going to spend a lot of time practicing. 709 00:33:07,770 --> 00:33:09,390 The hour is going to be emotionally draining. 710 00:33:09,390 --> 00:33:11,110 You're going to be exhausted after that. 711 00:33:11,110 --> 00:33:14,550 So just keep in mind that interviewing takes a lot of time, 712 00:33:14,550 --> 00:33:17,370 and don't think of it as just a couple hour-long meetings you 713 00:33:17,370 --> 00:33:19,050 have to worry about. 714 00:33:19,050 --> 00:33:21,260 And the last thing I say is, look for opportunities 715 00:33:21,260 --> 00:33:23,340 that are geared at your experience. 716 00:33:23,340 --> 00:33:26,540 So in particular, if you've only taken a few CS courses, 717 00:33:26,540 --> 00:33:30,870 you're a freshman or sophomore or maybe early on in your CS career, 718 00:33:30,870 --> 00:33:33,560 there's plenty of internship opportunities out there for you, 719 00:33:33,560 --> 00:33:36,770 especially at larger companies like Google, Facebook, Microsoft. 720 00:33:36,770 --> 00:33:39,650 They have programs explicitly designed for people who 721 00:33:39,650 --> 00:33:41,400 just have a few years of experience. 722 00:33:41,400 --> 00:33:43,040 So look out for those. 723 00:33:43,040 --> 00:33:47,030 Don't apply for the senior manager tech lead role 724 00:33:47,030 --> 00:33:48,770 if you only have a year of experience. 725 00:33:48,770 --> 00:33:51,513 Try to find the role that's designed for you. 726 00:33:51,513 --> 00:33:53,930 You can find these just by looking at the job description. 727 00:33:53,930 --> 00:33:56,662 They'll often say, we're looking for three years of experience, 728 00:33:56,662 --> 00:33:58,370 we're looking for 10 years of experience, 729 00:33:58,370 --> 00:34:00,710 we're looking for zero use of experience. 730 00:34:00,710 --> 00:34:05,480 Even if you have 2.8 years of experience, and it says three, 731 00:34:05,480 --> 00:34:06,860 still apply for that. 732 00:34:06,860 --> 00:34:09,568 But if you have two years of experience, and looking for 10, 733 00:34:09,568 --> 00:34:11,360 that's probably not the right role for you. 734 00:34:11,360 --> 00:34:13,940 735 00:34:13,940 --> 00:34:16,520 So next, just a bit on the process. 736 00:34:16,520 --> 00:34:20,260 So every company is going to have a different process, 737 00:34:20,260 --> 00:34:23,980 but these are the things you can probably expect. 738 00:34:23,980 --> 00:34:27,909 So the first is some online coding challenge. 739 00:34:27,909 --> 00:34:30,940 So many companies, as a first step, they'll 740 00:34:30,940 --> 00:34:33,489 send you a link to some site where you can 741 00:34:33,489 --> 00:34:35,230 go on and solve some coding problem. 742 00:34:35,230 --> 00:34:36,670 Maybe it's timed. 743 00:34:36,670 --> 00:34:39,190 Maybe you're allowed to run your code before submitting it. 744 00:34:39,190 --> 00:34:41,840 I've had things that are just like a Google Doc, 745 00:34:41,840 --> 00:34:43,480 and they're like, here just write your code in this Google Doc, 746 00:34:43,480 --> 00:34:45,272 and whenever you're done, just let me know. 747 00:34:45,272 --> 00:34:49,000 I see a pretty wide spectrum here, but that's often a first step. 748 00:34:49,000 --> 00:34:52,570 And they'll be really clear with you around what the time limits are, 749 00:34:52,570 --> 00:34:55,315 if you're allowed to use external resources or not. 750 00:34:55,315 --> 00:34:57,190 And if they're not, just ask whoever gave you 751 00:34:57,190 --> 00:35:00,100 the challenge what the constraints are. 752 00:35:00,100 --> 00:35:01,810 The next is a take-home interview. 753 00:35:01,810 --> 00:35:06,640 So this will usually take the form of, here's some larger project to build. 754 00:35:06,640 --> 00:35:08,620 Maybe you're supposed to build it in two hours, 755 00:35:08,620 --> 00:35:11,260 maybe they're supposed to build it in two days. 756 00:35:11,260 --> 00:35:14,410 It's going to vary, but will usually be a bit more on the practical side, 757 00:35:14,410 --> 00:35:18,730 will be, write a little command line app that takes this as input 758 00:35:18,730 --> 00:35:22,510 and outputs this, or write a little web application with the login 759 00:35:22,510 --> 00:35:24,800 functionality or something like that. 760 00:35:24,800 --> 00:35:27,490 So that's another interview type you might expect. 761 00:35:27,490 --> 00:35:32,080 The technical phone screen I'd say is probably the most common early step 762 00:35:32,080 --> 00:35:33,400 in the interview process. 763 00:35:33,400 --> 00:35:35,920 And this is what will spend the most time on today is technical phone screen 764 00:35:35,920 --> 00:35:38,260 and on-site, where technical phone screen is often, 765 00:35:38,260 --> 00:35:40,720 you'll meet with someone over the phone or over video, 766 00:35:40,720 --> 00:35:43,900 or an engineer or designer or data scientist at that company. 767 00:35:43,900 --> 00:35:46,240 And they'll still do some technical questions together. 768 00:35:46,240 --> 00:35:48,700 We'll ask you to write some code to solve a problem, 769 00:35:48,700 --> 00:35:51,700 and you'll share your screen and write that code. 770 00:35:51,700 --> 00:35:53,560 And then lastly, on-sites-- 771 00:35:53,560 --> 00:35:56,230 pretty similar to technical phone screens often. 772 00:35:56,230 --> 00:35:58,690 Many on-sites are conducted remotely, so you'll just 773 00:35:58,690 --> 00:36:02,380 do this over video, which makes it almost the same as a technical phone 774 00:36:02,380 --> 00:36:04,720 screen, the difference being in an on-site, 775 00:36:04,720 --> 00:36:07,390 you'll probably meet with a wider variety of people, 776 00:36:07,390 --> 00:36:09,310 solve a wider variety of problems. 777 00:36:09,310 --> 00:36:12,310 Maybe you'll do something that's more design-oriented, rather 778 00:36:12,310 --> 00:36:14,560 than just writing code, and we'll go through those. 779 00:36:14,560 --> 00:36:19,870 But these are the four types or four interview settings you can reasonably 780 00:36:19,870 --> 00:36:23,150 expect in the interview process. 781 00:36:23,150 --> 00:36:27,200 So next I want to go through some expectations of you. 782 00:36:27,200 --> 00:36:30,303 So before I give you mine as an interviewer, what I expect of you, 783 00:36:30,303 --> 00:36:31,720 I'll turn it over to the audience. 784 00:36:31,720 --> 00:36:37,100 What do you think your interviewer expects you to do in an interview? 785 00:36:37,100 --> 00:36:39,260 DAVID MALAN: Be honest, says Colleen, Tommy. 786 00:36:39,260 --> 00:36:41,790 Talk, says Jacob. 787 00:36:41,790 --> 00:36:45,330 Communicate well is a theme here too. 788 00:36:45,330 --> 00:36:48,720 Good communication skills to behave professionally, says Aisha. 789 00:36:48,720 --> 00:36:53,010 Be precise, clear communication, being honest, another theme. 790 00:36:53,010 --> 00:36:56,430 Don't say "um" too much, specifically. 791 00:36:56,430 --> 00:36:59,880 Ask questions to clarify, to know enough about the company. 792 00:36:59,880 --> 00:37:02,730 Dress up professionally, being smart, smile, 793 00:37:02,730 --> 00:37:07,530 ask questions, research the company, explain your own projects well. 794 00:37:07,530 --> 00:37:09,847 Good info about the job applying, because-- 795 00:37:09,847 --> 00:37:12,180 TOMMY MACWILLIAMS: Yeah, those are all really good ones. 796 00:37:12,180 --> 00:37:14,670 I think in particular, around communication 797 00:37:14,670 --> 00:37:19,350 is maybe the most important thing, being able to communicate clearly 798 00:37:19,350 --> 00:37:20,770 what you're thinking. 799 00:37:20,770 --> 00:37:24,150 How you're approaching the problem is super, super important. 800 00:37:24,150 --> 00:37:26,650 So I have a few more specific ones here. 801 00:37:26,650 --> 00:37:28,650 So the first thing I'll be expecting you to do-- 802 00:37:28,650 --> 00:37:32,080 and this is related to communication-- is be able to think through a problem. 803 00:37:32,080 --> 00:37:34,650 So the whole point of an interview is that I'm giving you something 804 00:37:34,650 --> 00:37:36,040 that you've never seen before. 805 00:37:36,040 --> 00:37:38,340 That's by design, because what I'm looking 806 00:37:38,340 --> 00:37:42,810 for is understanding how you would think through this new challenge 807 00:37:42,810 --> 00:37:45,360 and how you would tackle some new problem that 808 00:37:45,360 --> 00:37:47,200 came up if we were working together. 809 00:37:47,200 --> 00:37:49,408 So that's the first thing I'd expect, is your ability 810 00:37:49,408 --> 00:37:51,572 to think critically and think through a problem. 811 00:37:51,572 --> 00:37:54,030 Second, maybe this is obvious and maybe why nobody said it, 812 00:37:54,030 --> 00:37:55,030 because it's so obvious. 813 00:37:55,030 --> 00:37:57,480 But be able to write code that works. 814 00:37:57,480 --> 00:38:01,872 Sometimes that code might not have to be exactly correct, depending 815 00:38:01,872 --> 00:38:02,580 on the interview. 816 00:38:02,580 --> 00:38:05,830 Maybe some interviewers are just looking for pseudocode, rather than perfectly 817 00:38:05,830 --> 00:38:06,570 functional code. 818 00:38:06,570 --> 00:38:09,112 Your interviewer will tell you what they're looking for here, 819 00:38:09,112 --> 00:38:11,770 but we're looking for you to be able to write code that works. 820 00:38:11,770 --> 00:38:15,707 I think if I ask a question that you can only describe like, 821 00:38:15,707 --> 00:38:18,540 oh, here's how I would do it, and I said, OK, let's write some code, 822 00:38:18,540 --> 00:38:21,180 and you say, I don't know how-- that's not great. 823 00:38:21,180 --> 00:38:23,263 It happens more often than you might expect. 824 00:38:23,263 --> 00:38:25,680 But being able to actually write the code for the solution 825 00:38:25,680 --> 00:38:27,620 is something I'd expect. 826 00:38:27,620 --> 00:38:30,180 Next thing is I expect you to be able to fix issues. 827 00:38:30,180 --> 00:38:33,450 So oftentimes when you're writing code, there are bugs. 828 00:38:33,450 --> 00:38:35,670 Being able to fix those bugs, and even better 829 00:38:35,670 --> 00:38:40,067 is identifying those bugs yourself, but not relying on the interviewer 830 00:38:40,067 --> 00:38:42,900 to say, OK, here's your code, here are all the things wrong with it, 831 00:38:42,900 --> 00:38:44,667 and here's how it fix them, instead, being 832 00:38:44,667 --> 00:38:46,500 able to identify problems with your own code 833 00:38:46,500 --> 00:38:49,920 and fixing yourself is something I expect. 834 00:38:49,920 --> 00:38:52,060 Reasoning about runtime is really important. 835 00:38:52,060 --> 00:38:56,670 So if I say, OK, this code looks like it works, how fast is it? 836 00:38:56,670 --> 00:38:58,845 Being able to answer that question is important. 837 00:38:58,845 --> 00:39:02,470 You don't have to do this sort of like-- oh, there's always fancy math 838 00:39:02,470 --> 00:39:04,605 that you might want to do or write a proof. 839 00:39:04,605 --> 00:39:07,140 I'm really just looking for, is this linear, 840 00:39:07,140 --> 00:39:10,977 is this polynomial, not anything much more fancy than that. 841 00:39:10,977 --> 00:39:12,810 And the last one, which everybody mentioned, 842 00:39:12,810 --> 00:39:14,520 is communicate really clearly. 843 00:39:14,520 --> 00:39:18,158 So we really expect you to, whether or not you're right or wrong, 844 00:39:18,158 --> 00:39:19,950 be able to communicate what you're thinking 845 00:39:19,950 --> 00:39:22,950 and why you're thinking that way and make sure that I as the interviewer 846 00:39:22,950 --> 00:39:25,520 can understand you. 847 00:39:25,520 --> 00:39:31,200 So next, just some types of interviews that you might run into. 848 00:39:31,200 --> 00:39:34,850 So the first one is the algorithms interview. 849 00:39:34,850 --> 00:39:39,470 So this is an interview where the solution to the problem 850 00:39:39,470 --> 00:39:42,500 might only be like five or 10 lines of code. 851 00:39:42,500 --> 00:39:45,530 But the challenge is figuring out the algorithm 852 00:39:45,530 --> 00:39:48,120 and behind those 10 lines of code. 853 00:39:48,120 --> 00:39:49,970 So oftentimes in the interview, you might 854 00:39:49,970 --> 00:39:54,440 spend 20 or 30 minutes talking through cases together, whiteboarding, 855 00:39:54,440 --> 00:39:55,280 and thinking. 856 00:39:55,280 --> 00:39:57,642 And then once you see the algorithm, the process 857 00:39:57,642 --> 00:40:00,350 of translating that algorithm into code is usually pretty simple, 858 00:40:00,350 --> 00:40:02,570 and you can just do-- and sometimes the interviewer might be like, OK, great. 859 00:40:02,570 --> 00:40:05,820 Let's just go through this really quick, because the interesting part is over, 860 00:40:05,820 --> 00:40:08,750 because you figured out the algorithm. 861 00:40:08,750 --> 00:40:13,460 The opposite of this is a coding interview, where there isn't really 862 00:40:13,460 --> 00:40:15,410 any fancy algorithm or any fancy trick. 863 00:40:15,410 --> 00:40:18,650 It's just like, hey, we're going to write some code to solve a problem. 864 00:40:18,650 --> 00:40:20,930 That code needs to be really clean. 865 00:40:20,930 --> 00:40:24,170 You might be writing 50 to 100 lines of code 866 00:40:24,170 --> 00:40:27,170 and factoring things out into functions, where the code you're writing 867 00:40:27,170 --> 00:40:30,410 might be straightforward, but there are some interesting design challenges, 868 00:40:30,410 --> 00:40:32,490 or how you'll structure the code. 869 00:40:32,490 --> 00:40:35,240 And I will say, with these two, your interviewer will probably not 870 00:40:35,240 --> 00:40:38,855 tell you up front, like, hey, you're in the algorithms interview now. 871 00:40:38,855 --> 00:40:41,480 But many times behind-the-scenes companies actually do do this. 872 00:40:41,480 --> 00:40:44,660 When they design an interview loop or sort of your sequence of interviewers, 873 00:40:44,660 --> 00:40:46,070 they'll say, OK, the first interviewer, you're 874 00:40:46,070 --> 00:40:48,230 going to ask an algorithms question, second interviewer, 875 00:40:48,230 --> 00:40:49,910 you're going to ask a coding question, third interviewer 876 00:40:49,910 --> 00:40:51,420 are you going to ask something else. 877 00:40:51,420 --> 00:40:54,710 So you probably won't be explicitly told this, 878 00:40:54,710 --> 00:40:57,470 but you can probably tell within the first few minutes 879 00:40:57,470 --> 00:40:59,258 which kind of interview type you're in. 880 00:40:59,258 --> 00:41:01,550 But the more important thing here is, for our purposes, 881 00:41:01,550 --> 00:41:04,520 just making you aware that these different types of interviews exist. 882 00:41:04,520 --> 00:41:06,560 If you find yourself writing five lines of code, 883 00:41:06,560 --> 00:41:08,540 and you think you've solved the problem, that might be right. 884 00:41:08,540 --> 00:41:11,373 If you find yourself writing 150 lines of code to solve the problem, 885 00:41:11,373 --> 00:41:14,000 that might be right too. 886 00:41:14,000 --> 00:41:16,820 Next is a practical interview. 887 00:41:16,820 --> 00:41:19,490 So these interviews are intentionally designed 888 00:41:19,490 --> 00:41:21,870 to be more like real world situations. 889 00:41:21,870 --> 00:41:27,118 So rather than whiteboarding some solution to some problem 890 00:41:27,118 --> 00:41:29,910 that you probably wouldn't actually run into on a day-to-day basis, 891 00:41:29,910 --> 00:41:34,640 these will be, write a web application that implements a to do-list. 892 00:41:34,640 --> 00:41:37,400 Maybe you're applying to Asana, which is a software that 893 00:41:37,400 --> 00:41:40,692 helps you make to-do lists, and they ask you to write a to-do list application. 894 00:41:40,692 --> 00:41:43,760 It's much more practical, because it reflects on the day-to-day work 895 00:41:43,760 --> 00:41:45,510 you might actually be doing. 896 00:41:45,510 --> 00:41:48,050 So that's another interview type that exists. 897 00:41:48,050 --> 00:41:50,600 Another one is systems design. 898 00:41:50,600 --> 00:41:55,310 I'll say that these are certainly more common for folks 899 00:41:55,310 --> 00:42:00,230 who are more experienced and have designed scalable large systems before. 900 00:42:00,230 --> 00:42:03,680 But these will often take the shape of, let's say 901 00:42:03,680 --> 00:42:06,890 that you are designing the back end for Google Calendar. 902 00:42:06,890 --> 00:42:08,690 Tell me about how you would do that. 903 00:42:08,690 --> 00:42:12,020 And then the question ends, and it's your job to say, OK well first, 904 00:42:12,020 --> 00:42:13,770 let's talk about the database. 905 00:42:13,770 --> 00:42:15,530 Here's the database tables I'd create. 906 00:42:15,530 --> 00:42:18,785 And now let's talk about the tech stack I would use. 907 00:42:18,785 --> 00:42:20,660 And these are often really, really open-ended 908 00:42:20,660 --> 00:42:23,100 on purpose, because there is absolutely no right answer. 909 00:42:23,100 --> 00:42:26,000 The goal is to just have a conversation with your interviewer 910 00:42:26,000 --> 00:42:29,730 and go through the process of creating some system together. 911 00:42:29,730 --> 00:42:31,782 So I would say, worry about this the least, 912 00:42:31,782 --> 00:42:33,740 especially if you're earlier on in your career, 913 00:42:33,740 --> 00:42:36,573 because these are often targeted more at folks with more experience. 914 00:42:36,573 --> 00:42:40,310 But it's not crazy that you would get one, even earlier on in your career. 915 00:42:40,310 --> 00:42:44,610 So just be aware that it exists, but I'd say a word about it the least. 916 00:42:44,610 --> 00:42:46,860 And then last is a culture interview. 917 00:42:46,860 --> 00:42:49,590 So this will be an interview, at least one interview, 918 00:42:49,590 --> 00:42:51,420 where you'll write zero code. 919 00:42:51,420 --> 00:42:54,195 You'll just talk with somebody-- maybe they're a hiring manager, 920 00:42:54,195 --> 00:42:55,695 maybe they're from HR, or maybe not. 921 00:42:55,695 --> 00:42:59,160 They're just some person that you'd be working with on a day-to-day basis. 922 00:42:59,160 --> 00:43:03,150 And they'll ask you questions about your prior experience, projects 923 00:43:03,150 --> 00:43:06,728 you've worked on in the past, internships you worked on in the past. 924 00:43:06,728 --> 00:43:08,520 Maybe they'll ask a question like, when you 925 00:43:08,520 --> 00:43:11,770 were at this company, what are some things that the company did well 926 00:43:11,770 --> 00:43:13,770 and some things you wish the company did better? 927 00:43:13,770 --> 00:43:16,470 Or what are some of the biggest mistakes you made? 928 00:43:16,470 --> 00:43:19,890 Or what are the biggest things that you learned while you're at this interview? 929 00:43:19,890 --> 00:43:22,830 And so the way to prepare for these is really just 930 00:43:22,830 --> 00:43:25,800 reflect on your own experience before the interview. 931 00:43:25,800 --> 00:43:29,553 Be ready to talk about-- if you worked at Google last summer, 932 00:43:29,553 --> 00:43:30,720 be ready to talk about that. 933 00:43:30,720 --> 00:43:34,020 Talk about the projects you worked on, talk about the obstacles 934 00:43:34,020 --> 00:43:35,850 you overcame, talk about the team. 935 00:43:35,850 --> 00:43:39,010 Don't be caught off guard if someone asks you, how was last summer? 936 00:43:39,010 --> 00:43:42,052 You're like, oh, I don't know, actually haven't really reflected on that. 937 00:43:42,052 --> 00:43:46,320 It's really easy to just take some time reflecting on your previous experience 938 00:43:46,320 --> 00:43:47,980 and also what you're looking for next. 939 00:43:47,980 --> 00:43:50,355 That's sort of the other half of these questions will be, 940 00:43:50,355 --> 00:43:51,870 what do you want out of this role? 941 00:43:51,870 --> 00:43:53,110 What are you looking for? 942 00:43:53,110 --> 00:43:56,010 And remember those questions that we started with, questions to ask yourself 943 00:43:56,010 --> 00:43:56,940 before the interview. 944 00:43:56,940 --> 00:43:58,770 If you're asking yourself all those questions, 945 00:43:58,770 --> 00:44:01,080 you're probably going to be ready for that part of the culture interview. 946 00:44:01,080 --> 00:44:03,705 Because you've already you've picked this company for a reason, 947 00:44:03,705 --> 00:44:05,370 and so you're ready to answer. 948 00:44:05,370 --> 00:44:08,340 DAVID MALAN: Tommy, a good question that came in was from Sara. 949 00:44:08,340 --> 00:44:12,360 How do act if you can't solve a problem or can't write some code? 950 00:44:12,360 --> 00:44:13,862 This scares Sara a lot. 951 00:44:13,862 --> 00:44:15,570 TOMMY MACWILLIAMS: It's a great question. 952 00:44:15,570 --> 00:44:16,450 I've been there. 953 00:44:16,450 --> 00:44:18,950 I think probably everybody has been there. 954 00:44:18,950 --> 00:44:20,700 So I would say that if you get a question, 955 00:44:20,700 --> 00:44:22,440 and you're not sure how to solve it-- 956 00:44:22,440 --> 00:44:25,440 well, I'll say most people when they first get the question are not sure 957 00:44:25,440 --> 00:44:26,140 how to solve it. 958 00:44:26,140 --> 00:44:28,620 And so we'll go through this, but the techniques 959 00:44:28,620 --> 00:44:32,797 are really about thinking out loud, going through your thought process. 960 00:44:32,797 --> 00:44:35,130 You might not be exactly sure, but you can say something 961 00:44:35,130 --> 00:44:38,830 like, OK, well, we know this list is sorted, 962 00:44:38,830 --> 00:44:41,970 so let's think about the different algorithms for searching a list. 963 00:44:41,970 --> 00:44:43,185 There's binary search. 964 00:44:43,185 --> 00:44:44,950 Will binary search work here? 965 00:44:44,950 --> 00:44:45,820 Well, let's see. 966 00:44:45,820 --> 00:44:48,510 Just think out loud like that. 967 00:44:48,510 --> 00:44:51,190 And if you hit a wall-- which you might hit a wall-- 968 00:44:51,190 --> 00:44:54,180 hopefully, your interviewer will be proactive about guiding you 969 00:44:54,180 --> 00:44:55,350 along and giving you hints. 970 00:44:55,350 --> 00:44:57,330 But sometimes you just hit a wall, and your interviewer is just 971 00:44:57,330 --> 00:44:59,622 kind of staring at you, and you can just say, you know, 972 00:44:59,622 --> 00:45:02,250 I'm honestly not sure what to think about next. 973 00:45:02,250 --> 00:45:05,020 Can you give me a hint, or can you help me out? 974 00:45:05,020 --> 00:45:07,350 That's much better than just spinning your wheels 975 00:45:07,350 --> 00:45:10,870 and staring at the wall in silence. 976 00:45:10,870 --> 00:45:11,370 Awesome. 977 00:45:11,370 --> 00:45:14,650 So going back into preparing for interviews, 978 00:45:14,650 --> 00:45:17,610 so definitely don't go into interview cold. 979 00:45:17,610 --> 00:45:20,400 Always do some practice problems beforehand. 980 00:45:20,400 --> 00:45:23,820 The amount of preparation you put into an interview really, really 981 00:45:23,820 --> 00:45:25,862 makes a big difference in your success. 982 00:45:25,862 --> 00:45:28,320 Some people go so far as to say that interviewing is really 983 00:45:28,320 --> 00:45:29,790 just a learned skill. 984 00:45:29,790 --> 00:45:31,232 Nobody is good at it by design. 985 00:45:31,232 --> 00:45:33,940 Everybody just-- the more you practice, the better at it you get. 986 00:45:33,940 --> 00:45:37,420 And it's just the skill that you can have by practicing it. 987 00:45:37,420 --> 00:45:40,390 So we'll definitely say that the more you practice, 988 00:45:40,390 --> 00:45:44,040 the more that is probably going to decrease your stress in the interview, 989 00:45:44,040 --> 00:45:44,700 as well. 990 00:45:44,700 --> 00:45:47,700 Everybody knows that interviewing, it's really stressful. 991 00:45:47,700 --> 00:45:49,470 It's scary, there's a lot of anxiety. 992 00:45:49,470 --> 00:45:52,710 The more you've practiced in advance and the more problems you've seen, 993 00:45:52,710 --> 00:45:54,747 the more times you've been in this situation 994 00:45:54,747 --> 00:45:56,580 with somebody asking you an unknown question 995 00:45:56,580 --> 00:45:58,320 and having to think out loud and type-- 996 00:45:58,320 --> 00:46:00,550 the more you've done that, the more used to it 997 00:46:00,550 --> 00:46:03,090 you get, and hopefully, the less stressful it becomes. 998 00:46:03,090 --> 00:46:05,550 So definitely do a lot of that in advance. 999 00:46:05,550 --> 00:46:08,190 The second thing I do in advance is pick a language 1000 00:46:08,190 --> 00:46:10,560 you're going to interview in, and then do 1001 00:46:10,560 --> 00:46:12,700 all of your practice in that language. 1002 00:46:12,700 --> 00:46:14,460 So let's say that you like Python. 1003 00:46:14,460 --> 00:46:15,570 Great. 1004 00:46:15,570 --> 00:46:17,520 Learn Python really well. 1005 00:46:17,520 --> 00:46:20,730 You shouldn't have to Google, how do I reverse a list in Python, 1006 00:46:20,730 --> 00:46:23,700 or how do I get the length of a list, or how do I create a class. 1007 00:46:23,700 --> 00:46:26,550 If you have to spend any time thinking about that, 1008 00:46:26,550 --> 00:46:28,170 it just create stress for you. 1009 00:46:28,170 --> 00:46:30,150 You just want to have this totally down cold. 1010 00:46:30,150 --> 00:46:33,900 Don't even worry about how to create a set in Python, because you've just 1011 00:46:33,900 --> 00:46:35,520 memorized it in advance. 1012 00:46:35,520 --> 00:46:39,578 And I would say choose one language, maybe two, for some reason, 1013 00:46:39,578 --> 00:46:42,120 if maybe you want a backend language and a frontend language. 1014 00:46:42,120 --> 00:46:44,040 But you should never be in a situation where 1015 00:46:44,040 --> 00:46:47,908 an interviewer asks you a question, and your first reaction is, what language 1016 00:46:47,908 --> 00:46:49,200 do I want to use to solve this? 1017 00:46:49,200 --> 00:46:52,275 Just have this down already and be ready with a language. 1018 00:46:52,275 --> 00:46:55,440 1019 00:46:55,440 --> 00:47:00,920 So some things that you should know how to do in whatever language you pick-- 1020 00:47:00,920 --> 00:47:02,252 one is create a function. 1021 00:47:02,252 --> 00:47:05,210 Again, this sounds obvious, but you'd be surprised how many people I've 1022 00:47:05,210 --> 00:47:06,950 interviewed who the first thing they asked me 1023 00:47:06,950 --> 00:47:08,540 was, how do I create a function again? 1024 00:47:08,540 --> 00:47:10,415 Or they had to Google how to make a function. 1025 00:47:10,415 --> 00:47:12,920 You should just know this in advance. 1026 00:47:12,920 --> 00:47:15,500 Similarly, for defining a class, you might not 1027 00:47:15,500 --> 00:47:17,300 use a lot of object-oriented programming, 1028 00:47:17,300 --> 00:47:20,050 but sometimes it can be helpful, depending on what language you're 1029 00:47:20,050 --> 00:47:22,190 using, to have a class to represent some object 1030 00:47:22,190 --> 00:47:24,090 or represent some collection of data. 1031 00:47:24,090 --> 00:47:27,050 So just know how to do that in advance. 1032 00:47:27,050 --> 00:47:29,360 A lot of interview questions are string based. 1033 00:47:29,360 --> 00:47:33,500 And so when I say work with strings, I mean how to create a string, 1034 00:47:33,500 --> 00:47:36,050 how to concatenate strings, how to index into a string, 1035 00:47:36,050 --> 00:47:39,710 how to make a string uppercase or lowercase, how to get a sub-string. 1036 00:47:39,710 --> 00:47:43,340 All of these different standard library operations with strings, 1037 00:47:43,340 --> 00:47:44,510 just know them. 1038 00:47:44,510 --> 00:47:48,472 Again, the more you have to think about, like, is it dot size or count, 1039 00:47:48,472 --> 00:47:50,180 it's just going to make you more nervous. 1040 00:47:50,180 --> 00:47:51,972 You're going to create stress for yourself. 1041 00:47:51,972 --> 00:47:53,930 And knowing all the stuff down cold in advance 1042 00:47:53,930 --> 00:47:57,510 can just make your interview go a lot better. 1043 00:47:57,510 --> 00:48:00,230 Same thing with lists-- many, many interview questions have, 1044 00:48:00,230 --> 00:48:02,330 take the form, you're given a list. 1045 00:48:02,330 --> 00:48:06,170 Those are the first four words of many interview questions are, 1046 00:48:06,170 --> 00:48:07,130 you're given a list. 1047 00:48:07,130 --> 00:48:09,920 And so just being able to be aware of all these different list 1048 00:48:09,920 --> 00:48:12,530 operations like list slicing or concatenation 1049 00:48:12,530 --> 00:48:14,990 or removing indexes or pushing and popping, 1050 00:48:14,990 --> 00:48:17,990 all of those operations you might do to a list, 1051 00:48:17,990 --> 00:48:20,750 you don't want to be asking yourself, is it push or is it append? 1052 00:48:20,750 --> 00:48:21,410 I forget. 1053 00:48:21,410 --> 00:48:23,680 Just know that. 1054 00:48:23,680 --> 00:48:24,980 Same thing with trees-- 1055 00:48:24,980 --> 00:48:26,980 another really, really common interview question 1056 00:48:26,980 --> 00:48:30,550 is you're given a binary tree, you're given some sort of tree, 1057 00:48:30,550 --> 00:48:32,510 just do some sort of traversal on it. 1058 00:48:32,510 --> 00:48:35,830 So being able to write depth-first search or breadth-first search, 1059 00:48:35,830 --> 00:48:38,740 even create a tree in whatever language you're in, 1060 00:48:38,740 --> 00:48:41,948 just knowing how to do that in advance is going to save you a lot of trouble. 1061 00:48:41,948 --> 00:48:43,700 1062 00:48:43,700 --> 00:48:46,338 So next around complexity-- 1063 00:48:46,338 --> 00:48:48,130 we mentioned that many interviews will just 1064 00:48:48,130 --> 00:48:51,160 ask you after you've written code, what's the complexity of this code? 1065 00:48:51,160 --> 00:48:52,765 It's pretty rare. 1066 00:48:52,765 --> 00:48:54,640 I'll say it's not impossible, but pretty rare 1067 00:48:54,640 --> 00:48:58,720 that the complexity they're looking for is n 1068 00:48:58,720 --> 00:49:02,770 cubed plus n factorial over something. 1069 00:49:02,770 --> 00:49:06,370 It's usually just going to be, is it linear, is it polynomial, 1070 00:49:06,370 --> 00:49:08,380 is it exponential? 1071 00:49:08,380 --> 00:49:10,160 And that's probably it. 1072 00:49:10,160 --> 00:49:13,630 So being able to have these down cold is really, really helpful, 1073 00:49:13,630 --> 00:49:17,320 whether something is constant, log, linear, polynomial, or exponential. 1074 00:49:17,320 --> 00:49:21,130 Just knowing these five and being able to identify, 1075 00:49:21,130 --> 00:49:23,200 is your code one of these five, that's going 1076 00:49:23,200 --> 00:49:26,470 to get you through the vast majority of what interviewers 1077 00:49:26,470 --> 00:49:31,840 are looking for when they say, what's the complexity of your solution? 1078 00:49:31,840 --> 00:49:35,040 So next thing I'll say is to build up your toolbox. 1079 00:49:35,040 --> 00:49:37,890 So many, many, many interview problems are 1080 00:49:37,890 --> 00:49:43,720 kind of fancy ways of phrasing or framing the same few core concepts. 1081 00:49:43,720 --> 00:49:44,740 So here are a few. 1082 00:49:44,740 --> 00:49:47,370 So one is recursion or divide and conquer, 1083 00:49:47,370 --> 00:49:49,800 basically taking some large problem, being 1084 00:49:49,800 --> 00:49:52,680 able to split it up into smaller subproblems 1085 00:49:52,680 --> 00:49:54,570 and then solving those smaller subproblems. 1086 00:49:54,570 --> 00:49:57,888 So as you're doing practice problems, be really familiar with recursion. 1087 00:49:57,888 --> 00:50:00,180 And I think recursion is something that for many people 1088 00:50:00,180 --> 00:50:02,620 is really scary, especially if you're early on. 1089 00:50:02,620 --> 00:50:04,590 So if it is scary for you, just practice it. 1090 00:50:04,590 --> 00:50:08,578 You don't want to be caught in a situation where you get a problem that 1091 00:50:08,578 --> 00:50:10,620 probably should be solved recursively, but you're 1092 00:50:10,620 --> 00:50:12,270 uncomfortable with recursion. 1093 00:50:12,270 --> 00:50:15,662 So the more you practice it, the more comfortable you're going to be. 1094 00:50:15,662 --> 00:50:17,370 Definitely don't be put in that situation 1095 00:50:17,370 --> 00:50:21,330 because you just didn't want to practice recursion. 1096 00:50:21,330 --> 00:50:22,920 Next one is graph searches. 1097 00:50:22,920 --> 00:50:25,980 We mentioned this with trees, but many problems just 1098 00:50:25,980 --> 00:50:29,940 reduced to, just model this thing as a tree or a graph, 1099 00:50:29,940 --> 00:50:31,860 and then just do a search over that tree. 1100 00:50:31,860 --> 00:50:34,572 So being able to practice writing depth-first search 1101 00:50:34,572 --> 00:50:37,030 or breadth-first search, just do it a few times in advance. 1102 00:50:37,030 --> 00:50:39,370 Make sure you're comfortable with it. 1103 00:50:39,370 --> 00:50:40,960 Greedy algorithms is another one. 1104 00:50:40,960 --> 00:50:43,627 As you're sort of looking around at interview practice problems, 1105 00:50:43,627 --> 00:50:45,428 this is often the category, so just being 1106 00:50:45,428 --> 00:50:48,220 able to practice these and recognize when something might be there. 1107 00:50:48,220 --> 00:50:50,080 We talked about strings. 1108 00:50:50,080 --> 00:50:53,630 Many problems are just string manipulations at the end of the day. 1109 00:50:53,630 --> 00:50:55,510 So really, as you're practicing, you should 1110 00:50:55,510 --> 00:50:59,590 be building up this toolbox as you go and just 1111 00:50:59,590 --> 00:51:01,798 be familiar with all these concepts. 1112 00:51:01,798 --> 00:51:04,090 And searching and sorting is another really common one. 1113 00:51:04,090 --> 00:51:05,632 How do I sort this array efficiently? 1114 00:51:05,632 --> 00:51:09,110 Given assorted array, how do I search it efficiently? 1115 00:51:09,110 --> 00:51:11,980 And dynamic programming-- this one's a little more advanced. 1116 00:51:11,980 --> 00:51:14,480 But if you're taking algorithms classes, dynamic programming 1117 00:51:14,480 --> 00:51:18,350 is basically a way to speed up algorithms and sort of cache 1118 00:51:18,350 --> 00:51:22,600 the results of problems as you're solving them. 1119 00:51:22,600 --> 00:51:26,350 So some tools you have at your disposal-- 1120 00:51:26,350 --> 00:51:28,800 so when you get a problem, you should really think about, 1121 00:51:28,800 --> 00:51:30,000 what tools do I have? 1122 00:51:30,000 --> 00:51:32,070 What core algorithms do I know? 1123 00:51:32,070 --> 00:51:34,200 What are some core data structures that I know? 1124 00:51:34,200 --> 00:51:38,130 And then try to pattern match which of these data structures or algorithms 1125 00:51:38,130 --> 00:51:39,880 fits this problem. 1126 00:51:39,880 --> 00:51:41,820 So one is arrays or linked lists. 1127 00:51:41,820 --> 00:51:45,030 Be really comfortable using arrays, understanding what a linked list is, 1128 00:51:45,030 --> 00:51:49,110 and understanding what problems should fit into a linked list or an array. 1129 00:51:49,110 --> 00:51:50,742 Hash table is another super common one. 1130 00:51:50,742 --> 00:51:52,950 You can sort of ask yourself, OK, given this problem, 1131 00:51:52,950 --> 00:51:55,000 can I model this as a hash table? 1132 00:51:55,000 --> 00:51:58,320 Does that, therefore, instantly speed up my runtime? 1133 00:51:58,320 --> 00:51:59,970 Binary search is another one. 1134 00:51:59,970 --> 00:52:02,040 Many, many, many problems that take the form 1135 00:52:02,040 --> 00:52:06,540 of find X, or given a list, look for something, 1136 00:52:06,540 --> 00:52:08,498 can be reduced to a binary search problem. 1137 00:52:08,498 --> 00:52:09,540 So just be aware of that. 1138 00:52:09,540 --> 00:52:13,350 And maybe that should be your first check if you get a search problem is, 1139 00:52:13,350 --> 00:52:15,763 can I model this as binary search? 1140 00:52:15,763 --> 00:52:17,430 Shortest path algorithms or another one. 1141 00:52:17,430 --> 00:52:19,513 I think given that we mentioned these a few times. 1142 00:52:19,513 --> 00:52:20,590 We've given some tree. 1143 00:52:20,590 --> 00:52:23,280 How do I search through that tree efficiently? 1144 00:52:23,280 --> 00:52:26,190 And memoization, which is similar to dynamic programming, 1145 00:52:26,190 --> 00:52:31,140 but once I've solved the problem, can I reuse that solution 1146 00:52:31,140 --> 00:52:32,970 to solve some larger problem? 1147 00:52:32,970 --> 00:52:37,530 And we'll go into some examples of this once you get into the mock interviews. 1148 00:52:37,530 --> 00:52:40,320 So some more general advice-- as you're practicing, 1149 00:52:40,320 --> 00:52:44,220 try to really simulate the environment accurately. 1150 00:52:44,220 --> 00:52:47,818 So something that I know I do when I'm practicing is I look at a problem, 1151 00:52:47,818 --> 00:52:50,110 and I'm like, oh, yeah, I think I can basically see it. 1152 00:52:50,110 --> 00:52:53,402 And then I'll look at the answer and be like, oh, yeah, I could have done that. 1153 00:52:53,402 --> 00:52:56,130 But then if I tried to force myself not to look at the answer, 1154 00:52:56,130 --> 00:52:58,530 I'm like, oh, actually I don't see it at all. 1155 00:52:58,530 --> 00:53:01,920 So really, really simulate that environment accurately. 1156 00:53:01,920 --> 00:53:04,140 If you know your interview is going to be 45 minutes, 1157 00:53:04,140 --> 00:53:06,150 put a 45-minute timer on your interview. 1158 00:53:06,150 --> 00:53:09,750 If you know the interview is going to be on a coder pad, 1159 00:53:09,750 --> 00:53:12,990 or it's going to be on a whiteboard, practice on a whiteboard or pen 1160 00:53:12,990 --> 00:53:14,400 and paper. 1161 00:53:14,400 --> 00:53:17,430 And as you're doing that practicing, look for patterns. 1162 00:53:17,430 --> 00:53:18,460 Everybody's different. 1163 00:53:18,460 --> 00:53:20,295 Some people are really great at recursion, 1164 00:53:20,295 --> 00:53:21,670 some people are really bad at it. 1165 00:53:21,670 --> 00:53:23,730 So if you've done 10 practice problems, and you 1166 00:53:23,730 --> 00:53:26,850 found that you got them all right except for the three recursion ones, 1167 00:53:26,850 --> 00:53:28,800 go practice more recursion. 1168 00:53:28,800 --> 00:53:31,950 Everybody is going to be different in what they're skilled and not skilled 1169 00:53:31,950 --> 00:53:35,225 at, and so really look for patterns in your own approach. 1170 00:53:35,225 --> 00:53:37,350 And then lastly, if you can, practice with friends. 1171 00:53:37,350 --> 00:53:40,200 It can be fun to go through practice interviews 1172 00:53:40,200 --> 00:53:43,200 with you being the interviewer or your friend being the interviewer 1173 00:53:43,200 --> 00:53:44,910 and you going through that problem. 1174 00:53:44,910 --> 00:53:47,010 What this does is just simulates the environment 1175 00:53:47,010 --> 00:53:49,350 and makes it even more familiar, so that once you're 1176 00:53:49,350 --> 00:53:52,110 in that situation of being on a real video call, 1177 00:53:52,110 --> 00:53:54,120 writing real code on a Google doc, it's not 1178 00:53:54,120 --> 00:53:56,578 the first time you've done that, you're sort of used to it, 1179 00:53:56,578 --> 00:53:59,100 it's really familiar to you. 1180 00:53:59,100 --> 00:54:01,770 So now some tips for during the interview. 1181 00:54:01,770 --> 00:54:05,280 So all of that was what you should do in advance, preparing for the interview. 1182 00:54:05,280 --> 00:54:09,110 And so now we're going to jump into, the Google Meet just started, 1183 00:54:09,110 --> 00:54:12,630 the Zoom call just started, what do we do? 1184 00:54:12,630 --> 00:54:15,030 So throughout this, what I really, really 1185 00:54:15,030 --> 00:54:19,380 want to emphasize is that the most important thing for your interview 1186 00:54:19,380 --> 00:54:22,080 is your process, not your output. 1187 00:54:22,080 --> 00:54:27,000 I've been in many interviews where the person did not get the correct answer, 1188 00:54:27,000 --> 00:54:31,080 but we hired them, and many interviews where the person did 1189 00:54:31,080 --> 00:54:33,730 get the correct answer, and we did not hire them. 1190 00:54:33,730 --> 00:54:37,260 And the reason was, their process was significantly more important. 1191 00:54:37,260 --> 00:54:40,500 If you can demonstrate that you're thinking really critically 1192 00:54:40,500 --> 00:54:43,350 and that you're able to reason through a problem 1193 00:54:43,350 --> 00:54:46,740 and find issues with your solution and optimize it, 1194 00:54:46,740 --> 00:54:49,440 even if you don't get to a perfectly correct answer, 1195 00:54:49,440 --> 00:54:53,460 that's so much more important than somebody who isn't able to communicate, 1196 00:54:53,460 --> 00:54:55,560 who isn't able to think critically, but is 1197 00:54:55,560 --> 00:54:58,680 able to write correct code just because they've seen the problem before, 1198 00:54:58,680 --> 00:54:59,430 or they got lucky. 1199 00:54:59,430 --> 00:55:01,138 Or maybe they did understand the problem, 1200 00:55:01,138 --> 00:55:03,150 but their communication wasn't there, and so 1201 00:55:03,150 --> 00:55:05,740 it isn't something that you want to hire onto your team. 1202 00:55:05,740 --> 00:55:07,740 So throughout all this, really, really emphasize 1203 00:55:07,740 --> 00:55:11,080 that it's not the most important thing to get the perfect answer, 1204 00:55:11,080 --> 00:55:12,120 but obviously helps. 1205 00:55:12,120 --> 00:55:17,180 But your process is so much more important than what you produce. 1206 00:55:17,180 --> 00:55:18,920 So the interview will start. 1207 00:55:18,920 --> 00:55:21,620 The interview won't start with just a problem on the board, 1208 00:55:21,620 --> 00:55:24,590 and someone will say go, but have the interviewer there. 1209 00:55:24,590 --> 00:55:27,590 They'll probably introduce themselves and ask you to introduce yourself. 1210 00:55:27,590 --> 00:55:30,465 Something I like to do for the call starts to just take a deep breath 1211 00:55:30,465 --> 00:55:31,310 and relax. 1212 00:55:31,310 --> 00:55:34,730 Tell yourself that it's going to be OK and that every interview is stressful 1213 00:55:34,730 --> 00:55:36,500 and everybody hates them. 1214 00:55:36,500 --> 00:55:38,660 So take a deep breath, relax. 1215 00:55:38,660 --> 00:55:41,150 Have an intro prepared, just like a minute or two, 1216 00:55:41,150 --> 00:55:45,830 like, hi, I'm Tommy, originally from Boston, worked at Quora for six 1217 00:55:45,830 --> 00:55:48,898 years on back end, looking for my next role, 1218 00:55:48,898 --> 00:55:50,690 looking to transition into a frontend role, 1219 00:55:50,690 --> 00:55:52,565 because I want to have a lot of impact there, 1220 00:55:52,565 --> 00:55:54,890 and I think that space is really interesting right now. 1221 00:55:54,890 --> 00:55:55,520 Done. 1222 00:55:55,520 --> 00:55:57,562 It doesn't have to be super fancy, but if someone 1223 00:55:57,562 --> 00:55:59,810 says, hi, introduce yourself, and you're scrambling, 1224 00:55:59,810 --> 00:56:01,767 and you don't have an introduction ready, 1225 00:56:01,767 --> 00:56:03,600 it's getting yourself off on the wrong foot. 1226 00:56:03,600 --> 00:56:05,402 So just have something ready. 1227 00:56:05,402 --> 00:56:08,360 They might also ask you tell me about the recent project you worked on. 1228 00:56:08,360 --> 00:56:12,590 Have a quick three minutes ready to go there, but don't ramble. 1229 00:56:12,590 --> 00:56:15,110 This is meant to take three to five minutes, 1230 00:56:15,110 --> 00:56:16,935 just make sure everybody feels comfortable. 1231 00:56:16,935 --> 00:56:20,060 So if you're introducing yourself for 30 minutes, which I've had people do, 1232 00:56:20,060 --> 00:56:21,380 you're probably doing it wrong. 1233 00:56:21,380 --> 00:56:23,940 1234 00:56:23,940 --> 00:56:25,800 And then you'll get the problem. 1235 00:56:25,800 --> 00:56:28,790 So after the intros, the interviewer will give you 1236 00:56:28,790 --> 00:56:31,130 the problem that you're going to solve. 1237 00:56:31,130 --> 00:56:32,430 First thing-- don't panic. 1238 00:56:32,430 --> 00:56:33,680 You're going to get a problem. 1239 00:56:33,680 --> 00:56:35,930 You're probably not going to know the solution off the top of your head. 1240 00:56:35,930 --> 00:56:36,980 That's expected. 1241 00:56:36,980 --> 00:56:38,600 Don't freak out. 1242 00:56:38,600 --> 00:56:42,980 If you have seen the problem before, tell your interviewer that. 1243 00:56:42,980 --> 00:56:48,500 So maybe you just practiced some palindrome problem on LeetCode 1244 00:56:48,500 --> 00:56:51,140 last night, and your interviewer says, given a string, 1245 00:56:51,140 --> 00:56:52,370 tell me if it's a palindrome. 1246 00:56:52,370 --> 00:56:54,110 Just tell them if you've seen it. 1247 00:56:54,110 --> 00:56:57,590 Or if you've seen something similar, just say, oh, yeah, this 1248 00:56:57,590 --> 00:57:01,488 was one of the problems I practiced last week, so I have seen this one before. 1249 00:57:01,488 --> 00:57:03,530 They might say, OK, great, thanks for telling me. 1250 00:57:03,530 --> 00:57:04,610 Let's solve a different one. 1251 00:57:04,610 --> 00:57:05,810 They might say, OK, that's fine. 1252 00:57:05,810 --> 00:57:06,935 Let's just solve it anyway. 1253 00:57:06,935 --> 00:57:09,660 Even if you've seen it before, I still want to see your approach. 1254 00:57:09,660 --> 00:57:11,910 It's up to the interviewer what they want to do there. 1255 00:57:11,910 --> 00:57:15,590 But the thing to not do is be dishonest. 1256 00:57:15,590 --> 00:57:18,320 I catch people all the time being dishonest. 1257 00:57:18,320 --> 00:57:22,160 One way to get caught is we sometimes at an on-site, 1258 00:57:22,160 --> 00:57:24,372 two interviewers talking to the same person 1259 00:57:24,372 --> 00:57:26,330 will ask the same question, because they forgot 1260 00:57:26,330 --> 00:57:27,650 to share what questions they asked. 1261 00:57:27,650 --> 00:57:29,300 And then the second time, the person would be like, oh, 1262 00:57:29,300 --> 00:57:31,133 I haven't seen this before, let me solve it. 1263 00:57:31,133 --> 00:57:33,350 It's just an instant rejection. 1264 00:57:33,350 --> 00:57:35,302 Unless you're an Academy Award winning actor, 1265 00:57:35,302 --> 00:57:37,010 you'll probably get caught trying to act. 1266 00:57:37,010 --> 00:57:38,270 So just be honest. 1267 00:57:38,270 --> 00:57:41,150 Don't try to do anything sneaky here. 1268 00:57:41,150 --> 00:57:44,210 Just let your interviewer know if you've seen the problem. 1269 00:57:44,210 --> 00:57:46,280 After you get the problem-- let's say you've 1270 00:57:46,280 --> 00:57:47,867 disclosed if you've seen it before. 1271 00:57:47,867 --> 00:57:51,200 After that, the first thing you probably want to do is ask clarifying questions. 1272 00:57:51,200 --> 00:57:56,010 Really good clarifying questions are of the form, OK, so let me just be clear. 1273 00:57:56,010 --> 00:57:58,490 So if this was the input, then this would be my output? 1274 00:57:58,490 --> 00:58:00,070 And they'll say, yes, it is. 1275 00:58:00,070 --> 00:58:00,920 You say, OK, great. 1276 00:58:00,920 --> 00:58:05,100 You're on the same page, you've understood the problem. 1277 00:58:05,100 --> 00:58:08,223 Then as you're solving it, always think out loud. 1278 00:58:08,223 --> 00:58:10,140 You should basically, as an interviewer, never 1279 00:58:10,140 --> 00:58:15,270 be silent for more than like 30 seconds or 60 seconds at a time. 1280 00:58:15,270 --> 00:58:18,480 It's going to feel really weird to constantly just be thinking out loud, 1281 00:58:18,480 --> 00:58:22,170 because that's not how most developers or day scientists or designers think. 1282 00:58:22,170 --> 00:58:25,230 They just think in their head and not speaking. 1283 00:58:25,230 --> 00:58:27,300 Your interviewer will expect you to do this. 1284 00:58:27,300 --> 00:58:29,590 It will feel weird if you've never done it before, 1285 00:58:29,590 --> 00:58:32,418 but it is what you're supposed to do. 1286 00:58:32,418 --> 00:58:35,460 Sometimes you might say, OK, do you mind if I just take a minute to think 1287 00:58:35,460 --> 00:58:37,100 or draw something out on a piece of paper? 1288 00:58:37,100 --> 00:58:38,392 The interviewer will say, sure. 1289 00:58:38,392 --> 00:58:41,208 But if you're sitting there in silence for five minutes 1290 00:58:41,208 --> 00:58:43,500 typing away at your keyboard and not making much sense, 1291 00:58:43,500 --> 00:58:46,110 your interview is not going well. 1292 00:58:46,110 --> 00:58:49,620 If you can, try talking through multiple possible approaches. 1293 00:58:49,620 --> 00:58:51,960 Usually when you're given a problem, you might have 1294 00:58:51,960 --> 00:58:53,962 a couple ideas for how to solve it. 1295 00:58:53,962 --> 00:58:55,170 And talk through all of them. 1296 00:58:55,170 --> 00:58:57,003 You can say, OK, I have a couple ideas here. 1297 00:58:57,003 --> 00:59:00,780 One idea is to build a graph that has these as nodes. 1298 00:59:00,780 --> 00:59:03,720 Another idea would be to create a hash table, where this is the key, 1299 00:59:03,720 --> 00:59:04,800 and this is the value. 1300 00:59:04,800 --> 00:59:06,300 Sort of explain it out loud. 1301 00:59:06,300 --> 00:59:09,660 Your interviewer is probably going to help you here and say, OK, yeah, 1302 00:59:09,660 --> 00:59:10,753 those both might work. 1303 00:59:10,753 --> 00:59:12,420 If I were you, I'd go at the second one. 1304 00:59:12,420 --> 00:59:14,820 You can say, OK, great, now I'm going to go with the second one. 1305 00:59:14,820 --> 00:59:16,800 You're sort of making it more of a conversation 1306 00:59:16,800 --> 00:59:20,880 and giving your interviewer an opportunity to help you. 1307 00:59:20,880 --> 00:59:25,170 Many folks are sort of visual folks, so feel free to draw a diagram. 1308 00:59:25,170 --> 00:59:27,120 Even if you're doing this over video, having 1309 00:59:27,120 --> 00:59:29,250 a little whiteboard or a piece of paper handy, 1310 00:59:29,250 --> 00:59:31,300 that can be helpful if you're a visual person. 1311 00:59:31,300 --> 00:59:35,020 So if you want to draw the diagram, hold it up to the webcam if you want, 1312 00:59:35,020 --> 00:59:37,710 or not, depending on what the situation is. 1313 00:59:37,710 --> 00:59:42,030 But have the supplies ready if you think you'll need them. 1314 00:59:42,030 --> 00:59:43,860 Then after you've got the problem, you've 1315 00:59:43,860 --> 00:59:46,890 articulated some solutions, what you really want to do 1316 00:59:46,890 --> 00:59:49,410 is try to pattern match. 1317 00:59:49,410 --> 00:59:53,160 We mentioned that most interview problems reduce down 1318 00:59:53,160 --> 00:59:55,740 into a really small number of core concepts 1319 00:59:55,740 --> 00:59:58,950 like search problems, strings, graph problems. 1320 00:59:58,950 --> 01:00:03,238 So try to pattern match against what you know to what 1321 01:00:03,238 --> 01:00:04,780 you think this problem is getting at. 1322 01:00:04,780 --> 01:00:07,320 So for instance, maybe someone's described something where 1323 01:00:07,320 --> 01:00:09,487 you're searching for something that could 1324 01:00:09,487 --> 01:00:11,820 be a bunch of different possibilities, ask yourself, OK, 1325 01:00:11,820 --> 01:00:15,060 could we formulate that as a search? 1326 01:00:15,060 --> 01:00:18,060 Or maybe somebody has described some problem, and you're like, OK, well, 1327 01:00:18,060 --> 01:00:21,150 maybe there's some recursion here that I can formulate, 1328 01:00:21,150 --> 01:00:23,010 or maybe binary search is applicable. 1329 01:00:23,010 --> 01:00:26,400 But take all those things we talked about earlier in your toolbox 1330 01:00:26,400 --> 01:00:31,320 like lists, strings, trees, hash tables, and just go through them in your head. 1331 01:00:31,320 --> 01:00:32,580 Does a hash table apply here? 1332 01:00:32,580 --> 01:00:34,050 Does a list apply here? 1333 01:00:34,050 --> 01:00:35,745 Does a tree apply here? 1334 01:00:35,745 --> 01:00:37,620 Hopefully, the answer to one of those is yes, 1335 01:00:37,620 --> 01:00:42,000 and that can really help kick start your solution and get you off the ground. 1336 01:00:42,000 --> 01:00:45,420 And then you sort of figure out, why is it a graph problem, 1337 01:00:45,420 --> 01:00:47,670 or how is this different than a standard graph search? 1338 01:00:47,670 --> 01:00:51,390 But it can help get you to a starting point for your solution. 1339 01:00:51,390 --> 01:00:55,302 Rather than trying to invent some new algorithm on the spot or derive 1340 01:00:55,302 --> 01:00:58,260 something totally new in the spot, pattern match against what you know. 1341 01:00:58,260 --> 01:01:01,427 And you know a lot, because you went through all of the toolbox and prep you 1342 01:01:01,427 --> 01:01:04,170 should be doing in advance. 1343 01:01:04,170 --> 01:01:09,060 As you're writing up your solution, try to write general code 1344 01:01:09,060 --> 01:01:10,470 before really specific code. 1345 01:01:10,470 --> 01:01:15,630 And what I mean by that is, let's say that your interview problem is, write 1346 01:01:15,630 --> 01:01:17,340 a function to compute a factorial. 1347 01:01:17,340 --> 01:01:19,780 What some people do as their first instinct is they say, 1348 01:01:19,780 --> 01:01:23,280 well, I know the factorial of 3 is 6. 1349 01:01:23,280 --> 01:01:25,980 So I'm going to say if input equals 3, return 6. 1350 01:01:25,980 --> 01:01:28,770 And then they come up with like three or four corner cases first. 1351 01:01:28,770 --> 01:01:31,080 I would say, don't do that. 1352 01:01:31,080 --> 01:01:33,060 That code is probably not going to last-- 1353 01:01:33,060 --> 01:01:34,680 you're going to end up deleting it. 1354 01:01:34,680 --> 01:01:37,620 But it can also sometimes create this mental block 1355 01:01:37,620 --> 01:01:40,260 where you fail to see this general solution, 1356 01:01:40,260 --> 01:01:43,930 because you're zoomed in on a small number of cases you know work. 1357 01:01:43,930 --> 01:01:48,030 So try to think about this generalized solution, and then find corner cases, 1358 01:01:48,030 --> 01:01:50,370 rather than enumerate all the possible corner cases 1359 01:01:50,370 --> 01:01:53,890 and then try to find some general solution. 1360 01:01:53,890 --> 01:01:58,210 For the most part, too, if it feels like your solution is really complicated, 1361 01:01:58,210 --> 01:02:01,900 like it's got a bunch of corner cases and a bunch of branching and four 1362 01:02:01,900 --> 01:02:05,260 different helper functions, if it just feels pretty complicated, 1363 01:02:05,260 --> 01:02:09,502 it probably is, and there probably is a simpler solution. 1364 01:02:09,502 --> 01:02:11,710 Sometimes there's not, and it's kind of hard to tell, 1365 01:02:11,710 --> 01:02:15,010 but your interviewer is probably going to be there asking you to simplify it, 1366 01:02:15,010 --> 01:02:16,360 or maybe there's a better way. 1367 01:02:16,360 --> 01:02:19,552 But just as a heuristic for yourself, if you're looking at your code 1368 01:02:19,552 --> 01:02:22,010 and you're like, wow, that's a lot, it feels really messy-- 1369 01:02:22,010 --> 01:02:24,135 it's not because like, oh, the problem is so hard-- 1370 01:02:24,135 --> 01:02:27,860 it's probably because your solution is overly complicated. 1371 01:02:27,860 --> 01:02:31,440 To get out a question that we asked earlier, if you get stuck, 1372 01:02:31,440 --> 01:02:32,690 ask for help. 1373 01:02:32,690 --> 01:02:35,992 It's much better to say, honestly, I'm a little bit stuck here. 1374 01:02:35,992 --> 01:02:36,950 Can you give me a hint? 1375 01:02:36,950 --> 01:02:38,742 Or can you point me in the right direction? 1376 01:02:38,742 --> 01:02:42,590 Saying that is so much better than just staring at a wall for 30 minutes 1377 01:02:42,590 --> 01:02:44,330 and getting nowhere on the problem. 1378 01:02:44,330 --> 01:02:47,390 It's obviously better if you solve the problem without asking for hints. 1379 01:02:47,390 --> 01:02:50,450 Someone who's constantly asking for hints and needs a lot of hand-holding 1380 01:02:50,450 --> 01:02:51,380 to get to the answer-- 1381 01:02:51,380 --> 01:02:53,120 that's not a good interview either. 1382 01:02:53,120 --> 01:02:55,160 But sometimes you do hit a wall. 1383 01:02:55,160 --> 01:02:58,490 You can ask a question, and with a small little hint, you can get unstuck, 1384 01:02:58,490 --> 01:03:01,860 and then you're back off to the races. 1385 01:03:01,860 --> 01:03:04,710 And also make sure before you type a single line of code, 1386 01:03:04,710 --> 01:03:05,850 explain your solution. 1387 01:03:05,850 --> 01:03:08,490 Be aligned on what you're about to write before you write it. 1388 01:03:08,490 --> 01:03:11,850 You don't want to create some situation where you've written a bunch of code 1389 01:03:11,850 --> 01:03:12,900 in the back of your head, your interviewer 1390 01:03:12,900 --> 01:03:15,330 is like, they didn't even tell me what they were trying to do. 1391 01:03:15,330 --> 01:03:17,730 I don't even know what they're trying to do, and this is super wrong, 1392 01:03:17,730 --> 01:03:18,930 and you don't have enough time to fix it. 1393 01:03:18,930 --> 01:03:20,640 And then you interview's over. 1394 01:03:20,640 --> 01:03:21,450 You lose. 1395 01:03:21,450 --> 01:03:25,020 So make sure you're aligned on the same page of what code you're about to write 1396 01:03:25,020 --> 01:03:29,460 and what your general approach is before you go and write it. 1397 01:03:29,460 --> 01:03:33,160 And again, this is what I mean when I say process, not output. 1398 01:03:33,160 --> 01:03:36,010 If you're aligned in an approach, and you're thinking critically, 1399 01:03:36,010 --> 01:03:38,860 and you're communicating well, maybe your output isn't perfect, 1400 01:03:38,860 --> 01:03:43,170 but that's what we're really looking for for a good interview. 1401 01:03:43,170 --> 01:03:47,260 OK, some few last tips before we get into the mock interviews here. 1402 01:03:47,260 --> 01:03:50,700 So as you're writing code, constantly communicate. 1403 01:03:50,700 --> 01:03:53,940 Sometimes I'll even kind of narrate the code I'm writing. 1404 01:03:53,940 --> 01:03:57,525 I'll say, well, first, I'm going to create a function called Cache. 1405 01:03:57,525 --> 01:03:59,400 And then that's going to take two parameters. 1406 01:03:59,400 --> 01:04:02,358 It's going to take the key, and then it can take the size of the cache. 1407 01:04:02,358 --> 01:04:05,980 And the first thing I want to do is I'm going to create a base case here. 1408 01:04:05,980 --> 01:04:09,000 That kind of communication is really helpful as you're typing. 1409 01:04:09,000 --> 01:04:10,800 Again, it feels weird, it's unnatural. 1410 01:04:10,800 --> 01:04:11,520 Practice it. 1411 01:04:11,520 --> 01:04:14,820 I promise that's what your interviewer wants you to be doing. 1412 01:04:14,820 --> 01:04:18,420 Next thing is always get something working. 1413 01:04:18,420 --> 01:04:22,860 Sometimes people will see some simple or naive solution, 1414 01:04:22,860 --> 01:04:26,007 they know it's not optimal, and rather than writing up the naive solution, 1415 01:04:26,007 --> 01:04:27,840 they sit there and they're like, no, I don't 1416 01:04:27,840 --> 01:04:30,548 want to write anything until I get the perfect, optimal solution. 1417 01:04:30,548 --> 01:04:34,242 Then they end the interview having written zero lines of code-- 1418 01:04:34,242 --> 01:04:36,450 really good chance that the interview didn't go well. 1419 01:04:36,450 --> 01:04:37,825 You're not going to move forward. 1420 01:04:37,825 --> 01:04:41,250 It's definitely better to have something than to have nothing. 1421 01:04:41,250 --> 01:04:45,600 Once you have something, then go ahead and try to simplify, 1422 01:04:45,600 --> 01:04:48,540 make optimizations, and get to that optimal solution. 1423 01:04:48,540 --> 01:04:51,150 But even if you can't ultimately get to the optimal solution, 1424 01:04:51,150 --> 01:04:52,530 but you're thinking really quickly, you're 1425 01:04:52,530 --> 01:04:55,740 communicating well, maybe with five more minutes you would have gotten there, 1426 01:04:55,740 --> 01:04:58,320 that's a really good interview outcome. 1427 01:04:58,320 --> 01:05:01,410 Last, listen to your interviewer. 1428 01:05:01,410 --> 01:05:04,680 I've had many candidates who do not listen to me 1429 01:05:04,680 --> 01:05:06,750 as I'm trying to help and give hints. 1430 01:05:06,750 --> 01:05:08,730 Your interviewer wants you to succeed. 1431 01:05:08,730 --> 01:05:12,763 As an interviewer, it's so much less fun watching somebody struggle, 1432 01:05:12,763 --> 01:05:15,930 and you're trying to help, and they're telling you, no, you don't understand 1433 01:05:15,930 --> 01:05:17,138 the problem you just gave me. 1434 01:05:17,138 --> 01:05:19,870 It's like, I probably do, and I want you to succeed. 1435 01:05:19,870 --> 01:05:22,020 So if your interviewer is giving you little hints 1436 01:05:22,020 --> 01:05:26,160 and guiding you in the right direction, really listen to what they're saying 1437 01:05:26,160 --> 01:05:29,310 and take it seriously. 1438 01:05:29,310 --> 01:05:31,320 It's really, really rare that some interviewer 1439 01:05:31,320 --> 01:05:34,080 is going to intentionally try to fool you or give you some hint 1440 01:05:34,080 --> 01:05:36,750 to lead you down the wrong direction and be like, oh, 1441 01:05:36,750 --> 01:05:39,702 is that your final answer, when it's actually correct. 1442 01:05:39,702 --> 01:05:40,410 It's pretty rare. 1443 01:05:40,410 --> 01:05:43,617 I assume the interviewer is not doing that, unless you know they've already 1444 01:05:43,617 --> 01:05:44,700 done it once or something. 1445 01:05:44,700 --> 01:05:46,110 So really listen to your interviewer. 1446 01:05:46,110 --> 01:05:47,130 They want to help you. 1447 01:05:47,130 --> 01:05:51,880 Take advantage of that and listen to their feedback. 1448 01:05:51,880 --> 01:05:54,670 Oftentimes people ask, what code do I write? 1449 01:05:54,670 --> 01:05:59,390 What we're looking for specifically is a function that returns the answer. 1450 01:05:59,390 --> 01:06:01,600 So don't just write a linear-- 1451 01:06:01,600 --> 01:06:04,180 the first line of code shouldn't be like, if this, 1452 01:06:04,180 --> 01:06:05,740 and assume some variable exists. 1453 01:06:05,740 --> 01:06:07,990 The first line you write should be creating a function 1454 01:06:07,990 --> 01:06:09,850 that will ultimately return the answer. 1455 01:06:09,850 --> 01:06:12,940 If that function needs to be more than one function, great. 1456 01:06:12,940 --> 01:06:15,680 Decompose that into separate functions as needed. 1457 01:06:15,680 --> 01:06:16,648 Don't go crazy here. 1458 01:06:16,648 --> 01:06:19,690 And make sure you have something working before you spend a bunch of time 1459 01:06:19,690 --> 01:06:22,840 refactoring code and cleaning it up. 1460 01:06:22,840 --> 01:06:27,340 A lot of good general engineering and programming principles apply here too. 1461 01:06:27,340 --> 01:06:30,610 Don't create variable names with crazy acronyms or abbreviations. 1462 01:06:30,610 --> 01:06:32,170 Make sure everything is readable. 1463 01:06:32,170 --> 01:06:37,090 If you have common logic, factor things out into helper functions. 1464 01:06:37,090 --> 01:06:39,430 Again, this is all about the process. 1465 01:06:39,430 --> 01:06:41,830 If you're doing this and demonstrating these things, 1466 01:06:41,830 --> 01:06:46,860 that's way more important than your function being perfect at the end. 1467 01:06:46,860 --> 01:06:48,600 Last part is testing it. 1468 01:06:48,600 --> 01:06:53,100 Once you have written code, your job now is to be a computer. 1469 01:06:53,100 --> 01:06:56,280 So take your code and run through it line-by-line. 1470 01:06:56,280 --> 01:06:59,010 Execute the code as if you were a CPU. 1471 01:06:59,010 --> 01:07:01,170 Make sure that if you run the code, it's going 1472 01:07:01,170 --> 01:07:03,100 to end up returning the correct answer. 1473 01:07:03,100 --> 01:07:04,870 And again, do that out loud. 1474 01:07:04,870 --> 01:07:07,953 So what I would say is, let's say you have that factorial function saying, 1475 01:07:07,953 --> 01:07:09,360 OK, well, let's try passing in 3. 1476 01:07:09,360 --> 01:07:10,170 Well, it's 3. 1477 01:07:10,170 --> 01:07:12,150 My base case is checking if it's equal to 1. 1478 01:07:12,150 --> 01:07:13,233 3 is not equal to 1. 1479 01:07:13,233 --> 01:07:14,650 So let's move on to the next line. 1480 01:07:14,650 --> 01:07:16,358 We're going to enter this recursive case. 1481 01:07:16,358 --> 01:07:19,890 And just walk it through and make sure that you get the correct answer 1482 01:07:19,890 --> 01:07:21,150 at the end of it. 1483 01:07:21,150 --> 01:07:23,550 As you're doing this, be on the lookout for bugs. 1484 01:07:23,550 --> 01:07:27,060 Sometimes in your head, what the code is doing 1485 01:07:27,060 --> 01:07:28,810 is different than what's actually written. 1486 01:07:28,810 --> 01:07:32,040 So as best you can, do exactly what the code is actually doing, 1487 01:07:32,040 --> 01:07:33,690 and that's going to help you find bugs. 1488 01:07:33,690 --> 01:07:37,080 And just verbally reason about that out loud and walk through, 1489 01:07:37,080 --> 01:07:42,370 sort of narrate the process of this function executing to your interviewer. 1490 01:07:42,370 --> 01:07:45,970 Sometimes in an interview, you'll be given a computer and the ability 1491 01:07:45,970 --> 01:07:46,750 to run code. 1492 01:07:46,750 --> 01:07:49,270 Sometimes you won't, either because it's on a whiteboard, 1493 01:07:49,270 --> 01:07:51,610 or because the interviewer says you're not allowed to run code. 1494 01:07:51,610 --> 01:07:53,140 I want to see your reason about it. 1495 01:07:53,140 --> 01:07:54,848 In the mock interviews we're about to do, 1496 01:07:54,848 --> 01:07:57,350 we will be allowed to run code on the computer. 1497 01:07:57,350 --> 01:08:01,252 So if you can do that, I advise to write a few test cases, if you can. 1498 01:08:01,252 --> 01:08:04,210 Maybe they're just like print statements at the end or something that's 1499 01:08:04,210 --> 01:08:07,510 going to run the code and verify the output is correct. 1500 01:08:07,510 --> 01:08:11,260 But what I wouldn't do when you're given the ability to run the code 1501 01:08:11,260 --> 01:08:14,740 is take advantage of that just by running it a million times. 1502 01:08:14,740 --> 01:08:17,380 And let's say you have an off by 1 error somewhere, 1503 01:08:17,380 --> 01:08:20,067 just randomly adding plus 1's and minus 1's and then 1504 01:08:20,067 --> 01:08:22,359 running it until eventually you get the correct answer. 1505 01:08:22,359 --> 01:08:24,567 Even if the answer is correct, that's a great example 1506 01:08:24,567 --> 01:08:27,130 of a process that is not good. 1507 01:08:27,130 --> 01:08:30,220 We want to see reasoning about things and arriving at a solution 1508 01:08:30,220 --> 01:08:34,060 confidently, rather than just randomly locking your way into a solution. 1509 01:08:34,060 --> 01:08:37,300 And the ability to run code a bunch can be this temptation that 1510 01:08:37,300 --> 01:08:39,970 can lead to that kind of outcome. 1511 01:08:39,970 --> 01:08:43,000 And last, if you can, add print statements 1512 01:08:43,000 --> 01:08:45,520 or debug the state as your code is executing. 1513 01:08:45,520 --> 01:08:46,550 Definitely do that. 1514 01:08:46,550 --> 01:08:48,850 I think sometimes people will run the code, look at the output, 1515 01:08:48,850 --> 01:08:51,425 say that's wrong, change something, look at just the output, 1516 01:08:51,425 --> 01:08:52,300 and say that's wrong. 1517 01:08:52,300 --> 01:08:54,819 We're printing out intermediate state, and what your code 1518 01:08:54,819 --> 01:08:56,229 is doing along the way. 1519 01:08:56,229 --> 01:08:57,819 Maybe you have a recursive function. 1520 01:08:57,819 --> 01:09:00,950 You're going to print every time the recursion is called, print the inputs. 1521 01:09:00,950 --> 01:09:04,130 You can make sure the stack is what you think it's going to look like. 1522 01:09:04,130 --> 01:09:07,580 And that's usually the most effective way to fix issues. 1523 01:09:07,580 --> 01:09:09,410 I think I'll say it one last time-- 1524 01:09:09,410 --> 01:09:13,460 the process matters way more than the output here. 1525 01:09:13,460 --> 01:09:16,760 OK, so let's jump into some mock interviews. 1526 01:09:16,760 --> 01:09:21,740 So what we'll do is we'll have Connor, and Maria will be the interviewee. 1527 01:09:21,740 --> 01:09:23,840 I will be the interviewer. 1528 01:09:23,840 --> 01:09:28,694 And we'll try to simulate this really as realistically as we can. 1529 01:09:28,694 --> 01:09:31,069 So like I said, these are real problems I've really given 1530 01:09:31,069 --> 01:09:33,082 in the past at real tech companies. 1531 01:09:33,082 --> 01:09:35,540 And then Connor or Maria have done lots of real interviews, 1532 01:09:35,540 --> 01:09:38,498 and so they'll give you what a real performance looks like, just so you 1533 01:09:38,498 --> 01:09:40,740 can take a look at how things go. 1534 01:09:40,740 --> 01:09:44,120 So I'll read the problem first, and then we'll flip into screen sharing 1535 01:09:44,120 --> 01:09:45,930 and start the interview. 1536 01:09:45,930 --> 01:09:49,017 So this is the first problem that we're going to be working on. 1537 01:09:49,017 --> 01:09:49,850 So I'll read it out. 1538 01:09:49,850 --> 01:09:52,670 So let's define a rotated array as a sorted array 1539 01:09:52,670 --> 01:09:56,810 where the numbers have all been rotated to the right some number of places, 1540 01:09:56,810 --> 01:09:59,220 with numbers wrapping around when they reach the end. 1541 01:09:59,220 --> 01:10:02,030 So for instance, if you've got the array, 1, 2, 3, 4, 5, 1542 01:10:02,030 --> 01:10:06,740 and you rotate that three times, you're going to get 3, 4, 5, 1, 2. 1543 01:10:06,740 --> 01:10:10,010 So the problem here is given, a rotated array, 1544 01:10:10,010 --> 01:10:12,877 find the number of times it was rotated. 1545 01:10:12,877 --> 01:10:13,960 CONNOR LEGGETT: All right. 1546 01:10:13,960 --> 01:10:14,710 Well, hi, Tommy. 1547 01:10:14,710 --> 01:10:15,460 How are you doing? 1548 01:10:15,460 --> 01:10:16,060 I'm Connor. 1549 01:10:16,060 --> 01:10:17,110 TOMMY MACWILLIAMS: Good, nice to meet you Connor. 1550 01:10:17,110 --> 01:10:18,247 How's your day going? 1551 01:10:18,247 --> 01:10:20,330 CONNOR LEGGETT: It's going pretty well, and yours? 1552 01:10:20,330 --> 01:10:21,310 TOMMY MACWILLIAMS: Awesome, not too bad. 1553 01:10:21,310 --> 01:10:23,630 It's pretty sunny out here in San Francisco, 1554 01:10:23,630 --> 01:10:25,732 which doesn't happen too often. 1555 01:10:25,732 --> 01:10:26,940 CONNOR LEGGETT: That's great. 1556 01:10:26,940 --> 01:10:30,500 Yeah, it's pretty warm out here for October in Cambridge. 1557 01:10:30,500 --> 01:10:31,910 DAVID MALAN: Nice. 1558 01:10:31,910 --> 01:10:34,140 All right, well, thanks for taking the time. 1559 01:10:34,140 --> 01:10:35,760 Let's jump right into the question. 1560 01:10:35,760 --> 01:10:38,360 So you've got the Replit open, that's great. 1561 01:10:38,360 --> 01:10:40,640 I notice that you've selected Python there. 1562 01:10:40,640 --> 01:10:43,070 Is that the language that you want to use for this? 1563 01:10:43,070 --> 01:10:44,195 CONNOR LEGGETT: Yes, it is. 1564 01:10:44,195 --> 01:10:46,800 TOMMY MACWILLIAMS: Perfect, that works for me. 1565 01:10:46,800 --> 01:10:49,770 So here's the question that I'd like you to solve. 1566 01:10:49,770 --> 01:10:54,590 So let's define a rotated array as a sorted array, where the numbers have 1567 01:10:54,590 --> 01:10:57,710 all been rotated to the right some number of places, 1568 01:10:57,710 --> 01:11:00,270 with numbers wrapping around when they reach the end. 1569 01:11:00,270 --> 01:11:03,080 So for instance, if I give you the input 1, 2, 3, 4, 1570 01:11:03,080 --> 01:11:06,340 5, you should return back 3, since-- 1571 01:11:06,340 --> 01:11:08,090 oh, sorry, when I rotate that three times, 1572 01:11:08,090 --> 01:11:15,780 you should return back 3, basically, as you've written in the comment there. 1573 01:11:15,780 --> 01:11:19,050 So that's the question that I'd like you to solve. 1574 01:11:19,050 --> 01:11:21,360 CONNOR LEGGETT: OK, yeah, that sounds good. 1575 01:11:21,360 --> 01:11:24,285 So I'll start out by asking some clarifying questions, 1576 01:11:24,285 --> 01:11:25,410 if that sounds good to you. 1577 01:11:25,410 --> 01:11:26,730 TOMMY MACWILLIAMS: Yeah. 1578 01:11:26,730 --> 01:11:29,980 CONNOR LEGGETT: So just to make sure, it does say, given a rotated array here. 1579 01:11:29,980 --> 01:11:32,550 I just want to clarify that something like this right 1580 01:11:32,550 --> 01:11:35,140 here would be our input. 1581 01:11:35,140 --> 01:11:38,010 So I don't get this original array at all, 1582 01:11:38,010 --> 01:11:39,870 I just get the rotated array as input? 1583 01:11:39,870 --> 01:11:41,900 TOMMY MACWILLIAMS: Yep, that's right. 1584 01:11:41,900 --> 01:11:44,870 CONNOR LEGGETT: All right, and then my other clarifying question 1585 01:11:44,870 --> 01:11:52,992 is, in this one, all of these are consecutive integers, so 1, 2, 3, 4, 5, 1586 01:11:52,992 --> 01:11:54,200 all right next to each other. 1587 01:11:54,200 --> 01:11:57,080 Can I assume that that will be the case, or might there 1588 01:11:57,080 --> 01:12:04,635 be a case where my original array is like 1, 3, 4, 7, 10? 1589 01:12:04,635 --> 01:12:06,510 TOMMY MACWILLIAMS: Yeah, so that could exist. 1590 01:12:06,510 --> 01:12:09,918 So they're not necessarily consecutive, but they are sorted. 1591 01:12:09,918 --> 01:12:10,710 CONNOR LEGGETT: OK. 1592 01:12:10,710 --> 01:12:12,480 Yeah, that's good to know. 1593 01:12:12,480 --> 01:12:14,220 All right. 1594 01:12:14,220 --> 01:12:19,350 In that case, let me just look at a couple of examples 1595 01:12:19,350 --> 01:12:22,110 just so I can see if we can start to see a pattern here. 1596 01:12:22,110 --> 01:12:23,110 TOMMY MACWILLIAMS: Sure. 1597 01:12:23,110 --> 01:12:26,080 CONNOR LEGGETT: So we see when we get this first example, 1598 01:12:26,080 --> 01:12:32,850 we want that to map to 3, because we're rotating that one 3 times. 1599 01:12:32,850 --> 01:12:37,000 Let me see if I were to rotate that one more time, 1600 01:12:37,000 --> 01:12:42,030 then it would look like 2, 3, 4, 5, 1. 1601 01:12:42,030 --> 01:12:47,520 And so that would be as if I had rotated it 4 times. 1602 01:12:47,520 --> 01:12:50,110 And then I'll try some ones with different numbers. 1603 01:12:50,110 --> 01:12:57,990 So if my original array has some different numbers in it, 1604 01:12:57,990 --> 01:13:02,490 a rotated one might look like 6, 8, 12, 1, 3. 1605 01:13:02,490 --> 01:13:08,120 1606 01:13:08,120 --> 01:13:11,090 In this case, we would have rotated it so one 1607 01:13:11,090 --> 01:13:13,340 would have been the original one. 1608 01:13:13,340 --> 01:13:15,900 And so we've rotated it 1, 2, 3 times. 1609 01:13:15,900 --> 01:13:20,300 So we would also want this one to return 3. 1610 01:13:20,300 --> 01:13:27,720 And then just one more kind of edge-ish case is if it's not sorted at all. 1611 01:13:27,720 --> 01:13:31,640 I'm assuming that we would want to say that that was rotated 0 times. 1612 01:13:31,640 --> 01:13:33,470 TOMMY MACWILLIAMS: Yes, that's right. 1613 01:13:33,470 --> 01:13:34,553 CONNOR LEGGETT: All right. 1614 01:13:34,553 --> 01:13:37,400 So just to check in, do all of those cases seem good to you? 1615 01:13:37,400 --> 01:13:40,830 TOMMY MACWILLIAMS: Yeah, nothing else you'll probably run into here. 1616 01:13:40,830 --> 01:13:42,380 CONNOR LEGGETT: All right, great. 1617 01:13:42,380 --> 01:13:45,390 So in that case, let me go ahead and run through, looking for patterns. 1618 01:13:45,390 --> 01:13:48,620 So I can see just how I would figure this out 1619 01:13:48,620 --> 01:13:52,880 if I was looking through this as a human, is I would go to the first one, 1620 01:13:52,880 --> 01:13:56,960 and I guess the important thing I'm looking for is all of these numbers 1621 01:13:56,960 --> 01:13:58,160 are increasing. 1622 01:13:58,160 --> 01:14:02,190 And I want to look for the first time that they decrease, 1623 01:14:02,190 --> 01:14:03,650 so they start going down. 1624 01:14:03,650 --> 01:14:09,110 So in this case, I go to 0, I go to 1, it's increasing. 1625 01:14:09,110 --> 01:14:10,820 I go to 2, it's increasing. 1626 01:14:10,820 --> 01:14:16,050 And then when I get to element 3, it's decreasing, 1627 01:14:16,050 --> 01:14:19,220 which means it's rotated 3 times. 1628 01:14:19,220 --> 01:14:22,590 OK, and then just to verify that, I'll go through this one. 1629 01:14:22,590 --> 01:14:27,260 So in this one, I started element 0, then 1, it's still increasing, 1630 01:14:27,260 --> 01:14:29,400 2, still increasing, 3, still increasing. 1631 01:14:29,400 --> 01:14:32,060 But at 4 it decreases again. 1632 01:14:32,060 --> 01:14:35,960 So I think that is a pretty good pattern to use there, 1633 01:14:35,960 --> 01:14:40,770 is that when we get to an index when it starts decreasing, 1634 01:14:40,770 --> 01:14:42,807 that's the index that we want to return. 1635 01:14:42,807 --> 01:14:45,140 TOMMY MACWILLIAMS: Yeah, that looks exactly right to me. 1636 01:14:45,140 --> 01:14:48,223 Yeah, that point where it goes from increasing to decreasing is the index. 1637 01:14:48,223 --> 01:14:50,672 That tells you the number of times it had been rotated. 1638 01:14:50,672 --> 01:14:52,130 CONNOR LEGGETT: All right, perfect. 1639 01:14:52,130 --> 01:14:54,500 In that case, I think I'll go into writing some code, 1640 01:14:54,500 --> 01:14:55,400 if that sounds good to you. 1641 01:14:55,400 --> 01:14:57,020 TOMMY MACWILLIAMS: Yeah, let's see that. 1642 01:14:57,020 --> 01:14:58,103 CONNOR LEGGETT: All right. 1643 01:14:58,103 --> 01:15:01,350 So I'll go ahead and define a function here. 1644 01:15:01,350 --> 01:15:07,070 And so I guess I'll just say, get rotate number. 1645 01:15:07,070 --> 01:15:09,280 TOMMY MACWILLIAMS: Sure, sounds good. 1646 01:15:09,280 --> 01:15:14,230 CONNOR LEGGETT: And it's going to take in this array. 1647 01:15:14,230 --> 01:15:20,080 Ah, that looks like it might be reserved, so I'll take in a list, ls. 1648 01:15:20,080 --> 01:15:25,270 Now I want to go through all of the elements in ls. 1649 01:15:25,270 --> 01:15:27,520 And the index is important here, so I guess I'll 1650 01:15:27,520 --> 01:15:32,590 go ahead and say for i in range ls. 1651 01:15:32,590 --> 01:15:37,120 And now what I want to do is for each i-- like when I'm here, i is 2-- 1652 01:15:37,120 --> 01:15:42,190 I want to compare it to the one before that and see if it's less than that. 1653 01:15:42,190 --> 01:15:43,320 So let me-- 1654 01:15:43,320 --> 01:15:47,140 I guess I would say something like, if ls bracket 1655 01:15:47,140 --> 01:15:52,720 i is less than ls bracket i minus 1-- 1656 01:15:52,720 --> 01:15:59,170 so we're saying, if my current element is less than the element before that-- 1657 01:15:59,170 --> 01:16:04,510 then I would go ahead, and I know that that's the place that I want to stop, 1658 01:16:04,510 --> 01:16:08,740 so I can go ahead and say return i. 1659 01:16:08,740 --> 01:16:13,120 And now, looking at this special case here where nothing happens, 1660 01:16:13,120 --> 01:16:16,970 I guess I would go through this entire list and never get to that point. 1661 01:16:16,970 --> 01:16:22,480 So I guess if I finish this whole thing, so I don't find any point where 1662 01:16:22,480 --> 01:16:27,100 an element is less than its predecessor, I'm going to go ahead and return 0, 1663 01:16:27,100 --> 01:16:32,352 since I know that the list is not rotated at all. 1664 01:16:32,352 --> 01:16:34,060 So now, just as a sanity check, I'm going 1665 01:16:34,060 --> 01:16:38,540 to go through this with this first example here. 1666 01:16:38,540 --> 01:16:42,370 So acting as the computer, I take in ls, which is this list I've highlighted. 1667 01:16:42,370 --> 01:16:45,730 And then I go ahead and say, for i in range ls, 1668 01:16:45,730 --> 01:16:48,100 so that's going to start me off at 0. 1669 01:16:48,100 --> 01:16:50,860 And I'm going to say if ls bracket 0, which is 3, 1670 01:16:50,860 --> 01:16:59,050 is less than ls bracket 0 minus 1, is going to be ls bracket 1671 01:16:59,050 --> 01:17:11,890 negative 1, which is this 2 here, which I guess will not be a problem here. 1672 01:17:11,890 --> 01:17:18,250 Because the only case when this first element is 1673 01:17:18,250 --> 01:17:22,420 going to be less than the last element is when the array is not 1674 01:17:22,420 --> 01:17:23,500 rotated at all. 1675 01:17:23,500 --> 01:17:27,710 So I would want to return 0 in that case. 1676 01:17:27,710 --> 01:17:33,790 So that actually makes me think that I may not need this return 0 at the end 1677 01:17:33,790 --> 01:17:35,080 here. 1678 01:17:35,080 --> 01:17:39,130 Just kind of a peculiarity of Python indexing, 1679 01:17:39,130 --> 01:17:42,670 where if I say ls bracket negative 1, it's 1680 01:17:42,670 --> 01:17:46,720 going to be the last element of the list, instead of giving me an error, 1681 01:17:46,720 --> 01:17:49,907 like it might in C or Java or some other programming language. 1682 01:17:49,907 --> 01:17:51,240 TOMMY MACWILLIAMS: Yeah, thanks. 1683 01:17:51,240 --> 01:17:53,610 I hadn't thought of that, but I think you're right. 1684 01:17:53,610 --> 01:17:55,560 CONNOR LEGGETT: All right. 1685 01:17:55,560 --> 01:17:58,810 And then finishing, go through that example, for this one, 1686 01:17:58,810 --> 01:18:05,310 it would start out at 0 and see that 3 is, in fact, greater than 2, 1687 01:18:05,310 --> 01:18:07,063 so it'll continue. 1688 01:18:07,063 --> 01:18:07,980 It'll get to this one. 1689 01:18:07,980 --> 01:18:11,020 It'll say that 4 is greater than 3, so it will continue. 1690 01:18:11,020 --> 01:18:14,130 It'll get to 5, say 5 is greater than 4, so it'll continue. 1691 01:18:14,130 --> 01:18:20,760 But then when i is 3, we'll see that ls bracket i is, in fact, 1692 01:18:20,760 --> 01:18:22,830 less than ls bracket i minus 1. 1693 01:18:22,830 --> 01:18:28,330 So we'll go ahead and return i, which is 3, which is as expected. 1694 01:18:28,330 --> 01:18:33,100 So just running through it as a human, that seems to work. 1695 01:18:33,100 --> 01:18:35,520 So now let's move on to writing some tests. 1696 01:18:35,520 --> 01:18:39,490 Yeah so I can go ahead and say-- 1697 01:18:39,490 --> 01:18:43,140 I'll just print one out first to verify. 1698 01:18:43,140 --> 01:18:51,240 So I'll go ahead and say, print, get rotate numbers of our first list here. 1699 01:18:51,240 --> 01:18:57,780 And hopefully, this will end up with 3, so I can go ahead and run my code here. 1700 01:18:57,780 --> 01:19:03,750 And we've got a problem here, where I'm saying list object cannot be 1701 01:19:03,750 --> 01:19:05,730 interpreted as an integer. 1702 01:19:05,730 --> 01:19:11,010 OK, and I think what's going on here is I can't just say for i in range lists, 1703 01:19:11,010 --> 01:19:12,880 because range has to take in an integer. 1704 01:19:12,880 --> 01:19:15,742 So I actually have to look at the length of the list-- 1705 01:19:15,742 --> 01:19:17,325 TOMMY MACWILLIAMS: Yeah, that's right. 1706 01:19:17,325 --> 01:19:18,490 CONNOR LEGGETT: --instead. 1707 01:19:18,490 --> 01:19:20,830 So now I'll go ahead and try that again. 1708 01:19:20,830 --> 01:19:23,280 All right, nice, and so that's looking pretty good. 1709 01:19:23,280 --> 01:19:25,440 So that's looking like it's printing 3. 1710 01:19:25,440 --> 01:19:29,920 And then I'll just go ahead and try with our other lists here. 1711 01:19:29,920 --> 01:19:36,020 So hopefully, this second one should translate to 4. 1712 01:19:36,020 --> 01:19:41,530 This third one should translate to 3. 1713 01:19:41,530 --> 01:19:46,530 And this last one should translate to 0. 1714 01:19:46,530 --> 01:19:49,270 And we'll go ahead and run that. 1715 01:19:49,270 --> 01:19:53,110 And it looks like I added-- 1716 01:19:53,110 --> 01:19:53,777 oh, I forgot a-- 1717 01:19:53,777 --> 01:19:55,652 TOMMY MACWILLIAMS: Yeah it's the appropriate. 1718 01:19:55,652 --> 01:19:57,578 CONNOR LEGGETT: --bracket here, I'll run that. 1719 01:19:57,578 --> 01:19:58,870 TOMMY MACWILLIAMS: Looks right. 1720 01:19:58,870 --> 01:20:02,690 CONNOR LEGGETT: And it looks like that has given us the result we want. 1721 01:20:02,690 --> 01:20:04,370 So that's looking pretty good to me. 1722 01:20:04,370 --> 01:20:07,570 So I guess I'll check in at this point and see if there's anything 1723 01:20:07,570 --> 01:20:10,300 that you notice about this or any other corner cases 1724 01:20:10,300 --> 01:20:11,500 you think I should try out. 1725 01:20:11,500 --> 01:20:13,960 TOMMY MACWILLIAMS: Yeah, this looks right to me. 1726 01:20:13,960 --> 01:20:16,107 What is the runtime of this? 1727 01:20:16,107 --> 01:20:17,440 CONNOR LEGGETT: Yeah, of course. 1728 01:20:17,440 --> 01:20:23,290 So going through the runtime, since I'm going through i in range length of ls, 1729 01:20:23,290 --> 01:20:27,520 I'm going to go through this loop a maximum of n times if there's 1730 01:20:27,520 --> 01:20:29,440 n elements in ls. 1731 01:20:29,440 --> 01:20:33,790 And then just accessing elements of a list in Python is 0 of 1, 1732 01:20:33,790 --> 01:20:38,020 and comparing to integers in Python is going to be 0 of 1, 1733 01:20:38,020 --> 01:20:40,520 in terms of the size of the list. 1734 01:20:40,520 --> 01:20:45,880 And so this whole operation inside the for loop is going to be constant time. 1735 01:20:45,880 --> 01:20:50,530 So I going to say that the entire runtime is going to be 0 of n. 1736 01:20:50,530 --> 01:20:54,820 So if there are n elements in the list, it'll take a maximum of n times. 1737 01:20:54,820 --> 01:20:56,740 TOMMY MACWILLIAMS: Yeah, I think that's right. 1738 01:20:56,740 --> 01:20:59,820 Can you think of any ways to make it faster? 1739 01:20:59,820 --> 01:21:01,170 CONNOR LEGGETT: Yeah, let's see. 1740 01:21:01,170 --> 01:21:08,445 So if I'm working on making it faster, I wonder-- 1741 01:21:08,445 --> 01:21:14,120 1742 01:21:14,120 --> 01:21:26,900 so I guess any way that we could make it faster would be to-- hmm. 1743 01:21:26,900 --> 01:21:32,930 I'm actually a little bit unsure, because going through it as a human, 1744 01:21:32,930 --> 01:21:36,470 I can't think of anything else I would do than go through each element. 1745 01:21:36,470 --> 01:21:40,400 So I'd love to know if you have any hints, if you could nudge me 1746 01:21:40,400 --> 01:21:41,900 in the right direction a little bit. 1747 01:21:41,900 --> 01:21:46,040 TOMMY MACWILLIAMS: Yeah, so keep in mind that the list is sorted. 1748 01:21:46,040 --> 01:21:49,530 Even though it's rotated, we have this property that it's sorted. 1749 01:21:49,530 --> 01:21:53,660 So is there any search we could use that leverages the fact that it's sorted? 1750 01:21:53,660 --> 01:21:57,010 1751 01:21:57,010 --> 01:21:58,970 CONNOR LEGGETT: We could use-- 1752 01:21:58,970 --> 01:22:05,840 so generally, with the sorted list, we could use just a binary search. 1753 01:22:05,840 --> 01:22:13,480 So if we're going through and doing that, 1754 01:22:13,480 --> 01:22:19,250 then how would I apply a binary search to this problem? 1755 01:22:19,250 --> 01:22:23,980 So I guess I could-- 1756 01:22:23,980 --> 01:22:24,670 let's see. 1757 01:22:24,670 --> 01:22:28,480 So if I go through the motions of doing a binary search 1758 01:22:28,480 --> 01:22:32,720 with a problem like this, I would start in the middle 1759 01:22:32,720 --> 01:22:39,910 and see that I've got a size 5 here. 1760 01:22:39,910 --> 01:22:42,940 OK, so I guess I would have to look at the first element first, 1761 01:22:42,940 --> 01:22:44,800 see that my first element is a 3. 1762 01:22:44,800 --> 01:22:47,590 And then when I head to the middle, I see 1763 01:22:47,590 --> 01:22:55,060 that I'm at size 5, which means that it's been increasing since then, which 1764 01:22:55,060 --> 01:22:58,990 means, I guess at that point, I can go ahead and narrow my search down 1765 01:22:58,990 --> 01:23:04,140 to the latter half of the list after I've checked that one. 1766 01:23:04,140 --> 01:23:08,520 And vice versa, if I, let's say, for-- what's a good example? 1767 01:23:08,520 --> 01:23:13,380 For this one, if I start at-- 1768 01:23:13,380 --> 01:23:16,860 1769 01:23:16,860 --> 01:23:19,290 I guess I don't have a great example for that one. 1770 01:23:19,290 --> 01:23:24,360 But if I were to get to a point where I was checking this 3 here, 1771 01:23:24,360 --> 01:23:27,060 then I would know if I'm checking at this 3, 1772 01:23:27,060 --> 01:23:31,260 I know I can just look at everything before the 3. 1773 01:23:31,260 --> 01:23:36,930 So yeah, I think a binary search would be able to help us out there. 1774 01:23:36,930 --> 01:23:39,270 Just want to check in time-wise. 1775 01:23:39,270 --> 01:23:42,000 Is it all right if I go ahead and try and implement that, 1776 01:23:42,000 --> 01:23:43,742 or do you think we should move on? 1777 01:23:43,742 --> 01:23:46,200 TOMMY MACWILLIAMS: Yeah, let's try to implement it quickly, 1778 01:23:46,200 --> 01:23:48,445 and then if we run out of time, that's totally fine 1779 01:23:48,445 --> 01:23:49,570 CONNOR LEGGETT: Yeah, sure. 1780 01:23:49,570 --> 01:23:57,590 So let me leave this other one here, just to have something to reference. 1781 01:23:57,590 --> 01:24:06,170 And now this newer version here, I don't necessarily want to go through each i 1782 01:24:06,170 --> 01:24:07,940 in this range. 1783 01:24:07,940 --> 01:24:09,770 I want to go ahead and say my-- 1784 01:24:09,770 --> 01:24:14,180 1785 01:24:14,180 --> 01:24:21,000 I only care about when I'm going from a high number to a lower number. 1786 01:24:21,000 --> 01:24:25,790 So I'll go ahead and say that my highest number that I've seen so far 1787 01:24:25,790 --> 01:24:31,430 is going to be the first element in the list, is ls bracket 0. 1788 01:24:31,430 --> 01:24:34,100 1789 01:24:34,100 --> 01:24:40,310 And then I can go ahead and say that my lowest element that I've seen so far 1790 01:24:40,310 --> 01:24:42,950 is-- 1791 01:24:42,950 --> 01:24:47,390 we can go ahead and look at the last element of the list, 1792 01:24:47,390 --> 01:24:52,010 because I know it's going to be somewhere in between. 1793 01:24:52,010 --> 01:24:55,220 Or I guess we don't necessarily know that's the lowest. 1794 01:24:55,220 --> 01:25:00,440 Let me think about how we would want to initialize those. 1795 01:25:00,440 --> 01:25:05,540 So 5, if that is the lowest, then-- 1796 01:25:05,540 --> 01:25:11,360 yeah, I guess I'll just start out with 0 and go through the logic of this. 1797 01:25:11,360 --> 01:25:21,530 And then-- although I think I'm going to actually want-- 1798 01:25:21,530 --> 01:25:27,300 so if I'm looking for an item that is lower here, 1799 01:25:27,300 --> 01:25:32,400 I'm also going to want to keep track of the indices that I'm working with. 1800 01:25:32,400 --> 01:25:34,830 Does that seem like it's going to be on the right track? 1801 01:25:34,830 --> 01:25:36,663 TOMMY MACWILLIAMS: Yeah, I think in general, 1802 01:25:36,663 --> 01:25:38,260 you'll probably want to look at the-- 1803 01:25:38,260 --> 01:25:40,772 keep track of the left and right endpoints of the search. 1804 01:25:40,772 --> 01:25:43,230 And then you can compare wherever you land on in the middle 1805 01:25:43,230 --> 01:25:45,140 to those left and right endpoints. 1806 01:25:45,140 --> 01:25:47,140 CONNOR LEGGETT: Yeah, yeah, that's a good point. 1807 01:25:47,140 --> 01:25:54,900 So let me go ahead and say that left for now is going to be 0, the first index. 1808 01:25:54,900 --> 01:25:57,570 And then since we're starting our search with the full list, 1809 01:25:57,570 --> 01:26:02,685 our right is going to be the length of the list minus 1. 1810 01:26:02,685 --> 01:26:05,340 1811 01:26:05,340 --> 01:26:10,650 And then what I can go ahead and say, I can go ahead 1812 01:26:10,650 --> 01:26:13,740 and instead of having this whole for loop here, 1813 01:26:13,740 --> 01:26:18,480 I can say, while right is greater than left, 1814 01:26:18,480 --> 01:26:22,920 so while we're still working on converging n. 1815 01:26:22,920 --> 01:26:27,450 Then I'll go ahead and say that my current index is going 1816 01:26:27,450 --> 01:26:34,660 to be equal to right plus left, 5 by 2. 1817 01:26:34,660 --> 01:26:38,540 Let me get some parentheses in there. 1818 01:26:38,540 --> 01:26:41,862 And so that will take the middle element. 1819 01:26:41,862 --> 01:26:43,570 And then since we're working in Python, I 1820 01:26:43,570 --> 01:26:45,903 realize I should probably do some integer division here. 1821 01:26:45,903 --> 01:26:47,740 TOMMY MACWILLIAMS: Yep. 1822 01:26:47,740 --> 01:26:51,410 CONNOR LEGGETT: So that'll get us our current index that we're working with. 1823 01:26:51,410 --> 01:26:55,270 And then I can go ahead and say-- 1824 01:26:55,270 --> 01:26:57,770 and let me look at this example to see what we should do. 1825 01:26:57,770 --> 01:27:05,230 So in this example, if our current index is greater than the index on the left, 1826 01:27:05,230 --> 01:27:08,060 then I know I can narrow my search to the right half. 1827 01:27:08,060 --> 01:27:16,000 So if ls bracket current, so if that current number is greater 1828 01:27:16,000 --> 01:27:22,150 than ls bracket left, it's greater than the left number, then I can go ahead, 1829 01:27:22,150 --> 01:27:26,390 and I can narrow down the search to this right half of the list. 1830 01:27:26,390 --> 01:27:33,970 So I can go ahead and say that left equals current. 1831 01:27:33,970 --> 01:27:38,750 And then I can go ahead and say, otherwise 1832 01:27:38,750 --> 01:27:51,460 if ls bracket current is less than ls bracket left, 1833 01:27:51,460 --> 01:27:58,450 then I can go ahead and say, right equals current. 1834 01:27:58,450 --> 01:28:05,290 So I know that we are going ahead and changing our rightmost there. 1835 01:28:05,290 --> 01:28:10,180 1836 01:28:10,180 --> 01:28:13,300 And so now we just have to work on what happens 1837 01:28:13,300 --> 01:28:16,340 after we do narrow in on that case. 1838 01:28:16,340 --> 01:28:19,090 So let's go through the example with this top one again. 1839 01:28:19,090 --> 01:28:23,420 So we get to this point with this 5 here, 1840 01:28:23,420 --> 01:28:27,400 and so now we know that our difference is going to be between 5 and 2. 1841 01:28:27,400 --> 01:28:31,630 And actually, now that I'm thinking of-- 1842 01:28:31,630 --> 01:28:34,820 yes, we're looking between 5 and 2 here. 1843 01:28:34,820 --> 01:28:41,350 So our left at this point is going to be 2, and our right is going to be 4. 1844 01:28:41,350 --> 01:28:44,870 And so now our central one is going to be 1 here. 1845 01:28:44,870 --> 01:28:51,410 And so now, since 1 is less than 5, we would hit this case, 1846 01:28:51,410 --> 01:28:53,170 and so we would say right equals current. 1847 01:28:53,170 --> 01:28:57,970 So now our left is going to be 5, and our right is going to be 1. 1848 01:28:57,970 --> 01:29:05,560 So we know that we're ending here when our right one is just 1 1849 01:29:05,560 --> 01:29:08,980 more than our left one. 1850 01:29:08,980 --> 01:29:13,120 And so let me go through what the example would do in this if left is 2, 1851 01:29:13,120 --> 01:29:16,270 as we have here, and right is 3. 1852 01:29:16,270 --> 01:29:21,220 So when one left is 2 and right is 3, our current is going to be 3. 1853 01:29:21,220 --> 01:29:25,570 And so this is going to say, if current is greater than the left one, which 1854 01:29:25,570 --> 01:29:28,690 isn't true, because they're the same thing, and then we'll say, 1855 01:29:28,690 --> 01:29:34,090 if current is less than the left one, which 1856 01:29:34,090 --> 01:29:37,340 isn't going to be true, because they're the same, 1857 01:29:37,340 --> 01:29:39,920 then we can have an else statement here. 1858 01:29:39,920 --> 01:29:43,270 And if it's an else, then we know that this current one 1859 01:29:43,270 --> 01:29:46,450 is kind of 1 below where we want to do. 1860 01:29:46,450 --> 01:29:55,770 So can we try and return our right here. 1861 01:29:55,770 --> 01:29:58,560 So now, just running through with another example 1862 01:29:58,560 --> 01:30:04,090 as kind of a sanity check, so we'll take this one here. 1863 01:30:04,090 --> 01:30:10,450 Let's say, so our left is 0 to start, right is 4. 1864 01:30:10,450 --> 01:30:16,210 We can find the one in the middle, which is going to be element 2. 1865 01:30:16,210 --> 01:30:20,420 And then we're going to see 2 is greater than our left. 1866 01:30:20,420 --> 01:30:26,350 So that means that we're going to narrow our search down to these last three 1867 01:30:26,350 --> 01:30:29,030 elements here. 1868 01:30:29,030 --> 01:30:33,910 And now we're going to go ahead and say that-- 1869 01:30:33,910 --> 01:30:37,820 yeah, so now we're going to go ahead and find the middle element here, 1870 01:30:37,820 --> 01:30:38,590 which is 1. 1871 01:30:38,590 --> 01:30:44,290 And we'll say that left-- 1872 01:30:44,290 --> 01:30:46,600 yeah, so this is our current, and then we're checking 1873 01:30:46,600 --> 01:30:48,880 is current greater than left. 1874 01:30:48,880 --> 01:30:49,990 No, that's not true. 1875 01:30:49,990 --> 01:30:51,370 Is current less than left? 1876 01:30:51,370 --> 01:30:55,750 Yes, that is true, so we're changing our current to this, 1877 01:30:55,750 --> 01:30:58,120 or we're changing our right to this. 1878 01:30:58,120 --> 01:31:01,000 And so now we're just looking at this section here. 1879 01:31:01,000 --> 01:31:02,650 These are our left and right. 1880 01:31:02,650 --> 01:31:07,970 And when we compare left to current and right to current, 1881 01:31:07,970 --> 01:31:10,720 they're both going to be the same thing, so we get this else here. 1882 01:31:10,720 --> 01:31:15,410 And we return what's on the right, which is 1, which should be correct. 1883 01:31:15,410 --> 01:31:26,290 So just basic conceptually wise, it looks like things are working out here. 1884 01:31:26,290 --> 01:31:29,950 Oh, let me run through it real quick with the unrotated around 1885 01:31:29,950 --> 01:31:31,970 to see how things are going there. 1886 01:31:31,970 --> 01:31:34,900 So in this case, we're going to get to this middle one. 1887 01:31:34,900 --> 01:31:39,710 We're going to see that the current is greater than the left. 1888 01:31:39,710 --> 01:31:42,220 So we'll get to this one here now, and we'll 1889 01:31:42,220 --> 01:31:47,120 see that the right is still greater than the left. 1890 01:31:47,120 --> 01:31:53,660 So now our current is still greater than the left, 1891 01:31:53,660 --> 01:31:57,010 so our left is becoming this one. 1892 01:31:57,010 --> 01:32:00,490 And now we're going to go ahead and say-- 1893 01:32:00,490 --> 01:32:04,210 the left is still going to be this one. 1894 01:32:04,210 --> 01:32:07,103 So that's not going to give us the right answer here, it looks like. 1895 01:32:07,103 --> 01:32:09,520 TOMMY MACWILLIAMS: Yeah, I think the stop condition you're 1896 01:32:09,520 --> 01:32:11,770 looking for is in that first example. 1897 01:32:11,770 --> 01:32:14,770 You can see with the one, the number to the left is bigger, 1898 01:32:14,770 --> 01:32:16,550 and the number to the right is bigger. 1899 01:32:16,550 --> 01:32:18,880 So that's kind of the stop condition for your search. 1900 01:32:18,880 --> 01:32:22,088 Otherwise, though, I think the binary search is right. 1901 01:32:22,088 --> 01:32:22,880 CONNOR LEGGETT: OK. 1902 01:32:22,880 --> 01:32:24,400 Yeah, so that makes sense. 1903 01:32:24,400 --> 01:32:30,060 So maybe I can go ahead and check that condition. 1904 01:32:30,060 --> 01:32:37,910 So if we're looking at our current one, do you think for each time, 1905 01:32:37,910 --> 01:32:45,320 we would look at our current and check if it's smaller than the left one, 1906 01:32:45,320 --> 01:32:47,267 and smaller than the right one? 1907 01:32:47,267 --> 01:32:49,100 TOMMY MACWILLIAMS: Yeah, that's seems right. 1908 01:32:49,100 --> 01:32:50,780 CONNOR LEGGETT: OK, sure. 1909 01:32:50,780 --> 01:32:58,410 So we're already checking if our current is smaller than the left one here. 1910 01:32:58,410 --> 01:33:02,960 And so I can go ahead and nest a little bit of ifs 1911 01:33:02,960 --> 01:33:17,980 here and say, if our current is also smaller than the one-- 1912 01:33:17,980 --> 01:33:18,940 oh, sorry. 1913 01:33:18,940 --> 01:33:21,800 But we're not looking at direct neighbors there. 1914 01:33:21,800 --> 01:33:23,960 So let's look at direct neighbors up here. 1915 01:33:23,960 --> 01:33:32,470 So that would look like if ls bracket current minus 1 1916 01:33:32,470 --> 01:33:39,060 is less than ls bracket current, which is 1917 01:33:39,060 --> 01:33:43,410 less than ls bracket current plus 1-- which 1918 01:33:43,410 --> 01:33:47,130 is a nice thing we can do in Python is just combine 1919 01:33:47,130 --> 01:33:51,090 these different inequalities. 1920 01:33:51,090 --> 01:33:53,800 And I'll take away those parentheses for now. 1921 01:33:53,800 --> 01:33:55,860 And so in this case, we know that current 1922 01:33:55,860 --> 01:33:57,490 is the one that we want to return. 1923 01:33:57,490 --> 01:34:00,360 So we can go ahead and return current here. 1924 01:34:00,360 --> 01:34:03,100 1925 01:34:03,100 --> 01:34:10,950 And then let me just do another sanity check with these-- 1926 01:34:10,950 --> 01:34:13,450 TOMMY MACWILLIAMS: Yeah, I think this looks basically right. 1927 01:34:13,450 --> 01:34:17,470 Just for time, we're basically at time, but yeah, overall, this search 1928 01:34:17,470 --> 01:34:19,357 looks pretty good. 1929 01:34:19,357 --> 01:34:20,440 CONNOR LEGGETT: All right. 1930 01:34:20,440 --> 01:34:20,910 TOMMY MACWILLIAMS: Awesome. 1931 01:34:20,910 --> 01:34:23,410 Well, thanks for taking the time for chatting with me today, 1932 01:34:23,410 --> 01:34:24,970 and have a great rest of your day. 1933 01:34:24,970 --> 01:34:26,560 CONNOR LEGGETT: Yeah, thanks, it was great to meet you. 1934 01:34:26,560 --> 01:34:28,610 TOMMY MACWILLIAMS: Awesome, see you later. 1935 01:34:28,610 --> 01:34:30,390 CONNOR LEGGETT: Bye. 1936 01:34:30,390 --> 01:34:35,850 And then for feedback, is it best to keep my screen shared? 1937 01:34:35,850 --> 01:34:39,400 TOMMY MACWILLIAMS: Let's actually just switch to Maria, just for time's sake. 1938 01:34:39,400 --> 01:34:43,390 So Maria can flip into screen sharing, and we can go into the next question. 1939 01:34:43,390 --> 01:34:46,140 All right, so I'll describe the problem, and then you 1940 01:34:46,140 --> 01:34:47,560 can take it away from there. 1941 01:34:47,560 --> 01:34:50,200 So what we're going to do is, given a string, 1942 01:34:50,200 --> 01:34:54,360 we're going to be looking for the length of the longest substring 1943 01:34:54,360 --> 01:34:56,590 without repeating characters. 1944 01:34:56,590 --> 01:35:03,330 So, for instance, if I gave you the string abcabcbb, the length 1945 01:35:03,330 --> 01:35:05,700 of the longest substring there is 3. 1946 01:35:05,700 --> 01:35:08,730 So there's abc where it doesn't have any repeating characters in there, 1947 01:35:08,730 --> 01:35:10,438 and there are a few other ones like that. 1948 01:35:10,438 --> 01:35:12,188 So your function would take that as input, 1949 01:35:12,188 --> 01:35:14,790 and then just return the length of that string, which is 3. 1950 01:35:14,790 --> 01:35:16,190 MARIA ZLATKOVA: Awesome. 1951 01:35:16,190 --> 01:35:17,190 Hey, Tommy, how are you? 1952 01:35:17,190 --> 01:35:17,460 TOMMY MACWILLIAMS: Awesome. 1953 01:35:17,460 --> 01:35:18,255 How's it going? 1954 01:35:18,255 --> 01:35:19,130 MARIA ZLATKOVA: Good. 1955 01:35:19,130 --> 01:35:20,193 How's your day going? 1956 01:35:20,193 --> 01:35:21,360 TOMMY MACWILLIAMS: I'm good. 1957 01:35:21,360 --> 01:35:24,957 It's a sunny day still in San Francisco, so I'm loving it. 1958 01:35:24,957 --> 01:35:26,040 MARIA ZLATKOVA: Beautiful. 1959 01:35:26,040 --> 01:35:29,152 It's kind of a gloomy day in New York, but still pretty warm, 1960 01:35:29,152 --> 01:35:30,570 which is about all we get. 1961 01:35:30,570 --> 01:35:31,200 TOMMY MACWILLIAMS: Nice. 1962 01:35:31,200 --> 01:35:33,075 Well, thanks so much for jumping on the call. 1963 01:35:33,075 --> 01:35:35,570 Let's jump into a coding problem. 1964 01:35:35,570 --> 01:35:36,570 MARIA ZLATKOVA: Awesome. 1965 01:35:36,570 --> 01:35:37,560 TOMMY MACWILLIAMS: All right, so it looks 1966 01:35:37,560 --> 01:35:38,977 like you've got the Replit set up. 1967 01:35:38,977 --> 01:35:40,230 I notice you're set to Python. 1968 01:35:40,230 --> 01:35:42,240 Is that the language you'd like to use? 1969 01:35:42,240 --> 01:35:43,770 MARIA ZLATKOVA: Yeah, that's the language I'd like to use, 1970 01:35:43,770 --> 01:35:44,760 if that sounds good with you. 1971 01:35:44,760 --> 01:35:46,760 TOMMY MACWILLIAMS: Perfect, that's good with me. 1972 01:35:46,760 --> 01:35:47,828 MARIA ZLATKOVA: Cool. 1973 01:35:47,828 --> 01:35:49,870 Just thinking through this question a little bit, 1974 01:35:49,870 --> 01:35:52,320 I guess a few clarifying questions. 1975 01:35:52,320 --> 01:35:53,853 TOMMY MACWILLIAMS: Yeah. 1976 01:35:53,853 --> 01:35:56,270 MARIA ZLATKOVA: So we just want to find the length, right? 1977 01:35:56,270 --> 01:35:59,642 We don't care about returning one or all of the sequences 1978 01:35:59,642 --> 01:36:00,600 that match that length? 1979 01:36:00,600 --> 01:36:02,142 TOMMY MACWILLIAMS: Yep, that's right. 1980 01:36:02,142 --> 01:36:04,140 MARIA ZLATKOVA: Awesome, cool. 1981 01:36:04,140 --> 01:36:06,210 And then when it comes to the input, I see 1982 01:36:06,210 --> 01:36:09,180 the example we have here are all lowercase characters. 1983 01:36:09,180 --> 01:36:12,690 Should we assume that we're going to get all lowercase characters as input, 1984 01:36:12,690 --> 01:36:15,148 or do we want to handle kind of like sanitizing that input? 1985 01:36:15,148 --> 01:36:17,148 TOMMY MACWILLIAMS: Yeah, that's a good question. 1986 01:36:17,148 --> 01:36:18,870 You can assume the input's all lowercase 1987 01:36:18,870 --> 01:36:21,000 MARIA ZLATKOVA: Awesome, cool. 1988 01:36:21,000 --> 01:36:26,687 And I guess, could the input be empty, like the empty script string? 1989 01:36:26,687 --> 01:36:29,020 TOMMY MACWILLIAMS: It could, in which case you return 0. 1990 01:36:29,020 --> 01:36:30,270 MARIA ZLATKOVA: Awesome, cool. 1991 01:36:30,270 --> 01:36:32,330 1992 01:36:32,330 --> 01:36:34,730 Great, I think that covered all of my questions. 1993 01:36:34,730 --> 01:36:38,840 So maybe then just give a few examples, so abc, abcdb, 1994 01:36:38,840 --> 01:36:43,130 the answer would be 3, the output that we want to give. 1995 01:36:43,130 --> 01:36:48,638 If we have all repeating characters the output would be just 1, I'm assuming? 1996 01:36:48,638 --> 01:36:50,180 TOMMY MACWILLIAMS: Yep, that's right. 1997 01:36:50,180 --> 01:36:51,470 MARIA ZLATKOVA: Awesome. 1998 01:36:51,470 --> 01:36:54,680 And conversely, if we have all different characters, 1999 01:36:54,680 --> 01:36:57,590 the output would be 6 in this case? 2000 01:36:57,590 --> 01:36:59,062 TOMMY MACWILLIAMS: Yep. 2001 01:36:59,062 --> 01:37:01,520 MARIA ZLATKOVA: And then, as we said, if we get the string, 2002 01:37:01,520 --> 01:37:04,334 the output would be 0. 2003 01:37:04,334 --> 01:37:10,730 Yeah, awesome, I think that makes a lot of sense. 2004 01:37:10,730 --> 01:37:14,460 When I'm looking at this initial string and problem, 2005 01:37:14,460 --> 01:37:17,810 I guess the first instinct that I have for the very naive solution 2006 01:37:17,810 --> 01:37:21,530 is that brute force. 2007 01:37:21,530 --> 01:37:26,900 We can just get all of the possible subsequences or substrings 2008 01:37:26,900 --> 01:37:29,600 and check whether there are any duplicate characters 2009 01:37:29,600 --> 01:37:30,800 within those substrings. 2010 01:37:30,800 --> 01:37:36,740 So in the abc, abcbb example, that would be first starting 2011 01:37:36,740 --> 01:37:39,650 with every substring starting with a would be a. 2012 01:37:39,650 --> 01:37:43,582 And checking if that has any repeating characters, then ab, 2013 01:37:43,582 --> 01:37:45,290 it doesn't have any duplicate characters. 2014 01:37:45,290 --> 01:37:49,040 Then abc, it also doesn't have any duplicate characters, then abca, 2015 01:37:49,040 --> 01:37:51,860 which has duplicate characters. 2016 01:37:51,860 --> 01:37:54,710 And then every single one-- abcab would also 2017 01:37:54,710 --> 01:37:58,400 have duplicate characters, given that the substring of that had them, 2018 01:37:58,400 --> 01:38:05,030 and also that b is repeating similar, with abcabc abcabcb and abcabcdb. 2019 01:38:05,030 --> 01:38:10,610 So it would be a very similar case if we started b and at c. 2020 01:38:10,610 --> 01:38:14,300 So it's kind of making me feel like the naive 2021 01:38:14,300 --> 01:38:19,200 solution would be doing a little bit of work that is not useful. 2022 01:38:19,200 --> 01:38:22,580 So if we could avoid that, that would be great. 2023 01:38:22,580 --> 01:38:26,660 Reasoning a little bit over that nice, ancient, brute force approach, 2024 01:38:26,660 --> 01:38:31,590 going through all possible subsequences would be quadratic time, 2025 01:38:31,590 --> 01:38:36,200 and then within that, checking whether there are duplicate characters 2026 01:38:36,200 --> 01:38:38,790 within each substring would be linear time. 2027 01:38:38,790 --> 01:38:43,760 So in total, that probably would be n to the third. 2028 01:38:43,760 --> 01:38:45,260 So that is not great. 2029 01:38:45,260 --> 01:38:48,770 So I'm going to try to optimize that, if we can. 2030 01:38:48,770 --> 01:38:53,990 And looking at this the way I like described 2031 01:38:53,990 --> 01:38:57,050 it, starting at different points of the string, 2032 01:38:57,050 --> 01:39:01,040 I'm starting to think maybe we can have a range within the string 2033 01:39:01,040 --> 01:39:05,060 that we track with a starting index and an ending index. 2034 01:39:05,060 --> 01:39:11,090 And maybe we can expand the start of string 2035 01:39:11,090 --> 01:39:13,310 and expand our ending index to the right. 2036 01:39:13,310 --> 01:39:18,680 And the moment we kind of encounter a duplicate character or repeating 2037 01:39:18,680 --> 01:39:23,750 character, we start to move our start index forward 2038 01:39:23,750 --> 01:39:27,140 to try to get to a subsequence that doesn't contain 2039 01:39:27,140 --> 01:39:30,590 that duplicate character anymore, and all the while, while we're doing that, 2040 01:39:30,590 --> 01:39:35,240 keep track of the longest encountered length. 2041 01:39:35,240 --> 01:39:38,850 And I guess I have another kind of assumption question is, 2042 01:39:38,850 --> 01:39:41,147 could we use an extra data structure in this question? 2043 01:39:41,147 --> 01:39:42,980 TOMMY MACWILLIAMS: Yeah, that's really fine. 2044 01:39:42,980 --> 01:39:45,230 I think that sort of sliding window you're describing, 2045 01:39:45,230 --> 01:39:47,480 that sounds like a pretty good approach to me. 2046 01:39:47,480 --> 01:39:48,480 MARIA ZLATKOVA: Awesome. 2047 01:39:48,480 --> 01:39:52,340 Yeah, I think for that sliding window I'd like to use HashSet, 2048 01:39:52,340 --> 01:39:57,890 so that we can have pretty constant time in looking up 2049 01:39:57,890 --> 01:40:02,270 how often certain characters are within the string already, 2050 01:40:02,270 --> 01:40:04,818 and we can do that look-up very quickly. 2051 01:40:04,818 --> 01:40:06,610 TOMMY MACWILLIAMS: Yeah, that sounds great. 2052 01:40:06,610 --> 01:40:07,610 MARIA ZLATKOVA: Awesome. 2053 01:40:07,610 --> 01:40:11,100 So if that sounds good, I'm going to go ahead and define our function. 2054 01:40:11,100 --> 01:40:16,130 I'm going to call it length of longest substring. 2055 01:40:16,130 --> 01:40:19,490 We take in just one parameter, I'm assuming, which is the string. 2056 01:40:19,490 --> 01:40:20,630 TOMMY MACWILLIAMS: Yep. 2057 01:40:20,630 --> 01:40:26,370 MARIA ZLATKOVA: Then we need to define the output, which is an integer. 2058 01:40:26,370 --> 01:40:28,670 So as I said, would love to use a HashSet. 2059 01:40:28,670 --> 01:40:32,420 So I'm just going to start by initializing it 2060 01:40:32,420 --> 01:40:36,110 and just initialize it all to zeros for now. 2061 01:40:36,110 --> 01:40:40,610 And we're going to count how many occurrences of each character 2062 01:40:40,610 --> 01:40:43,910 that we encounter happening within the sub string. 2063 01:40:43,910 --> 01:40:47,810 And I'm going to multiply that by 128, because I 2064 01:40:47,810 --> 01:40:52,740 know that we have 128 ASCII characters. 2065 01:40:52,740 --> 01:40:56,930 So just to start off, initialize it with that. 2066 01:40:56,930 --> 01:41:00,560 And then going to define the length, which 2067 01:41:00,560 --> 01:41:04,250 we're going to want to talk about longest substrings and define it 0. 2068 01:41:04,250 --> 01:41:08,810 I'm getting some-- oh, OK, variable assigned, but never used. 2069 01:41:08,810 --> 01:41:11,480 That's OK, because we haven't used it yet. 2070 01:41:11,480 --> 01:41:16,310 And then I'm going to use the start and end index approach that I 2071 01:41:16,310 --> 01:41:18,010 described with that sliding window. 2072 01:41:18,010 --> 01:41:22,950 So the start, maybe I'll just call it left for clarity. 2073 01:41:22,950 --> 01:41:24,260 I'm going to assign that 0. 2074 01:41:24,260 --> 01:41:28,025 And then what we want to do first is start going through the string. 2075 01:41:28,025 --> 01:41:33,000 You can do it in a few ways, while loop, but maybe I'll do a for loop to start. 2076 01:41:33,000 --> 01:41:37,790 So you can say for right, and right is referring 2077 01:41:37,790 --> 01:41:41,570 to my n index, which I described for right in range 2078 01:41:41,570 --> 01:41:46,133 of the length of the string. 2079 01:41:46,133 --> 01:41:48,050 Thankfully, I saw Connor's previous interview, 2080 01:41:48,050 --> 01:41:50,570 so I now know that we can work here. 2081 01:41:50,570 --> 01:41:54,560 But we have to do the length of the string. 2082 01:41:54,560 --> 01:42:01,550 And then the first thing I want to do in this case is to make sure that-- 2083 01:42:01,550 --> 01:42:05,360 basically, what we want to do is increment 2084 01:42:05,360 --> 01:42:10,340 the count of the specific character that we're at by 1, so in the HashSet 2085 01:42:10,340 --> 01:42:11,340 that we have. 2086 01:42:11,340 --> 01:42:13,880 So the way we're going to do that is we're going to say, 2087 01:42:13,880 --> 01:42:20,690 chars at s at the next right, because S's are the string. 2088 01:42:20,690 --> 01:42:23,960 And we're going to increment that by 1. 2089 01:42:23,960 --> 01:42:30,230 And that's OK, because we've defined all the characters, all of them, 2090 01:42:30,230 --> 01:42:33,930 essentially, fields in our HashSet to be 0. 2091 01:42:33,930 --> 01:42:34,430 Cool. 2092 01:42:34,430 --> 01:42:38,272 So then the next thing I want to do is I want 2093 01:42:38,272 --> 01:42:40,730 to take care of that case, which I mentioned earlier, which 2094 01:42:40,730 --> 01:42:45,620 is, if we encounter a duplicate character moving the left or the char 2095 01:42:45,620 --> 01:42:51,050 index forward until we don't [INAUDIBLE] the character anymore. 2096 01:42:51,050 --> 01:42:55,100 And since we're using chars as our HashSet, 2097 01:42:55,100 --> 01:42:58,370 the way that we know that we've encountered more than one character 2098 01:42:58,370 --> 01:43:08,390 is if chars at index right is greater than 1. 2099 01:43:08,390 --> 01:43:10,930 And so I'm going to do a while loop here, 2100 01:43:10,930 --> 01:43:15,760 because we could have multiple repeating characters within the substring. 2101 01:43:15,760 --> 01:43:20,950 So I want to make sure that I get rid of all potential repeating characters. 2102 01:43:20,950 --> 01:43:23,050 Or the repeating character could actually 2103 01:43:23,050 --> 01:43:26,350 be at a later point in the substring, so I want to get to that point 2104 01:43:26,350 --> 01:43:31,510 and make sure I move the char index by enough characters forward. 2105 01:43:31,510 --> 01:43:36,370 So the way we're going to do this is first, 2106 01:43:36,370 --> 01:43:39,640 we want to update the count that we're keeping 2107 01:43:39,640 --> 01:43:42,420 track of in our HashSet for that specific character. 2108 01:43:42,420 --> 01:43:44,170 So the way we're going to do that is we're 2109 01:43:44,170 --> 01:43:47,920 going to stay chars at s at left-- 2110 01:43:47,920 --> 01:43:50,290 I think we called it left-- 2111 01:43:50,290 --> 01:43:52,660 [INAUDIBLE] minus equals 1. 2112 01:43:52,660 --> 01:43:55,900 And then what I'm going to do to move left forward 2113 01:43:55,900 --> 01:44:00,190 is I'm just going to increment left. 2114 01:44:00,190 --> 01:44:03,820 Cool, and then one thing which I haven't done yet 2115 01:44:03,820 --> 01:44:08,480 is I want to make sure I'm keeping track of the length, as we said earlier. 2116 01:44:08,480 --> 01:44:14,550 So the length at the first iteration will be-- 2117 01:44:14,550 --> 01:44:18,360 we've initialized it to 0, and then we calculated 2118 01:44:18,360 --> 01:44:20,220 the length between two indexes in a string 2119 01:44:20,220 --> 01:44:24,660 typically would be the ending index that is the starting index plus 1, 2120 01:44:24,660 --> 01:44:26,470 because it [INAUDIBLE] 0 index. 2121 01:44:26,470 --> 01:44:30,460 So in our case, it's right minus left plus 1. 2122 01:44:30,460 --> 01:44:32,680 If I could spell correctly that would be great. 2123 01:44:32,680 --> 01:44:35,700 And then what I'm going to do, so that we always 2124 01:44:35,700 --> 01:44:39,270 keep track of the biggest the maximum possible link, 2125 01:44:39,270 --> 01:44:42,040 is I'm going to use the max function and say, I 2126 01:44:42,040 --> 01:44:47,940 want to take the max of the length that we're keeping track of, 2127 01:44:47,940 --> 01:44:51,150 or the current link based on the right and left integers. 2128 01:44:51,150 --> 01:44:54,000 And then I think the last thing we want to do 2129 01:44:54,000 --> 01:45:01,500 is return the link, because we want to retain that integer. 2130 01:45:01,500 --> 01:45:08,255 Cool, and I guess just a sanity check a little bit before I run this, 2131 01:45:08,255 --> 01:45:11,370 I'm just going to do it with abca, because it's a little bit shorter 2132 01:45:11,370 --> 01:45:13,650 than abcabcdb. 2133 01:45:13,650 --> 01:45:17,680 So abca should be 3, the output for that. 2134 01:45:17,680 --> 01:45:23,350 So what we're going to do is, when we start our for loop, 2135 01:45:23,350 --> 01:45:28,630 we're going to say that chars at a is equal to 1. 2136 01:45:28,630 --> 01:45:30,400 We're going to add 1 to that. 2137 01:45:30,400 --> 01:45:32,960 It's not greater than 1 in the first iteration. 2138 01:45:32,960 --> 01:45:42,150 So what we're going to do is just take the length and set it. 2139 01:45:42,150 --> 01:45:46,530 And because right and left are 0 at that first run through the for loop, 2140 01:45:46,530 --> 01:45:50,010 it's going to be 0 minus 0 plus 1, so length is going to be 1 at this stage. 2141 01:45:50,010 --> 01:45:54,840 And then when we get to b, chars at b is going to be granted to 1. 2142 01:45:54,840 --> 01:45:57,972 Chars b still is not greater than 1, so again, 2143 01:45:57,972 --> 01:46:00,180 we're just going to jump to length, and at this point 2144 01:46:00,180 --> 01:46:05,190 it's going to be 2, because 1 minus 0 plus 1 is 2. 2145 01:46:05,190 --> 01:46:08,490 Then we're at index 2, which is the third character, which is c. 2146 01:46:08,490 --> 01:46:14,370 So again, setting chars at c can be 1, and then it's not greater than 1, 2147 01:46:14,370 --> 01:46:17,580 so we just jump and then increment the length again, to 3 this time, 2148 01:46:17,580 --> 01:46:21,520 because 2 minus 0 plus 1 is 3. 2149 01:46:21,520 --> 01:46:23,610 Then in the final run-through of that for loop, 2150 01:46:23,610 --> 01:46:25,080 we're going to encounter a again. 2151 01:46:25,080 --> 01:46:29,730 And so chars at a is now equal to 2, which is greater than 1. 2152 01:46:29,730 --> 01:46:34,350 So what we're going to do is decrement that, so again, chars a becomes 1. 2153 01:46:34,350 --> 01:46:45,000 And we're going to move our left index forward, and what we get now 2154 01:46:45,000 --> 01:46:53,940 is that we want to take the max of either 3 or 0, 1, 2, 3, or 1, 2, 2155 01:46:53,940 --> 01:46:56,670 3, which, again, is going to give us a length 3. 2156 01:46:56,670 --> 01:46:59,900 And we've run through basically all of the elements here, 2157 01:46:59,900 --> 01:47:01,900 so what we're going to do is just return line 3. 2158 01:47:01,900 --> 01:47:05,220 So just by running through the simple example, I think this should work. 2159 01:47:05,220 --> 01:47:08,140 And I'm going to write out some test pieces. 2160 01:47:08,140 --> 01:47:15,600 So maybe I'll just print, input, and maybe just define our string 2161 01:47:15,600 --> 01:47:20,040 here first to be abcabcbb. 2162 01:47:20,040 --> 01:47:24,660 Our input is going to be string, and then we 2163 01:47:24,660 --> 01:47:32,300 want to say length is equal to calling the function on string, 2164 01:47:32,300 --> 01:47:34,600 and finally print. 2165 01:47:34,600 --> 01:47:41,620 Output to be length. 2166 01:47:41,620 --> 01:47:44,310 Cool, so it may have some errors. 2167 01:47:44,310 --> 01:47:47,740 I'm just going to run it through the first time and see what happens. 2168 01:47:47,740 --> 01:47:52,760 And I see here that on line 14, we have, list indices 2169 01:47:52,760 --> 01:47:55,670 must be integers or slices, not strings. 2170 01:47:55,670 --> 01:47:58,623 So looking at line 14-- 2171 01:47:58,623 --> 01:48:01,790 oh, I think this is very interesting, because I referred to ASCII characters 2172 01:48:01,790 --> 01:48:05,270 in the beginning, but then I didn't really 2173 01:48:05,270 --> 01:48:10,730 take into account that we can't have a character itself as the index, 2174 01:48:10,730 --> 01:48:14,457 but I think we have to use a function called ord. 2175 01:48:14,457 --> 01:48:16,040 TOMMY MACWILLIAMS: Yeah, that's right. 2176 01:48:16,040 --> 01:48:16,520 MARIA ZLATKOVA: Awesome. 2177 01:48:16,520 --> 01:48:18,920 Yeah, I think that function returns an integer that 2178 01:48:18,920 --> 01:48:20,580 represents Unicode character. 2179 01:48:20,580 --> 01:48:27,560 So what I want to do is I want to wrap ord around every single time I'm 2180 01:48:27,560 --> 01:48:29,105 using an index within chars. 2181 01:48:29,105 --> 01:48:31,760 2182 01:48:31,760 --> 01:48:35,950 Those should be all the times. 2183 01:48:35,950 --> 01:48:39,480 And then input abcabcbb, output 3, that's great. 2184 01:48:39,480 --> 01:48:45,700 I'm just going to run through and add a few more test cases like the ones we 2185 01:48:45,700 --> 01:48:49,830 mentioned, so bbb , abcdef-- 2186 01:48:49,830 --> 01:48:54,120 2187 01:48:54,120 --> 01:49:00,030 no-- and maybe just an empty string for good measure. 2188 01:49:00,030 --> 01:49:05,580 We'll see if that gets us the right result. Cool. 2189 01:49:05,580 --> 01:49:13,080 So we get input bbb output 1, which is great, and put abcdef output 6, 2190 01:49:13,080 --> 01:49:15,682 which is great. 2191 01:49:15,682 --> 01:49:19,562 pwekf-- I think this is right. 2192 01:49:19,562 --> 01:49:21,270 TOMMY MACWILLIAMS: Yep, that looks right. 2193 01:49:21,270 --> 01:49:25,500 MARIA ZLATKOVA: OK, and then input empty string, output 0. 2194 01:49:25,500 --> 01:49:26,680 Awesome. 2195 01:49:26,680 --> 01:49:27,930 I think this looks good to me. 2196 01:49:27,930 --> 01:49:30,758 Are there any other edge cases that you want us to take a look at? 2197 01:49:30,758 --> 01:49:32,550 MARIA ZLATKOVA: No, this looks great to me. 2198 01:49:32,550 --> 01:49:34,425 And I think you might have mentioned already, 2199 01:49:34,425 --> 01:49:36,730 but what's the runtime of this final solution? 2200 01:49:36,730 --> 01:49:42,010 MARIA ZLATKOVA: Yes, so space complexity is linear if you're using HashSet. 2201 01:49:42,010 --> 01:49:45,160 And then time complexity-- 2202 01:49:45,160 --> 01:49:48,880 so we have one for loop, which is linear time, 2203 01:49:48,880 --> 01:49:55,010 and then searching within the HashSet itself should be constant time. 2204 01:49:55,010 --> 01:49:59,385 So I think it comes down to linear time. 2205 01:49:59,385 --> 01:50:02,050 At most, you have to go through each of the characters twice. 2206 01:50:02,050 --> 01:50:04,137 TOMMY MACWILLIAMS: Yeah, that sounds right to me. 2207 01:50:04,137 --> 01:50:04,720 Well, awesome. 2208 01:50:04,720 --> 01:50:05,830 This looks great. 2209 01:50:05,830 --> 01:50:08,740 Well, thanks so much for taking the time to chat with me today. 2210 01:50:08,740 --> 01:50:09,160 MARIA ZLATKOVA: Of course. 2211 01:50:09,160 --> 01:50:10,018 Thanks so much too. 2212 01:50:10,018 --> 01:50:11,560 It was a fun problem to work through. 2213 01:50:11,560 --> 01:50:12,685 TOMMY MACWILLIAMS: Awesome. 2214 01:50:12,685 --> 01:50:13,400 Have a good one. 2215 01:50:13,400 --> 01:50:16,030 All right, so those were the two mock interviews. 2216 01:50:16,030 --> 01:50:18,765 I'll just say a few closing words for after the interview. 2217 01:50:18,765 --> 01:50:20,890 And then I know we're going a little bit over time, 2218 01:50:20,890 --> 01:50:24,400 but I'll be around if anyone wants to ask questions. 2219 01:50:24,400 --> 01:50:26,830 And then maybe before that we can quickly 2220 01:50:26,830 --> 01:50:28,660 go through just some things that went well 2221 01:50:28,660 --> 01:50:31,202 in the mock interviews and some things that didn't, so people 2222 01:50:31,202 --> 01:50:33,580 could give their own feedback and thoughts. 2223 01:50:33,580 --> 01:50:38,450 But before that, I'll just have a few closing thoughts. 2224 01:50:38,450 --> 01:50:41,290 So one is, we didn't simulate this in the mock interview, 2225 01:50:41,290 --> 01:50:45,110 but after the interview is over is kind of your chance to ask questions. 2226 01:50:45,110 --> 01:50:48,610 So now you would ask questions of your interviewer, 2227 01:50:48,610 --> 01:50:51,290 and here are some good questions that I like to ask-- 2228 01:50:51,290 --> 01:50:54,760 asking about their team's culture or what their typical day-to-day looks 2229 01:50:54,760 --> 01:50:58,300 like, things that they've worked on, things that they're proud of. 2230 01:50:58,300 --> 01:51:00,040 And this is a really good way just to get 2231 01:51:00,040 --> 01:51:03,040 a sense of what it's really like to work at that company 2232 01:51:03,040 --> 01:51:04,570 you're interviewing with. 2233 01:51:04,570 --> 01:51:08,020 I think bad questions are things that you could easily Google or find online, 2234 01:51:08,020 --> 01:51:14,220 and good questions are questions that are not easily answered 2235 01:51:14,220 --> 01:51:16,530 online and actually give you a picture of, 2236 01:51:16,530 --> 01:51:20,920 would you like to join this company, and what is it like to work there? 2237 01:51:20,920 --> 01:51:26,310 So last advice I'll say is, don't worry. 2238 01:51:26,310 --> 01:51:30,510 Interviews are really, really, really high variance. 2239 01:51:30,510 --> 01:51:35,250 There are great engineers who just do super poorly on some interviews, 2240 01:51:35,250 --> 01:51:38,050 and that's just unfortunately how it works. 2241 01:51:38,050 --> 01:51:42,060 So just because you didn't do well on some number of interviews 2242 01:51:42,060 --> 01:51:43,830 doesn't mean at all that you're not still 2243 01:51:43,830 --> 01:51:48,090 a great developer or data scientist or designer or whatever path it might be. 2244 01:51:48,090 --> 01:51:50,910 Everyone has bad interviews sometimes. 2245 01:51:50,910 --> 01:51:52,080 Interviews are not fun. 2246 01:51:52,080 --> 01:51:54,640 I don't think I know anyone who enjoys interviews, really 2247 01:51:54,640 --> 01:51:56,430 on either side of it. 2248 01:51:56,430 --> 01:52:00,690 But just view every interview you do as an opportunity to get better. 2249 01:52:00,690 --> 01:52:04,170 If you don't pass an interview or get rejected from a company, 2250 01:52:04,170 --> 01:52:06,208 just try to reflect on that and think about what 2251 01:52:06,208 --> 01:52:07,500 went well, what didn't go well. 2252 01:52:07,500 --> 01:52:11,580 Maybe it was the type of problem, maybe it was your communication. 2253 01:52:11,580 --> 01:52:14,910 Just take some time to learn and grow from each experience, 2254 01:52:14,910 --> 01:52:17,640 but everyone is going to go through a bad interview. 2255 01:52:17,640 --> 01:52:18,870 I've gone through plenty. 2256 01:52:18,870 --> 01:52:21,070 I'm sure everyone else on this call has, as well. 2257 01:52:21,070 --> 01:52:24,030 And so don't worry if that happens to you. 2258 01:52:24,030 --> 01:52:26,820 So last up, just some takeaways from the talk-- 2259 01:52:26,820 --> 01:52:28,620 one, have the basics down. 2260 01:52:28,620 --> 01:52:31,592 Going into any interview, just know the basics 2261 01:52:31,592 --> 01:52:33,300 of the language you're going to be using. 2262 01:52:33,300 --> 01:52:35,760 Be really comfortable in that setting. 2263 01:52:35,760 --> 01:52:36,810 Build your toolbox. 2264 01:52:36,810 --> 01:52:39,810 Be aware of the concepts we talked about in those two mock interviews. 2265 01:52:39,810 --> 01:52:43,270 We looked at a string problem, we looked at a binary search problem. 2266 01:52:43,270 --> 01:52:45,780 So those sort of concepts, have them ready to go. 2267 01:52:45,780 --> 01:52:47,590 Do lots of practice problems. 2268 01:52:47,590 --> 01:52:49,560 The more you practice, the more things you're 2269 01:52:49,560 --> 01:52:52,740 going to be able to pattern match against, and the more comfortable 2270 01:52:52,740 --> 01:52:55,920 you're going to be in this really unnatural interview setting. 2271 01:52:55,920 --> 01:52:58,860 Before you write any code, just like Maria and Connor did, 2272 01:52:58,860 --> 01:53:01,350 communicate your solution, explain the code 2273 01:53:01,350 --> 01:53:03,690 you're going to write, and then write it out. 2274 01:53:03,690 --> 01:53:06,360 And then just like we saw in those mock interviews, always 2275 01:53:06,360 --> 01:53:08,170 verbally run through your code. 2276 01:53:08,170 --> 01:53:10,320 Look for issues and solve them proactively, 2277 01:53:10,320 --> 01:53:14,310 so the interviewer doesn't have to tell you all of your bugs. 2278 01:53:14,310 --> 01:53:17,940 And I'll say one last time, all of this is about the process, not about 2279 01:53:17,940 --> 01:53:18,690 the output. 2280 01:53:18,690 --> 01:53:22,980 Really focus on communicating well, thinking critically, and getting 2281 01:53:22,980 --> 01:53:26,310 to a solution, rather than writing absolutely perfect code 2282 01:53:26,310 --> 01:53:27,970 at the end of the day. 2283 01:53:27,970 --> 01:53:30,420 And so that's the end of the workshop. 2284 01:53:30,420 --> 01:53:32,820 Like I said, we'd love to dive into questions 2285 01:53:32,820 --> 01:53:37,330 you have for me, as well as some feedback on the mock interview. 2286 01:53:37,330 --> 01:53:41,367 And so I'll turn it over to David to moderate questions and feedback. 2287 01:53:41,367 --> 01:53:43,950 DAVID MALAN: Yeah, Tommy, the first question that came up was, 2288 01:53:43,950 --> 01:53:46,860 does Tommy have any feedback on Connor's and Maria's 2289 01:53:46,860 --> 01:53:48,277 interviews, positive and negative? 2290 01:53:48,277 --> 01:53:49,693 TOMMY MACWILLIAMS: Yeah, for sure. 2291 01:53:49,693 --> 01:53:51,960 So I'd say both of those interviews were positive. 2292 01:53:51,960 --> 01:53:55,530 I think, like I said, the most important part was that communication. 2293 01:53:55,530 --> 01:53:57,450 And in both cases, Connor and Maria started 2294 01:53:57,450 --> 01:54:01,860 by asking the sort of asking clarifying questions in advance. 2295 01:54:01,860 --> 01:54:03,840 They made sure they understood the problem. 2296 01:54:03,840 --> 01:54:07,360 In both cases, they made a list of inputs and outputs, which I mentioned 2297 01:54:07,360 --> 01:54:09,540 is a really good way of framing things. 2298 01:54:09,540 --> 01:54:12,670 Also thinking out loud was really, really important there. 2299 01:54:12,670 --> 01:54:16,260 I think in both cases, everybody was constantly narrating. 2300 01:54:16,260 --> 01:54:18,840 They're never sitting in silence. 2301 01:54:18,840 --> 01:54:21,900 I think something else that I like that Connor did specifically 2302 01:54:21,900 --> 01:54:24,060 was ask for a hint when he got stuck. 2303 01:54:24,060 --> 01:54:27,065 I think it would have been really bad if-- imagine Connor was 2304 01:54:27,065 --> 01:54:29,940 at some mental wall and just didn't see it and was sort of like stuck 2305 01:54:29,940 --> 01:54:30,750 and, like, I don't know. 2306 01:54:30,750 --> 01:54:32,340 Let me just sit there and think about it. 2307 01:54:32,340 --> 01:54:35,548 Just asking for a hint, and then we were able to get unstuck and and go right 2308 01:54:35,548 --> 01:54:37,090 down the right path. 2309 01:54:37,090 --> 01:54:41,130 So yeah, so I think those are the things I would focus on for the interview. 2310 01:54:41,130 --> 01:54:43,110 I think in all cases, just making sure-- 2311 01:54:43,110 --> 01:54:46,152 so we didn't really have enough time, because it was intentionally short, 2312 01:54:46,152 --> 01:54:49,560 but just making sure the code is really readable and clean and taking the time 2313 01:54:49,560 --> 01:54:51,775 to maybe create helper functions or more readable 2314 01:54:51,775 --> 01:54:54,900 variable names-- we sort of omitted that on purpose, just so the interviews 2315 01:54:54,900 --> 01:54:56,900 would be short, but that would be the main thing 2316 01:54:56,900 --> 01:54:59,128 that I would do with more time. 2317 01:54:59,128 --> 01:55:00,920 DAVID MALAN: Another question that came up, 2318 01:55:00,920 --> 01:55:03,620 especially for folks who don't have the luxury of being 2319 01:55:03,620 --> 01:55:06,170 able to do mock interviews with people like this, 2320 01:55:06,170 --> 01:55:09,650 are there recommended websites that are good at preparing you for interview 2321 01:55:09,650 --> 01:55:11,270 questions for algorithms coding? 2322 01:55:11,270 --> 01:55:13,180 Is competitive programming helpful? 2323 01:55:13,180 --> 01:55:14,180 TOMMY MACWILLIAMS: Yeah. 2324 01:55:14,180 --> 01:55:16,790 I think there are lots of great websites. 2325 01:55:16,790 --> 01:55:20,307 So one that I like a lot is called LeetCode, so just leetcode.com. 2326 01:55:20,307 --> 01:55:21,890 They've got a bunch of problems there. 2327 01:55:21,890 --> 01:55:25,370 You'll probably find the ones that I posted somewhere on LeetCode, as well, 2328 01:55:25,370 --> 01:55:26,665 because they have so many. 2329 01:55:26,665 --> 01:55:28,790 They're also great-- you can write up your solution 2330 01:55:28,790 --> 01:55:32,570 and also see the solutions. 2331 01:55:32,570 --> 01:55:35,270 Another good one I like a lot is called Project Euler. 2332 01:55:35,270 --> 01:55:37,760 Same thing, just gives you practice problems. 2333 01:55:37,760 --> 01:55:42,450 You can go and implement them in any language you want. 2334 01:55:42,450 --> 01:55:43,880 So I'd start there. 2335 01:55:43,880 --> 01:55:47,900 If you have a competitive programming background, that's awesome. 2336 01:55:47,900 --> 01:55:50,090 I'm pretty bad at algorithms problems myself. 2337 01:55:50,090 --> 01:55:52,795 So I think competitive programming can be helpful. 2338 01:55:52,795 --> 01:55:54,920 I will say if you have done competitive programming 2339 01:55:54,920 --> 01:55:57,200 before, the difference between competitive programming 2340 01:55:57,200 --> 01:56:00,020 and interviewing is that in competitive programming, 2341 01:56:00,020 --> 01:56:02,060 your variable names do not matter. 2342 01:56:02,060 --> 01:56:04,910 You're just trying to go super fast, and oftentimes that 2343 01:56:04,910 --> 01:56:07,490 means being sloppy or allocating these huge arrays. 2344 01:56:07,490 --> 01:56:09,953 You don't have to calculate the links of things. 2345 01:56:09,953 --> 01:56:11,120 So definitely don't do that. 2346 01:56:11,120 --> 01:56:14,780 In a real interview, the readability of your code matters a whole lot more. 2347 01:56:14,780 --> 01:56:17,720 So other sites, more advanced sites, are things 2348 01:56:17,720 --> 01:56:23,275 like Top Coder, where there's other sort of problems, practice problems. 2349 01:56:23,275 --> 01:56:26,150 They'll be a little more advanced, but they're still a good practice. 2350 01:56:26,150 --> 01:56:27,900 DAVID MALAN: Another question, Tommy, that 2351 01:56:27,900 --> 01:56:31,040 came from Pamika was, I wonder if most interviewers would give 2352 01:56:31,040 --> 01:56:34,580 an interviewee a general problem like this for entry level, 2353 01:56:34,580 --> 01:56:38,000 or if they would likely give a more adaptive problem related 2354 01:56:38,000 --> 01:56:40,715 to the interviewee and the job in question? 2355 01:56:40,715 --> 01:56:42,590 CONNOR LEGGETT: Yeah, that's a good question, 2356 01:56:42,590 --> 01:56:45,260 and I think that's sort of what we were getting at before about 2357 01:56:45,260 --> 01:56:46,970 the different types of interviews. 2358 01:56:46,970 --> 01:56:50,540 So I'd say, this is a really common interview type. 2359 01:56:50,540 --> 01:56:53,962 What's nice is that it removes a lot of the background, 2360 01:56:53,962 --> 01:56:55,920 because you can use whatever language you want. 2361 01:56:55,920 --> 01:56:59,210 It doesn't require you to know some particular framework or library. 2362 01:56:59,210 --> 01:57:01,400 You can solve this in a whole bunch of ways. 2363 01:57:01,400 --> 01:57:03,570 That's the advantage of a problem like this. 2364 01:57:03,570 --> 01:57:06,157 You may also see, in addition to this, something 2365 01:57:06,157 --> 01:57:08,490 that's more specific to the role that you're working on. 2366 01:57:08,490 --> 01:57:10,490 So if you're applying to a web development role, 2367 01:57:10,490 --> 01:57:12,610 you might have a question like, make a website. 2368 01:57:12,610 --> 01:57:14,360 So we didn't do a mock interview for that, 2369 01:57:14,360 --> 01:57:18,050 but I'd say those are less common than these really general questions. 2370 01:57:18,050 --> 01:57:22,250 But you could still run into them as part of the whole interview process. 2371 01:57:22,250 --> 01:57:25,160 DAVID MALAN: And Tommy, for students who aren't at Harvard or Yale 2372 01:57:25,160 --> 01:57:28,790 and might not be considering FAANG companies like Facebook and Apple 2373 01:57:28,790 --> 01:57:31,790 and Amazon, Netflix, and Google, is the kind of prep 2374 01:57:31,790 --> 01:57:36,980 that we're offering today focused on those types of companies' interviews, 2375 01:57:36,980 --> 01:57:38,328 or tech more generally? 2376 01:57:38,328 --> 01:57:41,120 TOMMY MACWILLIAMS: Yeah, these are really just focused on tech more 2377 01:57:41,120 --> 01:57:41,630 generally. 2378 01:57:41,630 --> 01:57:44,360 I think every company will have its own process 2379 01:57:44,360 --> 01:57:45,740 and might do something different. 2380 01:57:45,740 --> 01:57:49,960 But the idea of being asked to write some code in some setting 2381 01:57:49,960 --> 01:57:53,210 where someone is watching you and having to think through your thought process 2382 01:57:53,210 --> 01:57:57,890 and think out loud, that's pretty universal at a lot of companies. 2383 01:57:57,890 --> 01:58:00,890 And like I said, every company might do something a little bit different 2384 01:58:00,890 --> 01:58:04,587 or have some more specific interviews, maybe some online challenge 2385 01:58:04,587 --> 01:58:06,420 or something written or something like that. 2386 01:58:06,420 --> 01:58:09,158 But holistically, you're thinking about all the same things, 2387 01:58:09,158 --> 01:58:11,450 and all the prep work you do is probably going to apply 2388 01:58:11,450 --> 01:58:13,995 to a really wide variety of interviews. 2389 01:58:13,995 --> 01:58:16,370 DAVID MALAN: And perhaps a question for Maria or Connor-- 2390 01:58:16,370 --> 01:58:19,445 how do you stop getting nervous during your interviews? 2391 01:58:19,445 --> 01:58:21,320 CONNOR LEGGETT: So short answer is you don't. 2392 01:58:21,320 --> 01:58:24,900 I get nervous before every interview. 2393 01:58:24,900 --> 01:58:26,930 But one thing that I-- 2394 01:58:26,930 --> 01:58:32,480 like Tommy said before, practicing really helps, and not just practicing 2395 01:58:32,480 --> 01:58:35,270 on your own or with friends, but also practicing 2396 01:58:35,270 --> 01:58:37,550 in the form of other interviews. 2397 01:58:37,550 --> 01:58:43,260 So I've applied to a lot of companies this year. 2398 01:58:43,260 --> 01:58:48,470 And so I have gotten to the point where I'm doing a few interviews a week. 2399 01:58:48,470 --> 01:58:52,295 So the first week I was doing interviews I was a lot more nervous than now, 2400 01:58:52,295 --> 01:58:54,760 where it seems like kind of a routine. 2401 01:58:54,760 --> 01:58:58,940 I know my introduction, I know how to ask clarifying questions, 2402 01:58:58,940 --> 01:59:01,107 I know what questions I'm going to ask interviewers 2403 01:59:01,107 --> 01:59:02,940 about their job, different things like that. 2404 01:59:02,940 --> 01:59:05,090 So I would say that, just like a lot of things, 2405 01:59:05,090 --> 01:59:07,280 the more you do it, the less nervous you'll be. 2406 01:59:07,280 --> 01:59:09,290 MARIA ZLATKOVA: I would say repetition. 2407 01:59:09,290 --> 01:59:14,270 I also think, if you can, practice with friends and kind of switch 2408 01:59:14,270 --> 01:59:16,730 up the interviewer-interviewee roles. 2409 01:59:16,730 --> 01:59:21,060 You can also involve some empathy on the other side, as well. 2410 01:59:21,060 --> 01:59:24,020 But really just put yourself in those situations and kind of simulate 2411 01:59:24,020 --> 01:59:26,330 the interview situation, even when you're 2412 01:59:26,330 --> 01:59:28,070 solving practice problems on your own. 2413 01:59:28,070 --> 01:59:30,202 And like Tommy alluded to earlier, don't just 2414 01:59:30,202 --> 01:59:32,660 be like, oh, I think I kind of know how to do this and then 2415 01:59:32,660 --> 01:59:35,900 look at that solution and be like, yeah, that's what I was going to do. 2416 01:59:35,900 --> 01:59:38,990 But actually time yourself and go through it 2417 01:59:38,990 --> 01:59:42,517 and repeat as often as possible. 2418 01:59:42,517 --> 01:59:44,600 DAVID MALAN: And Tommy, a technical question-- you 2419 01:59:44,600 --> 01:59:48,740 mentioned one or more times that people should factor out common logic. 2420 01:59:48,740 --> 01:59:49,958 What did you mean by that? 2421 01:59:49,958 --> 01:59:53,000 TOMMY MACWILLIAMS: Something I say-- it's not like I say it all the time. 2422 01:59:53,000 --> 01:59:57,290 But oftentimes when you're writing code, just generally, but also 2423 01:59:57,290 --> 02:00:02,540 in an interview, you might find that some of the code you have is repeated. 2424 02:00:02,540 --> 02:00:06,110 Either it's repeated-- literally the code is the same, like you're 2425 02:00:06,110 --> 02:00:09,560 doing the same thing to different variables, or just parts of the logic 2426 02:00:09,560 --> 02:00:10,310 are repeated. 2427 02:00:10,310 --> 02:00:13,850 Maybe you're doing a null check, or you're 2428 02:00:13,850 --> 02:00:17,370 doing some kind of string manipulation that's similar in multiple parts. 2429 02:00:17,370 --> 02:00:19,430 So if you notice those kind of similarities 2430 02:00:19,430 --> 02:00:24,020 or repeated logic in your code, try to create a separate helper function that 2431 02:00:24,020 --> 02:00:28,010 just does that logic, and then call that helper function from the main function 2432 02:00:28,010 --> 02:00:29,820 you've created for your interview. 2433 02:00:29,820 --> 02:00:33,198 So that process, I think it comes from algebra, factoring things. 2434 02:00:33,198 --> 02:00:35,240 You could sort of factor out the logic by saying, 2435 02:00:35,240 --> 02:00:36,907 here's these two things that are common. 2436 02:00:36,907 --> 02:00:39,840 Put it into some common function that you call in both cases. 2437 02:00:39,840 --> 02:00:42,590 DAVID MALAN: And Tommy, a few folks have asked whether they should 2438 02:00:42,590 --> 02:00:44,337 be commenting their code in interviews. 2439 02:00:44,337 --> 02:00:46,670 TOMMY MACWILLIAMS: Yeah, that's an interesting question. 2440 02:00:46,670 --> 02:00:50,990 I will say your interviewer preference might be different, 2441 02:00:50,990 --> 02:00:52,640 depending on the interviewer. 2442 02:00:52,640 --> 02:00:55,850 Me, personally, I wouldn't spend a lot of time 2443 02:00:55,850 --> 02:00:58,550 on that, because you don't have a lot of time in your interview. 2444 02:00:58,550 --> 02:01:01,902 You're already narrating really naturally what your code is doing. 2445 02:01:01,902 --> 02:01:03,860 And so if you're just typing out a comment that 2446 02:01:03,860 --> 02:01:05,610 matches exactly what you're saying, that's 2447 02:01:05,610 --> 02:01:10,438 just describing what the code is doing, it's probably not a great use of time. 2448 02:01:10,438 --> 02:01:12,480 Depending on your style and your interview style, 2449 02:01:12,480 --> 02:01:15,300 maybe adding a quick docstring to the function or just a comment 2450 02:01:15,300 --> 02:01:18,550 at the top of the function that explains what it's going to do can be helpful. 2451 02:01:18,550 --> 02:01:22,620 But in general, I wouldn't spend a lot of time commenting the code as you go, 2452 02:01:22,620 --> 02:01:24,060 given the setting. 2453 02:01:24,060 --> 02:01:25,590 DAVID MALAN: And we do have time for a few more questions. 2454 02:01:25,590 --> 02:01:28,560 In fact, if you'd like to raise your virtual hand in Zoom by clicking 2455 02:01:28,560 --> 02:01:31,020 the raised hand icon, happy to call on some folks 2456 02:01:31,020 --> 02:01:33,210 if you have your video and microphone on. 2457 02:01:33,210 --> 02:01:37,410 And Tommy, in the meantime, a couple of folks asked, among them Aisha, 2458 02:01:37,410 --> 02:01:41,160 if you face a problem while writing your code and can't think of the solution 2459 02:01:41,160 --> 02:01:43,890 even after a hint, what can you do? 2460 02:01:43,890 --> 02:01:46,200 TOMMY MACWILLIAMS: Yeah, I will say, it happens. 2461 02:01:46,200 --> 02:01:48,798 I've hit many a wall in an interview. 2462 02:01:48,798 --> 02:01:51,840 I think, even if the interviewer gives you a hint and you think about it, 2463 02:01:51,840 --> 02:01:55,050 I think it's super reasonable to say, OK, I see what you're saying, 2464 02:01:55,050 --> 02:01:57,870 but I'm not sure how that applies to the problem, 2465 02:01:57,870 --> 02:02:00,307 or I'm not sure I totally follow. 2466 02:02:00,307 --> 02:02:01,890 Can you give me some more information? 2467 02:02:01,890 --> 02:02:03,780 Basically, it's a conversation. 2468 02:02:03,780 --> 02:02:07,080 Your interviewer isn't there to be a robot 2469 02:02:07,080 --> 02:02:09,850 or try to put you in a situation that's tough. 2470 02:02:09,850 --> 02:02:11,290 They want you to succeed. 2471 02:02:11,290 --> 02:02:14,340 And so if they're trying to help you, and they haven't helped you yet, 2472 02:02:14,340 --> 02:02:16,980 just keep asking for more clarifying questions and more hints, 2473 02:02:16,980 --> 02:02:18,463 until eventually you get unstuck. 2474 02:02:18,463 --> 02:02:20,880 But sometimes I've been in interviews where I'm like, hey, 2475 02:02:20,880 --> 02:02:22,530 I just didn't get it. 2476 02:02:22,530 --> 02:02:24,330 The interviewer had to totally handhold me 2477 02:02:24,330 --> 02:02:26,470 through the problem, which is usually what will happen. 2478 02:02:26,470 --> 02:02:28,530 They'll just give you hints that are so obvious, 2479 02:02:28,530 --> 02:02:29,905 they're writing the code for you. 2480 02:02:29,905 --> 02:02:31,710 And then I got rejected, and that's-- 2481 02:02:31,710 --> 02:02:32,430 it happens. 2482 02:02:32,430 --> 02:02:34,930 But the more you're making it a conversation and a dialogue, 2483 02:02:34,930 --> 02:02:37,572 the more opportunities you have to be helped. 2484 02:02:37,572 --> 02:02:39,780 DAVID MALAN: OK, and we have a hand up from Yashasvi, 2485 02:02:39,780 --> 02:02:40,822 if I'm saying that right. 2486 02:02:40,822 --> 02:02:43,890 Yashasvi, if you'd like to say hello and what your question is? 2487 02:02:43,890 --> 02:02:46,650 YASHASVI: I would like to ask Tommy, sir, 2488 02:02:46,650 --> 02:02:51,840 what was the best thing one can do to impress any interviewer, probably 2489 02:02:51,840 --> 02:02:54,470 in etiquette, or something like that? 2490 02:02:54,470 --> 02:02:55,470 TOMMY MACWILLIAMS: Sure. 2491 02:02:55,470 --> 02:02:59,320 So if I had one thing that would impress an interviewer the most, for me, 2492 02:02:59,320 --> 02:03:02,470 the most important part of the interview is communication. 2493 02:03:02,470 --> 02:03:05,262 So if I were to focus on one thing-- or the thing as an interviewer 2494 02:03:05,262 --> 02:03:07,095 that I come out of interview, I'm like, wow, 2495 02:03:07,095 --> 02:03:10,180 that was great-- that thing is probably because they communicated really, 2496 02:03:10,180 --> 02:03:10,860 really well. 2497 02:03:10,860 --> 02:03:13,110 Whether that was asking clarifying questions, 2498 02:03:13,110 --> 02:03:15,342 just explaining their approach or the way 2499 02:03:15,342 --> 02:03:18,300 they thought about the problem, that's usually way more important to me 2500 02:03:18,300 --> 02:03:22,050 than, oh, cool, they use this crazy Python built-in I didn't know existed. 2501 02:03:22,050 --> 02:03:25,080 Communication is way more important than that. 2502 02:03:25,080 --> 02:03:28,320 DAVID MALAN: And a question from Karthik, if you'd like to say hello, 2503 02:03:28,320 --> 02:03:30,980 where you're from, and what your question is. 2504 02:03:30,980 --> 02:03:32,460 KARTHIK: I just have a question. 2505 02:03:32,460 --> 02:03:35,550 For a beginner level or technical interview, 2506 02:03:35,550 --> 02:03:39,390 does clean code really matter? 2507 02:03:39,390 --> 02:03:46,740 The super most optimized code, really it matters, or an optimum level 2508 02:03:46,740 --> 02:03:50,010 code or an ordinary level code? 2509 02:03:50,010 --> 02:03:51,397 I just want to know that. 2510 02:03:51,397 --> 02:03:53,730 TOMMY MACWILLIAMS: Yeah, so I think the number one thing 2511 02:03:53,730 --> 02:03:55,570 that matters is the process. 2512 02:03:55,570 --> 02:03:57,680 So the way that you get to that code and the way 2513 02:03:57,680 --> 02:03:59,430 you're reasoning and communicating, that's 2514 02:03:59,430 --> 02:04:04,120 way more important than how perfectly optimized your code was. 2515 02:04:04,120 --> 02:04:07,620 And then the other thing I'll say is that the expectations the interviewer 2516 02:04:07,620 --> 02:04:10,560 has are going to vary, based on your experience level. 2517 02:04:10,560 --> 02:04:15,570 So let's say I'm asking a question of someone with 20 years of experience. 2518 02:04:15,570 --> 02:04:18,930 I'd expect their code to be better than if I'm interviewing 2519 02:04:18,930 --> 02:04:20,430 someone for their first internship. 2520 02:04:20,430 --> 02:04:22,080 So I think it's going to vary. 2521 02:04:22,080 --> 02:04:25,117 As you're practicing, I'd say, write the best code that you can. 2522 02:04:25,117 --> 02:04:27,450 Make sure that you're thinking about, is the code clean? 2523 02:04:27,450 --> 02:04:30,720 But like I said, the process and your thought process communication 2524 02:04:30,720 --> 02:04:33,780 is always going to be more important than the code you write. 2525 02:04:33,780 --> 02:04:37,170 DAVID MALAN: Michael, would you like to say hello and ask your question next? 2526 02:04:37,170 --> 02:04:41,070 MICHAEL: Yeah, hi, my name is Michael, Fairfield, Connecticut. 2527 02:04:41,070 --> 02:04:43,690 So this is kind of-- 2528 02:04:43,690 --> 02:04:45,690 I had to think a little bit about this question, 2529 02:04:45,690 --> 02:04:48,810 because you guys covered so much, and I felt like any technical questions 2530 02:04:48,810 --> 02:04:49,977 I had were already answered. 2531 02:04:49,977 --> 02:04:52,380 So anyway, I'll just ask you. 2532 02:04:52,380 --> 02:04:53,880 I'm a pretty big dude-- 2533 02:04:53,880 --> 02:04:55,950 I'm six-four, 260 pounds. 2534 02:04:55,950 --> 02:05:00,210 Sometimes I don't have the nicest face on, you know what I mean? 2535 02:05:00,210 --> 02:05:03,240 So what can I do when I get to the interview and I'm nervous, 2536 02:05:03,240 --> 02:05:04,720 and I just look mean? 2537 02:05:04,720 --> 02:05:09,450 What are some things that maybe I can do to make my interviewer feel 2538 02:05:09,450 --> 02:05:13,410 a little bit more comfortable and know that we're here 2539 02:05:13,410 --> 02:05:15,032 trying to accomplish the same goals? 2540 02:05:15,032 --> 02:05:16,990 TOMMY MACWILLIAMS: Yeah, it's a great question. 2541 02:05:16,990 --> 02:05:18,870 I think I'm also someone who-- 2542 02:05:18,870 --> 02:05:22,290 I'm pretty bad at hiding my emotions, which you could probably 2543 02:05:22,290 --> 02:05:25,860 see as I'm talking about resumes and things I'm tired of seeing on them. 2544 02:05:25,860 --> 02:05:28,470 I think the biggest thing is just, the interviewer 2545 02:05:28,470 --> 02:05:29,970 can tell when you're really nervous. 2546 02:05:29,970 --> 02:05:32,928 Sometimes I'll go on an interview, and, I'm like, oh, man this person-- 2547 02:05:32,928 --> 02:05:35,790 I can tell within 30 seconds they're super nervous. 2548 02:05:35,790 --> 02:05:38,400 Me, as an interviewer, I'll try to keep it light 2549 02:05:38,400 --> 02:05:40,600 and help calm you down or make you less nervous. 2550 02:05:40,600 --> 02:05:43,657 Not every interviewer can or wants to do that. 2551 02:05:43,657 --> 02:05:45,990 The number one thing is just the more practice you have, 2552 02:05:45,990 --> 02:05:47,730 I think is really important. 2553 02:05:47,730 --> 02:05:51,142 For some people, having a glass of water available to them 2554 02:05:51,142 --> 02:05:53,850 can be really helpful, so just bringing a couple of water bottles 2555 02:05:53,850 --> 02:05:54,550 if it's on site. 2556 02:05:54,550 --> 02:05:56,770 I have a water bottle here, just having that ready. 2557 02:05:56,770 --> 02:05:58,770 Taking a deep breath before you start talking 2558 02:05:58,770 --> 02:06:03,000 or before you turn on that Zoom call makes a huge, huge difference. 2559 02:06:03,000 --> 02:06:04,500 So I think little things like that-- 2560 02:06:04,500 --> 02:06:07,318 everybody is a little bit different about how 2561 02:06:07,318 --> 02:06:08,610 to make them feel less nervous. 2562 02:06:08,610 --> 02:06:11,820 But I think how nervous you are on your first interview 2563 02:06:11,820 --> 02:06:14,970 and how nervous you are in, like, your 50th is like such a big gap 2564 02:06:14,970 --> 02:06:18,210 that you just have to pay that cost, go through a bunch. 2565 02:06:18,210 --> 02:06:20,970 And then for many people, eventually, it starts 2566 02:06:20,970 --> 02:06:23,160 becoming less and less nerve-racking. 2567 02:06:23,160 --> 02:06:26,700 DAVID MALAN: Sarah, would you like to say hello and ask your question next? 2568 02:06:26,700 --> 02:06:32,010 SARAH: Hello, and first of all, thank you very much for your information. 2569 02:06:32,010 --> 02:06:37,380 And I want to ask, how can we explain our job 2570 02:06:37,380 --> 02:06:43,200 gap before starting this field, IT career, 2571 02:06:43,200 --> 02:06:46,980 I had a different experience in different fields? 2572 02:06:46,980 --> 02:06:50,490 And then I gave a break, like, five years. 2573 02:06:50,490 --> 02:06:57,000 After that five years, I'm starting searching for a job in the IT field. 2574 02:06:57,000 --> 02:07:02,250 So how can I explain this gap in my job experience? 2575 02:07:02,250 --> 02:07:02,752 Thank you. 2576 02:07:02,752 --> 02:07:04,710 TOMMY MACWILLIAMS: Yeah, it's a great question. 2577 02:07:04,710 --> 02:07:07,740 And something I'll say is that the experience you just 2578 02:07:07,740 --> 02:07:10,500 described of coming from a different field 2579 02:07:10,500 --> 02:07:13,380 or taking a break in between roles for some number of years, 2580 02:07:13,380 --> 02:07:15,810 it's becoming more and more common. 2581 02:07:15,810 --> 02:07:18,840 So maybe 10 years ago this was something you really had to worry about. 2582 02:07:18,840 --> 02:07:22,270 People were only in engineering if they had a degree in engineering. 2583 02:07:22,270 --> 02:07:25,770 I think now, so many people are coming from other career paths 2584 02:07:25,770 --> 02:07:27,990 and going through boot camps or online courses 2585 02:07:27,990 --> 02:07:31,710 or switching careers into engineering that it almost 2586 02:07:31,710 --> 02:07:36,040 doesn't need to be explained as much today as it would many years ago. 2587 02:07:36,040 --> 02:07:37,420 But I would just be honest. 2588 02:07:37,420 --> 02:07:38,910 I'd say, here's my background. 2589 02:07:38,910 --> 02:07:42,215 It was in some other field, could be totally unrelated to software, 2590 02:07:42,215 --> 02:07:43,590 totally unrelated to engineering. 2591 02:07:43,590 --> 02:07:48,930 Talk about your experience there, the impact you had, what you learned. 2592 02:07:48,930 --> 02:07:52,490 And then just talk about why you want to switch to engineering 2593 02:07:52,490 --> 02:07:54,990 and what you've done so far and why you're excited about it, 2594 02:07:54,990 --> 02:07:58,660 why you're excited to learn more and help a company and have impact. 2595 02:07:58,660 --> 02:08:01,690 But I would say, my short answer is I wouldn't worry too much about it. 2596 02:08:01,690 --> 02:08:04,890 And then to explain it, just be honest about what you've done in the past 2597 02:08:04,890 --> 02:08:06,723 and why are you looking to switch. 2598 02:08:06,723 --> 02:08:08,640 DAVID MALAN: Misarg, if I'm saying that right, 2599 02:08:08,640 --> 02:08:11,132 would you like to say hello and ask your question. 2600 02:08:11,132 --> 02:08:13,590 MISARG: My name is Misarg [INAUDIBLE],, and I'm from India. 2601 02:08:13,590 --> 02:08:17,200 And greetings to Tommy sir and David sir and everyone else. 2602 02:08:17,200 --> 02:08:20,830 So my question, if you get stuck on a problem, 2603 02:08:20,830 --> 02:08:22,830 what is the optimum time to think over it 2604 02:08:22,830 --> 02:08:25,160 before stating that we are unable to solve it? 2605 02:08:25,160 --> 02:08:27,160 TOMMY MACWILLIAMS: Yeah, that's a good question. 2606 02:08:27,160 --> 02:08:32,190 So it's sort of like, at what point do you ask for the hint? 2607 02:08:32,190 --> 02:08:36,190 I'll say one thing to keep mind is the total duration of the interview, 2608 02:08:36,190 --> 02:08:38,850 so if you know you're in a 45-minute interview versus you're 2609 02:08:38,850 --> 02:08:40,530 in a two-hour interview. 2610 02:08:40,530 --> 02:08:43,320 My general heuristic is something like three to five minutes. 2611 02:08:43,320 --> 02:08:46,740 If you've made no progress in three to five minutes, 2612 02:08:46,740 --> 02:08:49,410 that's when I would try to ask for a hint. 2613 02:08:49,410 --> 02:08:52,500 Sometimes just as you're sort of thinking out loud, 2614 02:08:52,500 --> 02:08:54,540 you'll eventually run out of things to say, 2615 02:08:54,540 --> 02:08:56,722 because you've run out of things to think of. 2616 02:08:56,722 --> 02:08:59,430 And at that point, too, if you find yourself being silent or just 2617 02:08:59,430 --> 02:09:02,830 not making any progress, think for a minute or two and then say, 2618 02:09:02,830 --> 02:09:04,600 actually I'm not sure. 2619 02:09:04,600 --> 02:09:05,350 Can I have a hint? 2620 02:09:05,350 --> 02:09:08,183 So if you're thinking it's in the ballpark of like 20 to 30 minutes, 2621 02:09:08,183 --> 02:09:10,320 let's say way lower than that, but I also 2622 02:09:10,320 --> 02:09:12,860 would say much greater than like 30 seconds, 2623 02:09:12,860 --> 02:09:14,610 because you'll give yourself a few minutes 2624 02:09:14,610 --> 02:09:16,515 to actually process it and think. 2625 02:09:16,515 --> 02:09:18,640 DAVID MALAN: We have time for a few more questions. 2626 02:09:18,640 --> 02:09:21,300 Do feel free to raise a virtual hand and turn on your camera 2627 02:09:21,300 --> 02:09:22,680 if you'd like to ask on camera. 2628 02:09:22,680 --> 02:09:25,800 Or repaste your question in the chat if we might have missed it. 2629 02:09:25,800 --> 02:09:28,590 We're doing our best to field as many as we can. 2630 02:09:28,590 --> 02:09:32,470 Yuvraj, if I'm saying that right, would you like to ask your question? 2631 02:09:32,470 --> 02:09:33,760 YUVRAG: So hi, guys. 2632 02:09:33,760 --> 02:09:37,590 My name is Raj, and I would like to ask a question 2633 02:09:37,590 --> 02:09:40,560 from an entrepreneurial standpoint. 2634 02:09:40,560 --> 02:09:44,160 So a lot of companies in the recent times 2635 02:09:44,160 --> 02:09:49,900 have changed the whole paradigm of hiring people and all that. 2636 02:09:49,900 --> 02:09:54,780 So how do you expect that it might change furthermore? 2637 02:09:54,780 --> 02:09:57,780 Even as a student if I look at, things have 2638 02:09:57,780 --> 02:10:01,830 changed from going offline doing interviews and all that, 2639 02:10:01,830 --> 02:10:05,400 to going online, due to this pandemic and all that. 2640 02:10:05,400 --> 02:10:07,860 So do you think things could change further, 2641 02:10:07,860 --> 02:10:11,827 or this is the top or something like that? 2642 02:10:11,827 --> 02:10:14,910 TOMMY MACWILLIAMS: Yeah, it's a good question, how interviews have evolved 2643 02:10:14,910 --> 02:10:16,590 and where they're going. 2644 02:10:16,590 --> 02:10:20,340 Certainly these virtual interviews are way, way more common. 2645 02:10:20,340 --> 02:10:24,150 Many companies, even if you could come on site, 2646 02:10:24,150 --> 02:10:25,890 just so much more convenient to interview 2647 02:10:25,890 --> 02:10:29,670 someone remotely rather than traveling six hours on a plane, 2648 02:10:29,670 --> 02:10:33,120 being tired at 9:00 AM the next day for the interview, which is not fun. 2649 02:10:33,120 --> 02:10:34,412 So that's definitely a big one. 2650 02:10:34,412 --> 02:10:36,333 I think that's a trend that will stick. 2651 02:10:36,333 --> 02:10:38,250 I think many companies will still do on-sites. 2652 02:10:38,250 --> 02:10:42,480 But I think before, I remember the companies I've worked at and friends 2653 02:10:42,480 --> 02:10:46,170 have had a hard policy on, we have to meet you in person before we hire you, 2654 02:10:46,170 --> 02:10:49,470 just cannot join the team unless we meet you in person. 2655 02:10:49,470 --> 02:10:51,570 I don't know why, but that was a policy. 2656 02:10:51,570 --> 02:10:54,470 I don't think you'll see very many things like that anymore. 2657 02:10:54,470 --> 02:10:56,220 I think another thing that's been changing 2658 02:10:56,220 --> 02:11:02,500 is that many companies are asking more of these practical questions, 2659 02:11:02,500 --> 02:11:04,920 especially to folks with more experience. 2660 02:11:04,920 --> 02:11:06,270 And I think that's good and bad. 2661 02:11:06,270 --> 02:11:10,050 I think for many folks coming out of university or new grads, 2662 02:11:10,050 --> 02:11:12,120 asking them a practical question in many cases 2663 02:11:12,120 --> 02:11:15,030 is worse, just because they haven't ever written production code 2664 02:11:15,030 --> 02:11:16,620 or launched a production website. 2665 02:11:16,620 --> 02:11:18,600 And so asking somebody to do that, it actually 2666 02:11:18,600 --> 02:11:20,017 doesn't give you that much signal. 2667 02:11:20,017 --> 02:11:23,605 And asking an algorithms question to a student who's taken algorithms classes, 2668 02:11:23,605 --> 02:11:26,230 and they're really good at that, can actually be higher signal. 2669 02:11:26,230 --> 02:11:28,560 And so where I see this shift coming is that, 2670 02:11:28,560 --> 02:11:31,140 if you have the experience of building these systems, 2671 02:11:31,140 --> 02:11:32,400 we're going to ask you about it and maybe 2672 02:11:32,400 --> 02:11:33,858 ask you to build something similar. 2673 02:11:33,858 --> 02:11:35,340 And if you don't, then we're not. 2674 02:11:35,340 --> 02:11:37,983 Where I think a few years ago, there's this blanket everybody 2675 02:11:37,983 --> 02:11:40,650 has to do whiteboard questions, because whiteboard questions are 2676 02:11:40,650 --> 02:11:41,580 the be-all end-all. 2677 02:11:41,580 --> 02:11:43,497 And I'd say they have a purpose. 2678 02:11:43,497 --> 02:11:46,080 A lot of people are like, whiteboard questions are always bad, 2679 02:11:46,080 --> 02:11:46,747 they're useless. 2680 02:11:46,747 --> 02:11:48,180 I don't subscribe to that at all. 2681 02:11:48,180 --> 02:11:51,360 I've interviewed so many students who do better on these than they do on 2682 02:11:51,360 --> 02:11:52,980 build a website questions. 2683 02:11:52,980 --> 02:11:54,870 So they have their place, and I think they're 2684 02:11:54,870 --> 02:11:59,005 becoming more of a specialized thing than a blanket part of the process. 2685 02:11:59,005 --> 02:12:00,880 DAVID MALAN: And Tommy, a couple of questions 2686 02:12:00,880 --> 02:12:02,755 that have come up a few times now in the chat 2687 02:12:02,755 --> 02:12:06,580 relate to folks who either don't have much work experience, because they're 2688 02:12:06,580 --> 02:12:09,190 just coming out of college, or they're older and have 2689 02:12:09,190 --> 02:12:11,950 gaps in their resume for some reason. 2690 02:12:11,950 --> 02:12:14,440 What kinds of personal technical projects 2691 02:12:14,440 --> 02:12:16,340 should people in those situations take on? 2692 02:12:16,340 --> 02:12:18,490 And when it comes to languages, given that they 2693 02:12:18,490 --> 02:12:21,340 might have a choice of languages, which languages should they 2694 02:12:21,340 --> 02:12:22,550 be picking up for interviews? 2695 02:12:22,550 --> 02:12:24,550 TOMMY MACWILLIAMS: Yeah, that's a good question. 2696 02:12:24,550 --> 02:12:26,200 I'll start with the second one. 2697 02:12:26,200 --> 02:12:29,300 I would pick up languages that are more popular. 2698 02:12:29,300 --> 02:12:34,210 So I think that takes the form of Python or JavaScript, would probably be my top 2699 02:12:34,210 --> 02:12:35,200 two. 2700 02:12:35,200 --> 02:12:38,590 Those are languages you could use to build a little web application 2701 02:12:38,590 --> 02:12:41,680 or visualization or a command line application. 2702 02:12:41,680 --> 02:12:46,510 I wouldn't try to pick up as a first language something like Haskell or Rust 2703 02:12:46,510 --> 02:12:49,652 or some of these more sort of less mainstream 2704 02:12:49,652 --> 02:12:51,110 and have a higher barrier to entry. 2705 02:12:51,110 --> 02:12:53,740 So Python or JavaScript are good ones to start with. 2706 02:12:53,740 --> 02:12:56,500 And then for a personal project, I would say build 2707 02:12:56,500 --> 02:12:58,090 something that's interesting to you. 2708 02:12:58,090 --> 02:13:02,358 My best advice to people is that everyone in their day-to-day 2709 02:13:02,358 --> 02:13:04,150 has some problem that they're dealing with. 2710 02:13:04,150 --> 02:13:11,230 Maybe it's taking notes in class or organizing some files in their laptop. 2711 02:13:11,230 --> 02:13:14,470 Everyone sort of has these little problems that they deal with. 2712 02:13:14,470 --> 02:13:17,620 Just write a little app to solve them for yourself. 2713 02:13:17,620 --> 02:13:20,050 I remember one of the first things I built 2714 02:13:20,050 --> 02:13:22,300 was this little weather visualizer, because I 2715 02:13:22,300 --> 02:13:24,250 didn't like the weather.com things. 2716 02:13:24,250 --> 02:13:27,280 I'm like, oh, let me use their API and just build a little weather app. 2717 02:13:27,280 --> 02:13:30,910 And I just had that in my room where I could wake up and check 2718 02:13:30,910 --> 02:13:32,862 my little weather app. 2719 02:13:32,862 --> 02:13:35,320 There's thousands of weather apps out there, but who cares? 2720 02:13:35,320 --> 02:13:37,240 It was like a problem that I thought was kind of interesting, 2721 02:13:37,240 --> 02:13:38,300 and I went and solved it. 2722 02:13:38,300 --> 02:13:41,540 So everybody has those little things that are interesting to them. 2723 02:13:41,540 --> 02:13:43,600 So pick something that's interesting to you 2724 02:13:43,600 --> 02:13:46,600 and write a little command line application or web application 2725 02:13:46,600 --> 02:13:48,310 to solve it. 2726 02:13:48,310 --> 02:13:51,280 DAVID MALAN: A few final questions here-- 2727 02:13:51,280 --> 02:13:53,530 Sarah, would you like to ask your question 2728 02:13:53,530 --> 02:13:55,870 and tell us where you are in the world? 2729 02:13:55,870 --> 02:14:00,610 SARAH: Hi, I'm Sarah from Algeria. 2730 02:14:00,610 --> 02:14:04,520 And I was wondering, do you think I could ask all the questions that 2731 02:14:04,520 --> 02:14:07,420 are in my mind about the work and the company to my interviewer, 2732 02:14:07,420 --> 02:14:11,350 even after I know that I failed with my code and writing the code 2733 02:14:11,350 --> 02:14:12,850 and solving the problem? 2734 02:14:12,850 --> 02:14:15,512 Do I have the right to ask them or not? 2735 02:14:15,512 --> 02:14:18,220 TOMMY MACWILLIAMS: Oh, at the end of the interview when they ask, 2736 02:14:18,220 --> 02:14:20,290 do you have any questions for me, even if you 2737 02:14:20,290 --> 02:14:22,000 know that the interview didn't go well? 2738 02:14:22,000 --> 02:14:22,930 SARAH: Yes. 2739 02:14:22,930 --> 02:14:24,430 TOMMY MACWILLIAMS: Yeah, I think so. 2740 02:14:24,430 --> 02:14:26,800 I think you should always-- they're still 2741 02:14:26,800 --> 02:14:29,830 interested in giving you a good experience with the company. 2742 02:14:29,830 --> 02:14:32,590 Even though you didn't pass this interview, who knows? 2743 02:14:32,590 --> 02:14:36,970 You might come back a year or two later, interview again, and then do fantastic. 2744 02:14:36,970 --> 02:14:40,600 And so if the interviewer can give you a good picture of the company now, 2745 02:14:40,600 --> 02:14:42,985 that might help you say, oh, I will go reapply again, 2746 02:14:42,985 --> 02:14:44,860 because I really like the person I talked to, 2747 02:14:44,860 --> 02:14:46,943 and I've learned a lot since that first interview. 2748 02:14:46,943 --> 02:14:50,502 So yeah, I definitely say when you have a bad interview experience, 2749 02:14:50,502 --> 02:14:51,460 it happens to everyone. 2750 02:14:51,460 --> 02:14:53,620 Try not to get too down on yourself. 2751 02:14:53,620 --> 02:14:54,730 When they ask, do you have any question for me, 2752 02:14:54,730 --> 02:14:56,563 I'd still ask the prepared questions you had 2753 02:14:56,563 --> 02:15:00,175 about their day-to-day or the things that they change about the company. 2754 02:15:00,175 --> 02:15:01,550 So I wouldn't change any of that. 2755 02:15:01,550 --> 02:15:03,010 And then who knows? 2756 02:15:03,010 --> 02:15:06,345 You could see that same interviewer again a few years later. 2757 02:15:06,345 --> 02:15:08,470 DAVID MALAN: And Tomas, would you like to say hello 2758 02:15:08,470 --> 02:15:11,330 and where you're from, along with your question? 2759 02:15:11,330 --> 02:15:13,090 TOMAS: What's up, guys? 2760 02:15:13,090 --> 02:15:15,430 I've enjoyed a lot, and I'd like to know, 2761 02:15:15,430 --> 02:15:18,130 sometimes when it comes to an interview, there 2762 02:15:18,130 --> 02:15:20,860 are companies that ask you about your salary. 2763 02:15:20,860 --> 02:15:23,920 By the way, I'm from Venezuela at the [INAUDIBLE].. 2764 02:15:23,920 --> 02:15:27,460 So when it comes to interviews, there are companies 2765 02:15:27,460 --> 02:15:28,870 that ask you about the salary. 2766 02:15:28,870 --> 02:15:33,430 So is there a way to know what would be the best? 2767 02:15:33,430 --> 02:15:39,700 Because I think this was not so covering in this. 2768 02:15:39,700 --> 02:15:45,280 TOMMY MACWILLIAMS: Yeah, so how to think about salary and negotiation generally? 2769 02:15:45,280 --> 02:15:48,880 TOMAS: A way to know what would be the best amount or-- 2770 02:15:48,880 --> 02:15:52,300 because sometimes we could ask too much or too little. 2771 02:15:52,300 --> 02:15:57,320 And are we even supposed to answer that, or we can just avoid that question? 2772 02:15:57,320 --> 02:15:59,320 TOMMY MACWILLIAMS: Yeah, this one's a tough one, 2773 02:15:59,320 --> 02:16:03,850 because it's going to vary a lot by role and country and company. 2774 02:16:03,850 --> 02:16:08,260 So I can try to give some general advice that may or may not 2775 02:16:08,260 --> 02:16:10,780 be a little too US-specific, just because I'm not 2776 02:16:10,780 --> 02:16:13,660 super familiar with all the different international conventions. 2777 02:16:13,660 --> 02:16:16,420 But something that is certainly applicable 2778 02:16:16,420 --> 02:16:20,410 is before you go into a role, try to get a general sense for what 2779 02:16:20,410 --> 02:16:23,170 the market is paying for that role. 2780 02:16:23,170 --> 02:16:26,898 There's lots of sites online you can look at, whether they be Glassdoor-- 2781 02:16:26,898 --> 02:16:28,690 there's another one that's in the US called 2782 02:16:28,690 --> 02:16:34,120 Levels FYI, where people just publish, here are the ranges of what 2783 02:16:34,120 --> 02:16:35,799 I'm making at this role. 2784 02:16:35,799 --> 02:16:37,886 The company might also publish it in advance. 2785 02:16:37,886 --> 02:16:40,719 There are some sites like Angel Lists that start-up used to recruit, 2786 02:16:40,719 --> 02:16:43,090 and it's sort of a required field, is how much are you 2787 02:16:43,090 --> 02:16:46,870 going to be offering for this role? 2788 02:16:46,870 --> 02:16:52,030 So yeah, just do a little bit of research in advance. 2789 02:16:52,030 --> 02:16:54,580 I'd say try to give a range too. 2790 02:16:54,580 --> 02:16:58,642 I think some people are like, I must make at least n-amount of dollars 2791 02:16:58,642 --> 02:16:59,559 or I'm not interested. 2792 02:16:59,559 --> 02:17:01,476 I think that's usually not the right approach, 2793 02:17:01,476 --> 02:17:03,942 but giving sort of a general range, also sort 2794 02:17:03,942 --> 02:17:06,400 of talking about what you're currently making in your role, 2795 02:17:06,400 --> 02:17:09,940 and what you'd ideally like to be making more than that, having 2796 02:17:09,940 --> 02:17:14,388 your current compensation can be kind of a baseline there. 2797 02:17:14,388 --> 02:17:16,180 So I think, yeah, my general advice is just 2798 02:17:16,180 --> 02:17:19,525 to try to be honest and try to do some research in advance. 2799 02:17:19,525 --> 02:17:21,400 And then that can help you avoid this outcome 2800 02:17:21,400 --> 02:17:25,158 where you're asking for something that's way too low or way too high. 2801 02:17:25,158 --> 02:17:27,700 But yeah, every company is going to be a little bit different 2802 02:17:27,700 --> 02:17:28,780 in how they handle this. 2803 02:17:28,780 --> 02:17:31,330 Some companies want you to disclose what you're looking for first. 2804 02:17:31,330 --> 02:17:34,360 Some companies say, here's the role and the level we're going to level you at. 2805 02:17:34,360 --> 02:17:36,180 Here's what people in that role and level make. 2806 02:17:36,180 --> 02:17:37,847 It's going to be a little bit different. 2807 02:17:37,847 --> 02:17:40,062 But the research part you can always do. 2808 02:17:40,062 --> 02:17:42,520 DAVID MALAN: I think we have time for a few more questions. 2809 02:17:42,520 --> 02:17:44,650 Hope folks will forgive if we don't get to everyone. 2810 02:17:44,650 --> 02:17:47,275 We also want to leave a moment at the end for Maria and Connor, 2811 02:17:47,275 --> 02:17:50,360 if you're amenable, to offer just some final thoughts of your own. 2812 02:17:50,360 --> 02:17:53,469 But first, Aisha, if I'm saying that right, would you like to say hello, 2813 02:17:53,469 --> 02:17:56,110 where you're from, and your question? 2814 02:17:56,110 --> 02:17:59,559 AISHA: I am from Pakistan, and it's Aisha. 2815 02:17:59,559 --> 02:18:01,670 DAVID MALAN: Aisha. 2816 02:18:01,670 --> 02:18:02,170 AISHA: Yeah. 2817 02:18:02,170 --> 02:18:05,389 And first of all, I have to say that this lesson has been great. 2818 02:18:05,389 --> 02:18:09,980 I did not know most of the things, and some things really surprised me. 2819 02:18:09,980 --> 02:18:12,760 So I absolutely enjoyed this lesson. 2820 02:18:12,760 --> 02:18:19,000 And my question is does it matter, the style of the interview? 2821 02:18:19,000 --> 02:18:22,030 Does that differ if you have a different level of experience 2822 02:18:22,030 --> 02:18:26,049 or your level of your education or something 2823 02:18:26,049 --> 02:18:30,730 like that or the level of what you are, like in CS, if I'm an absolute beginner 2824 02:18:30,730 --> 02:18:33,969 or I have done really less experience, one year or two years, 2825 02:18:33,969 --> 02:18:36,129 does it matter the style of the interviewer, 2826 02:18:36,129 --> 02:18:39,129 the interviewer itself, or the assignment? 2827 02:18:39,129 --> 02:18:41,180 TOMMY MACWILLIAMS: Yeah, it's a great question, 2828 02:18:41,180 --> 02:18:43,400 so how things vary based on experience. 2829 02:18:43,400 --> 02:18:47,170 So the general setting tends to be the same. 2830 02:18:47,170 --> 02:18:50,889 Even people with a lot of experience will still ask a question of the form, 2831 02:18:50,889 --> 02:18:54,129 write a function that takes this as input and takes that as output. 2832 02:18:54,129 --> 02:18:58,487 I think the expectations will vary a bit for someone who's really new to CS. 2833 02:18:58,487 --> 02:19:01,570 The problem we ask might be a little easier, a little more straightforward 2834 02:19:01,570 --> 02:19:02,049 to solve. 2835 02:19:02,049 --> 02:19:04,007 For somebody who has more experience, might ask 2836 02:19:04,007 --> 02:19:05,667 something a little bit harder. 2837 02:19:05,667 --> 02:19:07,750 And then I mentioned before, something that you'll 2838 02:19:07,750 --> 02:19:10,660 see as you have more experience is more questions that 2839 02:19:10,660 --> 02:19:13,780 are a little more practical, telling me about how you've architected 2840 02:19:13,780 --> 02:19:18,190 some large-scale system in the past or to build something from scratch that 2841 02:19:18,190 --> 02:19:22,360 would be production-ready, where for students, they're usually more asking 2842 02:19:22,360 --> 02:19:26,170 questions about the things that you've covered in your courses. 2843 02:19:26,170 --> 02:19:28,990 Many people take a data structures or an algorithms course, 2844 02:19:28,990 --> 02:19:31,690 and so we'll ask a question about data structures or algorithms. 2845 02:19:31,690 --> 02:19:34,990 I think in general, the ideal interview and what a lot of interviews 2846 02:19:34,990 --> 02:19:37,990 do-- and hopefully they're all doing-- is looking at your experience, 2847 02:19:37,990 --> 02:19:41,870 seeing what you've done in the past, and then asking questions based on that. 2848 02:19:41,870 --> 02:19:45,200 So if you've never built a large-scale backend system, 2849 02:19:45,200 --> 02:19:47,200 asking you to build a large-scale backend system 2850 02:19:47,200 --> 02:19:48,283 doesn't really make sense. 2851 02:19:48,283 --> 02:19:51,460 I'd rather ask questions that we're going to get a lot of signal out of 2852 02:19:51,460 --> 02:19:54,760 or I'm going to understand, are you a good fit for the role I'm hiring for. 2853 02:19:54,760 --> 02:19:57,052 And if I just ask you something where you have no idea, 2854 02:19:57,052 --> 02:19:59,663 then I'm actually not getting any information. 2855 02:19:59,663 --> 02:20:01,830 DAVID MALAN: Andrew, we saw your hand go up earlier. 2856 02:20:01,830 --> 02:20:04,775 Would you like to say hello and ask your question? 2857 02:20:04,775 --> 02:20:15,320 ANDREW: My question is, can I get the job after completing university only? 2858 02:20:15,320 --> 02:20:18,320 TOMMY MACWILLIAMS: Tommy, can one get a job after completing university? 2859 02:20:18,320 --> 02:20:20,350 TOMMY MACWILLIAMS: Yeah, definitely. 2860 02:20:20,350 --> 02:20:23,470 There's lots of job opportunities that are especially 2861 02:20:23,470 --> 02:20:26,170 designed for folks who are just coming out of university 2862 02:20:26,170 --> 02:20:28,360 and haven't had any jobs before. 2863 02:20:28,360 --> 02:20:31,510 Internships can also be a great way of getting a role if you haven't 2864 02:20:31,510 --> 02:20:34,330 had any experience yet, so definitely lots of great roles 2865 02:20:34,330 --> 02:20:36,875 you can get just out of college. 2866 02:20:36,875 --> 02:20:40,000 DAVID MALAN: Nice, and can we go next to Shalom, if you'd like to say hello 2867 02:20:40,000 --> 02:20:42,120 and where you're from with your question? 2868 02:20:42,120 --> 02:20:48,430 SHALOM: My name is Shalom, and I am from South Africa, currently in Beijing. 2869 02:20:48,430 --> 02:20:53,510 My question is, I studied chemical engineering and technology. 2870 02:20:53,510 --> 02:20:56,680 So this is really new to me. 2871 02:20:56,680 --> 02:21:00,850 I recently started my course on CS50. 2872 02:21:00,850 --> 02:21:05,978 My question is, what do I study after completing that course? 2873 02:21:05,978 --> 02:21:08,020 TOMMY MACWILLIAMS: Yeah, that's a great question, 2874 02:21:08,020 --> 02:21:09,550 after CS50, where do you go next? 2875 02:21:09,550 --> 02:21:12,770 I'm sure David has thoughts on this, as well. 2876 02:21:12,770 --> 02:21:15,430 But I would say in general, for interviewing specifically, 2877 02:21:15,430 --> 02:21:20,050 any course that has data structures or algorithms written in it, 2878 02:21:20,050 --> 02:21:22,240 those can be really, really helpful, so the courses 2879 02:21:22,240 --> 02:21:26,650 where you're going to learn what a binary tree is 2880 02:21:26,650 --> 02:21:29,590 and how to implement a hash table, some of which we cover in CS50, 2881 02:21:29,590 --> 02:21:32,480 but there's more advanced data structures and algorithms. 2882 02:21:32,480 --> 02:21:36,097 So I'd say those are the most useful courses you can take for interviewing. 2883 02:21:36,097 --> 02:21:38,680 And then maybe David wants to answer the more general question 2884 02:21:38,680 --> 02:21:40,185 of where to go next. 2885 02:21:40,185 --> 02:21:42,310 DAVID MALAN: Yeah, we often recommend that students 2886 02:21:42,310 --> 02:21:47,000 explore another type of programming, functional programming, 2887 02:21:47,000 --> 02:21:49,450 object-oriented programming, keywords like those, 2888 02:21:49,450 --> 02:21:52,420 as well as a good course on data structures and algorithms, 2889 02:21:52,420 --> 02:21:53,530 for instance. 2890 02:21:53,530 --> 02:21:55,900 I'm biased, too, because I work with a whole team here 2891 02:21:55,900 --> 02:21:58,900 that produces courses that can be taken both before and after CS50. 2892 02:21:58,900 --> 02:22:02,200 But Maria, can we perhaps ask you, having been in the real world 2893 02:22:02,200 --> 02:22:06,010 as an engineer for some time, what you found most helpful after an intro class 2894 02:22:06,010 --> 02:22:08,320 like CS50? 2895 02:22:08,320 --> 02:22:14,350 MARIA ZLATKOVA: Yeah, so I think really trying to get a breadth of classes 2896 02:22:14,350 --> 02:22:17,080 out there and exploring different interests would be good. 2897 02:22:17,080 --> 02:22:20,560 When I first took CS50, some of my next classes 2898 02:22:20,560 --> 02:22:25,900 that I took were systems, operating programming, data structures 2899 02:22:25,900 --> 02:22:28,930 and algorithms, data visualization. 2900 02:22:28,930 --> 02:22:33,160 And I found a lot of the more visual and design-oriented classes 2901 02:22:33,160 --> 02:22:38,540 super interesting, so definitely got a chance to focus in on that, as well. 2902 02:22:38,540 --> 02:22:43,180 But I definitely would say that exploring a breadth of things 2903 02:22:43,180 --> 02:22:47,110 so that you can really decide what you want to hone in on and what really 2904 02:22:47,110 --> 02:22:49,297 interests you is always a good idea. 2905 02:22:49,297 --> 02:22:51,880 DAVID MALAN: And I think Tommy's emphasis on personal projects 2906 02:22:51,880 --> 02:22:54,790 earlier is important, because we see among online students 2907 02:22:54,790 --> 02:22:58,720 a real tendency to take one course, then another course, then another course, 2908 02:22:58,720 --> 02:23:01,000 and it's never really clear when it ends. 2909 02:23:01,000 --> 02:23:03,178 And it doesn't need to end, but at some point, 2910 02:23:03,178 --> 02:23:05,470 you should really leave the nest, so to speak, and take 2911 02:23:05,470 --> 02:23:07,960 on some personal project, pursue some work project, 2912 02:23:07,960 --> 02:23:11,050 so that you feel like you're actually now applying the skills 2913 02:23:11,050 --> 02:23:13,330 that you've learned in classrooms. 2914 02:23:13,330 --> 02:23:15,708 Some final questions-- can we go next to Remington, 2915 02:23:15,708 --> 02:23:18,250 if you'd like to ask your question and say where you're from? 2916 02:23:18,250 --> 02:23:19,840 REMINGTON: My name is Remington. 2917 02:23:19,840 --> 02:23:23,842 I'm currently in the UK in quarantine. 2918 02:23:23,842 --> 02:23:25,300 It's lovely to join you guys today. 2919 02:23:25,300 --> 02:23:26,890 It was super helpful. 2920 02:23:26,890 --> 02:23:29,020 I don't mean to focus too much on the resumes, 2921 02:23:29,020 --> 02:23:32,390 but it's another resume question. 2922 02:23:32,390 --> 02:23:36,550 So if I'm a student, non-CS major, and I've 2923 02:23:36,550 --> 02:23:40,720 had some internships that are not really tech-related, 2924 02:23:40,720 --> 02:23:43,870 is it more valuable to add those to kind of fill out my resume, 2925 02:23:43,870 --> 02:23:46,930 or should I really try to do more personal projects 2926 02:23:46,930 --> 02:23:49,040 and then add those into my resume instead? 2927 02:23:49,040 --> 02:23:51,250 So which one would be more valuable, is my question. 2928 02:23:51,250 --> 02:23:54,250 TOMMY MACWILLIAMS: Yeah, I would say if I had to pick between those two, 2929 02:23:54,250 --> 02:23:55,720 I would say the latter. 2930 02:23:55,720 --> 02:23:59,830 So having personal projects that are related to the roles 2931 02:23:59,830 --> 02:24:01,663 that you are applying to are really helpful. 2932 02:24:01,663 --> 02:24:04,247 So for instance, if you're applying to a web development role, 2933 02:24:04,247 --> 02:24:07,240 showing some websites you've built is really helpful. 2934 02:24:07,240 --> 02:24:10,092 And I'd say even if you only have a few, that's totally fine. 2935 02:24:10,092 --> 02:24:12,550 Fill out the rest of your space with your prior experience. 2936 02:24:12,550 --> 02:24:15,790 But an interviewer will definitely love to see something 2937 02:24:15,790 --> 02:24:18,280 that's related to the role that you're applying to more 2938 02:24:18,280 --> 02:24:20,572 than the past experience you do have. 2939 02:24:20,572 --> 02:24:23,530 So I'd say projects first, then fill out the rest with prior experience 2940 02:24:23,530 --> 02:24:24,030 you do have. 2941 02:24:24,030 --> 02:24:25,730 And definitely include that, as well. 2942 02:24:25,730 --> 02:24:29,080 DAVID MALAN: And Shaurya, if I'm saying that right, would you like to say hello 2943 02:24:29,080 --> 02:24:30,073 and your question? 2944 02:24:30,073 --> 02:24:31,240 SHAURYA: My name is Shaurya. 2945 02:24:31,240 --> 02:24:32,530 I'm from India. 2946 02:24:32,530 --> 02:24:35,890 My question was, is keeping a smile on your face 2947 02:24:35,890 --> 02:24:38,530 while the interview is not going that much well, 2948 02:24:38,530 --> 02:24:43,720 so does that affect any impact on the interviewer? 2949 02:24:43,720 --> 02:24:45,910 TOMMY MACWILLIAMS: Yeah, I'd say whether-- 2950 02:24:45,910 --> 02:24:48,850 everyone knows that interviews can be really stressful, 2951 02:24:48,850 --> 02:24:54,580 and so I don't think I've ever expected anyone to be like, totally happy 2952 02:24:54,580 --> 02:24:57,320 and not stress the whole time. 2953 02:24:57,320 --> 02:24:59,230 So I would say the best-- 2954 02:24:59,230 --> 02:25:00,980 it all comes down to communication. 2955 02:25:00,980 --> 02:25:03,040 I think as long as you're communicating clearly, 2956 02:25:03,040 --> 02:25:05,410 and you're having a good dialogue with your interviewer, 2957 02:25:05,410 --> 02:25:09,010 and you're able to share your ideas and listen 2958 02:25:09,010 --> 02:25:11,873 to feedback from your interviewer and hear their hints, 2959 02:25:11,873 --> 02:25:13,540 I think that's the most important thing. 2960 02:25:13,540 --> 02:25:17,260 But everybody's really nervous, and I wouldn't 2961 02:25:17,260 --> 02:25:20,170 recommend anyone trying to fake how they're feeling 2962 02:25:20,170 --> 02:25:24,490 or pretend to be feeling a certain way, when the reality is that everybody 2963 02:25:24,490 --> 02:25:25,900 knows that it's nerve-racking. 2964 02:25:25,900 --> 02:25:28,720 And so interviewers don't expect you to be doing that anyway, 2965 02:25:28,720 --> 02:25:30,580 and it all just comes down to communication. 2966 02:25:30,580 --> 02:25:32,330 As long as the communication is effective, 2967 02:25:32,330 --> 02:25:33,790 that's the most important thing. 2968 02:25:33,790 --> 02:25:38,020 DAVID MALAN: Let's go lastly to Pawan Kumar, if I'm saying that right. 2969 02:25:38,020 --> 02:25:38,635 My apologies. 2970 02:25:38,635 --> 02:25:41,690 PAWAN KUMAR: So thank you so much for this opportunity. 2971 02:25:41,690 --> 02:25:44,710 So my question is more on the system design level. 2972 02:25:44,710 --> 02:25:49,840 So yeah, somehow we did so much hard work for some brilliant years, 2973 02:25:49,840 --> 02:25:53,920 and somehow we were able to break the coding interviews. 2974 02:25:53,920 --> 02:25:59,020 But then we have another piece called system design, where someone 2975 02:25:59,020 --> 02:25:59,870 with my experience-- 2976 02:25:59,870 --> 02:26:04,370 I have 10 years experience, I live in the United States. 2977 02:26:04,370 --> 02:26:07,040 Though I have experience when it comes to their questions 2978 02:26:07,040 --> 02:26:11,920 on how to design a Facebook, how do you design a Twitter, yeah, 2979 02:26:11,920 --> 02:26:14,680 we design things in our site, but it doesn't 2980 02:26:14,680 --> 02:26:16,480 mean it's going to be that level. 2981 02:26:16,480 --> 02:26:20,260 So can you please give me some idea of how do I prepare for the system design 2982 02:26:20,260 --> 02:26:21,010 interviews? 2983 02:26:21,010 --> 02:26:24,135 TOMMY MACWILLIAMS: Yeah, for sure, I'll give some quick thoughts on systems 2984 02:26:24,135 --> 02:26:25,900 design interviews. 2985 02:26:25,900 --> 02:26:28,150 So generally speaking, what we're looking 2986 02:26:28,150 --> 02:26:32,380 for in a systems design interview is often something architectural. 2987 02:26:32,380 --> 02:26:35,890 So for example, you mentioned how you build the Facebook news 2988 02:26:35,890 --> 02:26:36,710 feed, for instance. 2989 02:26:36,710 --> 02:26:39,760 So we're not looking for precisely like, I 2990 02:26:39,760 --> 02:26:42,880 would use 0 mq with a fan-out architecture 2991 02:26:42,880 --> 02:26:45,010 and a multilayered [INAUDIBLE] tier for caching. 2992 02:26:45,010 --> 02:26:47,260 If you could say that, that's great, but we're 2993 02:26:47,260 --> 02:26:50,380 more concerned about architectural things, like here 2994 02:26:50,380 --> 02:26:52,510 is what the schema of the database would be, 2995 02:26:52,510 --> 02:26:54,530 here's how rows are written to the database, 2996 02:26:54,530 --> 02:26:57,640 here's where the caching layers are, what's being cached, 2997 02:26:57,640 --> 02:26:59,140 here's what's being read from those. 2998 02:26:59,140 --> 02:27:01,640 So it's almost like if the goal of a system design interview 2999 02:27:01,640 --> 02:27:05,230 is to have a diagram out on a whiteboard, 3000 02:27:05,230 --> 02:27:08,110 either verbally or literally, that explains 3001 02:27:08,110 --> 02:27:12,220 all of the major components of the system and how they interact. 3002 02:27:12,220 --> 02:27:15,460 And that's much more important than picking 3003 02:27:15,460 --> 02:27:18,580 the individual library or the sort of implementation details 3004 02:27:18,580 --> 02:27:20,140 within that diagram. 3005 02:27:20,140 --> 02:27:23,770 I think if you can speak to technologies you have used in the past 3006 02:27:23,770 --> 02:27:26,438 and say, in the past we use Kafka for message passing, 3007 02:27:26,438 --> 02:27:28,480 and here's some things I liked about it, but here 3008 02:27:28,480 --> 02:27:30,522 are some ways we're kind of broke down and things 3009 02:27:30,522 --> 02:27:33,370 like that, that experience is really valuable. 3010 02:27:33,370 --> 02:27:35,830 But for a systems design interview, we're 3011 02:27:35,830 --> 02:27:38,900 almost never looking for some really precise answer. 3012 02:27:38,900 --> 02:27:41,410 The other thing we're also not necessarily looking for 3013 02:27:41,410 --> 02:27:44,560 is exactly what part of the system you design. 3014 02:27:44,560 --> 02:27:47,770 In many cases, it's really intentionally ambiguous. 3015 02:27:47,770 --> 02:27:51,660 One that I've got in the past is, how would you make Google Maps? 3016 02:27:51,660 --> 02:27:53,560 End of question, turn it over to me. 3017 02:27:53,560 --> 02:27:54,480 And that could mean anything, right? 3018 02:27:54,480 --> 02:27:55,890 That could be the front end, that could be, 3019 02:27:55,890 --> 02:27:58,050 like, how do you implement all the scrolling. 3020 02:27:58,050 --> 02:28:01,500 It could be, how do you store all of the map? 3021 02:28:01,500 --> 02:28:05,923 There's tiles of different elevation levels and resolutions. 3022 02:28:05,923 --> 02:28:06,840 How do you store that? 3023 02:28:06,840 --> 02:28:08,463 It could be, how do you do-- 3024 02:28:08,463 --> 02:28:09,630 Google Maps includes routes. 3025 02:28:09,630 --> 02:28:11,190 How do you do route planning and traffic? 3026 02:28:11,190 --> 02:28:12,930 And it was sort of intentionally ambiguous, 3027 02:28:12,930 --> 02:28:13,860 and the interviewer was like, oh, I don't know, 3028 02:28:13,860 --> 02:28:15,660 whatever you want to design, do it. 3029 02:28:15,660 --> 02:28:19,000 You've got an hour, let's just see what we can do. 3030 02:28:19,000 --> 02:28:22,165 And so I keep that in mind, as well, that sometimes it might feel like 3031 02:28:22,165 --> 02:28:25,207 the interviewer doesn't have anything in mind, and it's because we don't. 3032 02:28:25,207 --> 02:28:27,168 We just want to see where you gravitate to, 3033 02:28:27,168 --> 02:28:29,460 because you're naturally going to gravitate, hopefully, 3034 02:28:29,460 --> 02:28:31,627 towards the thing where you have the most experience 3035 02:28:31,627 --> 02:28:33,543 and where you can design the best thing. 3036 02:28:33,543 --> 02:28:35,460 So yeah, so really focus on that architecture. 3037 02:28:35,460 --> 02:28:37,680 Focus on what are the components of the system, 3038 02:28:37,680 --> 02:28:40,350 how do those components interact, what are the abstraction 3039 02:28:40,350 --> 02:28:41,970 barriers between those systems. 3040 02:28:41,970 --> 02:28:45,540 Then if you can talk about implementation details like frameworks 3041 02:28:45,540 --> 02:28:50,160 or libraries or patterns you've used in the past, then you can do so. 3042 02:28:50,160 --> 02:28:53,987 But we're really mostly interested in architectural decisions. 3043 02:28:53,987 --> 02:28:55,820 DAVID MALAN: And Tommy, [INAUDIBLE] question 3044 02:28:55,820 --> 02:29:00,137 was about what should you do when you get frustrated and stuck with coding? 3045 02:29:00,137 --> 02:29:02,720 TOMMY MACWILLIAMS: Yeah, I think in an interview, like I said, 3046 02:29:02,720 --> 02:29:04,910 it happens to everybody. 3047 02:29:04,910 --> 02:29:07,220 It'll happen to you, and it's happened to me. 3048 02:29:07,220 --> 02:29:10,220 I think just taking a deep breath and taking 3049 02:29:10,220 --> 02:29:14,390 just a step back, just 10 seconds, take a step back and think and calm yourself 3050 02:29:14,390 --> 02:29:15,770 down as best as you can. 3051 02:29:15,770 --> 02:29:17,920 Take a glass of water if they have one. 3052 02:29:17,920 --> 02:29:20,780 If they don't, bring one so you have one. 3053 02:29:20,780 --> 02:29:22,700 And then just ask for a hint. 3054 02:29:22,700 --> 02:29:26,720 I think a lot of interviewees, when they get frustrated, 3055 02:29:26,720 --> 02:29:29,150 they sort of get angry or sort of get mad. 3056 02:29:29,150 --> 02:29:31,100 And I think it certainly might happen. 3057 02:29:31,100 --> 02:29:34,850 Just try to, as best you can, try to take a step back 3058 02:29:34,850 --> 02:29:40,090 and ask for help in a way that's sort of keeping the conversation light 3059 02:29:40,090 --> 02:29:41,890 and not becoming overly angry. 3060 02:29:41,890 --> 02:29:45,482 But it certainly can happen and has happened to me and people 3061 02:29:45,482 --> 02:29:46,940 I've been interviewing in the past. 3062 02:29:46,940 --> 02:29:50,680 So yeah, I would say if you get frustrated, just ask for a hint, 3063 02:29:50,680 --> 02:29:53,890 take a deep breath, and remind yourself that everybody fails 3064 02:29:53,890 --> 02:29:55,587 these things, that it's not just you. 3065 02:29:55,587 --> 02:29:57,920 DAVID MALAN: I have folks who still have their hands up. 3066 02:29:57,920 --> 02:30:01,760 Well, forgive if we didn't get to all questions, but in our remaining minutes 3067 02:30:01,760 --> 02:30:04,400 here, just wanted to give Maria and Connor 3068 02:30:04,400 --> 02:30:07,790 and then Tommy the final word with some final advice. 3069 02:30:07,790 --> 02:30:08,600 Maria? 3070 02:30:08,600 --> 02:30:12,590 MARIA ZLATKOVA: Yeah, I really would just say, don't be worried 3071 02:30:12,590 --> 02:30:14,180 or scared when you mess up. 3072 02:30:14,180 --> 02:30:17,900 I have messed up so many interviews, and I sometimes still think back to them. 3073 02:30:17,900 --> 02:30:21,050 And I kind of find them funny now thinking back, 3074 02:30:21,050 --> 02:30:25,010 because I really just put so much pressure on myself that it even 3075 02:30:25,010 --> 02:30:28,410 prevented me from doing well and showing what I knew well 3076 02:30:28,410 --> 02:30:30,860 and actually thinking clearly in the moment. 3077 02:30:30,860 --> 02:30:33,590 And we said this a lot, but the best way to do 3078 02:30:33,590 --> 02:30:35,690 that is to really just practice and put yourself 3079 02:30:35,690 --> 02:30:39,540 in those high-stress situations to get yourself more used to them. 3080 02:30:39,540 --> 02:30:43,760 And we believe in all of you, especially in coming to this, 3081 02:30:43,760 --> 02:30:46,770 I think you're taking the best steps that you can. 3082 02:30:46,770 --> 02:30:49,730 So it really is just about taking this and these guidelines 3083 02:30:49,730 --> 02:30:53,760 that we shared today and just practicing and really mastering everything. 3084 02:30:53,760 --> 02:30:57,500 So thanks so much for spending the past few hours with us. 3085 02:30:57,500 --> 02:30:58,750 DAVID MALAN: Thank you, Maria. 3086 02:30:58,750 --> 02:31:00,865 And Connor? 3087 02:31:00,865 --> 02:31:02,990 CONNOR LEGGETT: Yeah, I definitely agree with that. 3088 02:31:02,990 --> 02:31:05,440 I would say the biggest thing is to-- 3089 02:31:05,440 --> 02:31:09,850 even though it's very difficult, to try and be as relaxed as you can. 3090 02:31:09,850 --> 02:31:11,750 Try to have a good outlook on it. 3091 02:31:11,750 --> 02:31:17,110 One thing that I think I've found out over the last couple of years 3092 02:31:17,110 --> 02:31:19,300 that I had wished I had known going into it 3093 02:31:19,300 --> 02:31:23,740 is that a lot of the interview process is a bit random. 3094 02:31:23,740 --> 02:31:28,480 So you might get a question that you feel really confident about 3095 02:31:28,480 --> 02:31:31,420 or a question that you just have no idea what to do. 3096 02:31:31,420 --> 02:31:34,790 And there can also be interviews where you feel like you did really well, 3097 02:31:34,790 --> 02:31:37,690 and then you don't get into the next round, or interviews 3098 02:31:37,690 --> 02:31:41,390 that you feel like you bombed, and then you do get into the next round. 3099 02:31:41,390 --> 02:31:44,290 So I think that's kind of helpful to know, 3100 02:31:44,290 --> 02:31:47,990 because even if you struggle with the question for a while, 3101 02:31:47,990 --> 02:31:50,410 it's not a good idea to give up on that interview. 3102 02:31:50,410 --> 02:31:54,360 You want to keep trying, keep interacting with your interviewer, 3103 02:31:54,360 --> 02:31:57,087 and you never know what's going to happen. 3104 02:31:57,087 --> 02:31:58,670 DAVID MALAN: Well, thank you, as well. 3105 02:31:58,670 --> 02:32:00,730 And thank you to all of the team here behind the scenes 3106 02:32:00,730 --> 02:32:02,938 who've been making this possible and certainly Tommy, 3107 02:32:02,938 --> 02:32:07,000 who prepared so much of today's materials, along with Maria and Connor. 3108 02:32:07,000 --> 02:32:10,330 Tommy, final advice you'd like to leave folks with? 3109 02:32:10,330 --> 02:32:13,150 TOMMY MACWILLIAMS: Final advice, I'll say don't give up. 3110 02:32:13,150 --> 02:32:15,130 I'll never forget my first interview where I 3111 02:32:15,130 --> 02:32:16,960 was interviewing at a big tech company. 3112 02:32:16,960 --> 02:32:18,850 And we're in a building with an elevator, 3113 02:32:18,850 --> 02:32:21,940 and the two people from the interview, my interviewer and someone else 3114 02:32:21,940 --> 02:32:23,440 in the company were in the elevator. 3115 02:32:23,440 --> 02:32:26,080 And they were talking about how bad I did in the interview, 3116 02:32:26,080 --> 02:32:27,430 like, this kid was such a joke. 3117 02:32:27,430 --> 02:32:29,805 And I walked into the elevator and then took the elevator 3118 02:32:29,805 --> 02:32:32,650 down 10 floors with them as they just like stared at me, 3119 02:32:32,650 --> 02:32:34,807 and everybody knew what was happening. 3120 02:32:34,807 --> 02:32:35,890 So I'll never forget that. 3121 02:32:35,890 --> 02:32:37,300 It happens to everybody. 3122 02:32:37,300 --> 02:32:38,750 Definitely don't give up. 3123 02:32:38,750 --> 02:32:42,220 You can fail a ton of interviews before you eventually succeed, 3124 02:32:42,220 --> 02:32:43,240 and that's totally OK. 3125 02:32:43,240 --> 02:32:44,900 Everybody goes through that. 3126 02:32:44,900 --> 02:32:46,900 So yeah, you might feel like this is impossible. 3127 02:32:46,900 --> 02:32:48,220 Who can possibly do this? 3128 02:32:48,220 --> 02:32:48,910 You can. 3129 02:32:48,910 --> 02:32:50,867 Just don't give up, and you'll get there. 3130 02:32:50,867 --> 02:32:52,450 DAVID MALAN: Thank you so much, Tommy. 3131 02:32:52,450 --> 02:32:53,750 Thank you for joining us today. 3132 02:32:53,750 --> 02:32:56,970 We'll see you online for CS50 again soon. 3133 02:32:56,970 --> 02:32:58,222