Doing LeetCode Be Like (Coding Interviews Be Like Pt. 2)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] oh hey nick how was your interview with uh face flicks on sorry i i don't remember the name uh how was your interview what linear time i thought i already got the optimal solution oh um yeah it was great uh the hashmap check you gave me really helped i'm actually doing the second interview tomorrow wow that's awesome have you been grinding lead code recently yeah of course don't you think i learned from last time you know i'm actually an expert at array questions now wait array questions you know face your company is notorious for asking tree problems in the second interview right wait what so you're saying i wasted all this time hey you still got a day to study so just do some tree problems and hope for the best okay where should i start i don't know just try this one fine thanks for the help nicholas i mean you and me both know you're gonna fail either way so i thought i'd just be nice for once good luck all right let's see given the root of a binary tree return the maximum width of the given tree the maximum width of a tree is the maximum width among all levels makes sense the width of one level is defined as the length between the end nodes where the null nodes between the end nodes are also counted into the calculation aha okay oh this is easy let's just uh draw some examples so i know how to find the max width how do i code it can i use a hash map no that won't help screw it let's just look at the discussion section ugh recursion this doesn't make any sense so what you can do is suppose i have to find the weight of this level i can get the index of the last move what is this then i can get the index let's just take this paste it here boom passed good job nick that's enough lead code for today where is this guy he's already 10 minutes late oh hey nick sorry i'm late i was just outside anyways my name is nick sin and i'm a staff engineer here at vasangoogaplex congratulations on making it to the second round of interviews where we use google docs let me just drop the link in the chat and we'll get started relax nick you already know your race inside out so given an integer array find the contiguous sub-array containing at least one number of course which has the largest sum and return its sum we code problem 53 maximum sub array easy i just need to implement cdane's algorithm yeah so what we can do is iterate through the array and keep track of a local and global max and so in each iteration we'll be setting our local max to be the maximum between our current number and the sum of the current number and local max and then if this local max is greater than our global max then we'll just update the global max and so at the end we just return this global maximum this sounds like a great approach feel free to code it up sure the solution is all of n and time since we're only iterating through the array once and it's all one in space awesome this looks great yes finally this interview was even easier than the first one now let's move on to the second problem you've got to be kidding me well it'll probably be another array question anyways alright so given the root of a binary tree return the maximum width of the given tree the maximum width of the tree is the [Music] congratulations you've made it until the end of this video and i appreciate that i just want to quickly announce that we've set up a discord server for the nicholas t community so feel free to join chat with me chat with other members and we have about 170 members so far so if you want to join link is in the description and yeah hope you enjoyed the video
Info
Channel: Nicholas T.
Views: 216,132
Rating: 4.9623847 out of 5
Keywords: waterloo, university of waterloo, computer science, waterloo aif, waterloo cs, waterloo computer science, nicholas t, uwaterloo, cs major, computer science student, internship, university student, cs majors be like, software engineering internship, swe intern, waterloo coop, coding interview, technical interview, first internship, software engineering interview, coding, interview, job interview, leetcode, coding interview prep, studying for coding interview
Id: 8719-T6J4R0
Channel Id: undefined
Length: 4min 41sec (281 seconds)
Published: Sun Jul 18 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.