Acing Google Coding Interview as an 18 year old High School Student

Sdílet
Vložit
  • čas přidán 2. 05. 2020
  • For my 50k subscriber special, I did a mock Google coding interview with Clement, an ex-Google engineer. As a competitive programmer, I have a lot of experience with algorithmic problems. Check out my channel to learn more about competitive programming!
    Check out the other Google coding interview on Clement's channel: • Google Coding Intervie...
    Second channel (William Lin ++): / @williamlinpp4187
    Website: williamlin.io/
    Instagram: / tmwilliamlin168
    Twitter: / tmwilliamlin168
    Discord: williamlin.io/discord
  • Hry

Komentáře • 1,9K

  • @clem
    @clem Před 4 lety +20223

    That ex-Google coding interviewer looked impressed! 😎

    • @pranjalsoni549
      @pranjalsoni549 Před 4 lety +388

      The frontend of algo expert is one of the best I have seen .

    • @riteshrastogi5388
      @riteshrastogi5388 Před 4 lety +156

      I am not saying that the third problem is easy ; It is tough ; I did remember when I did something like that for the first time ; yes ; indeed ; it was tough.
      But the fact is ; the third problem is trivial. It is famous by the name of "Re-rooting technique" in competitive programming ; and this is what tmw used ( Plus the problem is actually simple as compared to other rerooting problems out there )

    • @Clrkz
      @Clrkz Před 4 lety +27

      @@Tacoslover770 lol 0:49

    • @kartaLaLa
      @kartaLaLa Před 4 lety +22

      Want to see tmw interview you next time 😆 It will be quite fun and challenging

    • @rahulsbhatt
      @rahulsbhatt Před 4 lety +19

      Yeah, I wonder who is he?😜

  • @kevindebruyne9218
    @kevindebruyne9218 Před 4 lety +5425

    He coded the CZcams algorithm to where more of his videos would pop up in your recommended.

  • @arjay_2002
    @arjay_2002 Před 4 lety +6717

    interviewer: does that make sense?
    him: yeeehaa
    me: wtf jus happened

    • @vuger01
      @vuger01 Před 4 lety +15

      Same :D

    • @alphonsusho8962
      @alphonsusho8962 Před 4 lety +128

      Bruh I never even code and I watched this video, and was so confused all the way

    • @alanwake4537
      @alanwake4537 Před 4 lety +15

      @@alphonsusho8962 me too.. idk why this is my recomended

    • @artarkgaming5997
      @artarkgaming5997 Před 4 lety +31

      Alphonsus Ho Even If you were an experience programmer. He’s going extremely fast

    • @aiist6743
      @aiist6743 Před 3 lety +1

      @@artarkgaming5997 mashallah tbark allah alhamdulillah inshallah better astagfirullah

  • @matildapawlega8527
    @matildapawlega8527 Před 3 lety +6430

    Bruh I feel like a useless human watching this

  • @briandesign
    @briandesign Před 4 lety +4768

    I have no idea what is going on, but I still watched the whole thing

    • @sidharth8823
      @sidharth8823 Před 4 lety +2

      Same 😂

    • @alexissorianooo
      @alexissorianooo Před 4 lety +1

      same bro

    • @OFaruk58
      @OFaruk58 Před 4 lety +10

      This is too smart and handy for his age. Or I am too dumb for my age. Because I am also 18 but can not solve those things.

    • @edwardwang9209
      @edwardwang9209 Před 4 lety +4

      @@OFaruk58 I had 0 programming knowledge at 18 lol

    • @sourabhkhandelwal1568
      @sourabhkhandelwal1568 Před 4 lety +3

      Honestly although coming up with the solution is hard but understanding what he saying is pretty easy. So, I think this comment is sarcastic.

  • @aqib829
    @aqib829 Před 4 lety +6405

    Ok. William is being humble here. Pretty sure if this wasn't an interview he would have completed all the problems in 10 mins.

    • @Qizot
      @Qizot Před 4 lety +389

      give him some vim and in 5 minutes he would be done

    • @El1as--
      @El1as-- Před 4 lety +7

      Lol

    • @ivanp4740
      @ivanp4740 Před 4 lety +219

      It's okay.
      Actually, most of the engineers, who work in G/F can complete this in short period of time(this is as easy/medium questions from leetcode) but coding interview it's not just about problem solving. So... Sure, for competitive programmers of this level, this questions is very easy, because they are easy even for not competitive programmers :D

    • @durantburner7428
      @durantburner7428 Před 4 lety +282

      Yeah but in a company in the caliber of Google it isn't just about solving the problem, it is working with your team, explaining, and collaborating.

    • @atk_2815
      @atk_2815 Před 3 lety +65

      It’s an interview, it is just as important to explain your thought processes as it is to get it correct

  • @weeeeeeeeeeeeeeee360
    @weeeeeeeeeeeeeeee360 Před 3 lety +549

    "Am I allowed to Google the solutions?"

    • @codycis
      @codycis Před 3 lety +4

      This should have more likes

    • @birchtree5884
      @birchtree5884 Před 3 lety +11

      Programming in a nutshell

    • @necaton
      @necaton Před 3 lety +6

      Google Interview in an nutshell

  • @Datnigganeo
    @Datnigganeo Před 3 lety +958

    I have no clue why I’m watching this and why I can’t stop as if I’m absorbing information, even though I’m fucking clueless as to what’s happening

    • @asian_buddie1405
      @asian_buddie1405 Před 3 lety +39

      That’s exactly what I was gonna comment 😂 literally watching the whole thing bc it’s just interesting how smart people talk to eachother

    • @Bigbossfredo_
      @Bigbossfredo_ Před 3 lety +4

      Word^

    • @gamerplay8922
      @gamerplay8922 Před 3 lety +4

      I had no idea how to do this but listening to him explain it I was like o I see what you did like I was following along and understood. Nuts! Good communication on the code.

    • @hasannahle4687
      @hasannahle4687 Před 3 lety +1

      @lil clit7 absolutely yes, he is one of the finest youtubers in the world if its not him then who

    • @Joemels
      @Joemels Před 3 lety

      I only understood the first part of the first problem

  • @limbolegs
    @limbolegs Před 3 lety +4708

    (Me who knows nothing about coding): hmm yes yes that looks good

    • @dgaf2219
      @dgaf2219 Před 3 lety +34

      Same lmfao

    • @nuclearboy5714
      @nuclearboy5714 Před 3 lety +28

      All i know is simple css code 😂

    • @pranitp.1622
      @pranitp.1622 Před 3 lety +14

      @@nuclearboy5714 lmao same
      I feel soo useless now

    • @harsh4567
      @harsh4567 Před 3 lety

      Not relatable
      Flex

    • @drunkenone1699
      @drunkenone1699 Před 3 lety +4

      I only know the most basic stuff from C and Cplusplus

  • @christianviray3176
    @christianviray3176 Před 3 lety +408

    *"The left property, the right property"*
    Me: Ahhh, yes its Real Estate

  • @Ultimaus
    @Ultimaus Před 3 lety +1156

    This coding interview is so much more practical than regular interviews. Like where do you see yourself in 5 years

    • @fruitygranulizer540
      @fruitygranulizer540 Před 2 lety +46

      there are multiple interview stages, im sure they ask those kind of behavioural and other kind of questions in later interviews. they first filter out ppl through technical interviews

    • @angelachanelhuang1651
      @angelachanelhuang1651 Před 10 měsíci +2

      law school is great for undergrad

    • @aaronhall1068
      @aaronhall1068 Před 9 měsíci

      usually, at least for all the internships Ive applied to, its the opposite. Behavioral phone interview, behavioral interview in person / on zoom, then technical @@fruitygranulizer540

    • @LettuceLand
      @LettuceLand Před 8 měsíci +5

      Obviously this is a technical interview

  • @ahsanali50
    @ahsanali50 Před 3 lety +363

    I have heard about only one tree in my life ; that is Christmas Tree 🎄

    • @shllyk
      @shllyk Před 3 lety +16

      and family tree which i made in 2nd or 3rd grade

  • @Mockedarchie
    @Mockedarchie Před 4 lety +267

    "Alright that was like a introduction question" ...... Me: "oh"

  • @gaoalexander73
    @gaoalexander73 Před 3 lety +531

    And hes a high school student, dang. I can't imagine understanding this stuff in high school.

    • @andyacevedo8270
      @andyacevedo8270 Před 3 lety +4

      Same here lol

    • @wolfgod1664
      @wolfgod1664 Před 3 lety +34

      You won’t I’m in high school and I didn’t even understand this lol

    • @ohreally4752
      @ohreally4752 Před 3 lety +13

      i’m in high school and i take some java programming classes and they still are confusing

    • @joejoe5081
      @joejoe5081 Před 3 lety +2

      @@ohreally4752 I think he uses c++ or c as his go to. Not sure though cause I found him recently

    • @k23180
      @k23180 Před 3 lety +1

      @@wolfgod1664 fr lmao

  • @abdi6189
    @abdi6189 Před 3 lety +261

    Bruh im done, im currently in my second semester for cybersecurity and after seeing this im out

    • @SuperQuarterNote
      @SuperQuarterNote Před 3 lety +16

      You can do it!

    • @houssam6249
      @houssam6249 Před 3 lety +11

      Don't give up bro

    • @kokonut5498
      @kokonut5498 Před 3 lety +4

      Bro giving up is the end of all ends. Just keep pushing even if u feel like ur not progressing

    • @varunk6633
      @varunk6633 Před 3 lety +1

      Just try to understand things topic by topic. You will be more brilliant than you know.

    • @nxh777
      @nxh777 Před 3 lety +1

      bruh don’t do it keep goin

  • @earfquake3518
    @earfquake3518 Před 3 lety +771

    “They’re speaking the language of the gods.”

  • @DanT-iu6oc
    @DanT-iu6oc Před 4 lety +2609

    > Solves leetcode medium
    > holy shit I'm so smart
    > goes on this channel
    > gives up, cries

    • @BaoGia-mi3pk
      @BaoGia-mi3pk Před 4 lety +55

      life is not fair guy, get used to it

    • @ThatGuy56326
      @ThatGuy56326 Před 4 lety +144

      God damn 18 year old gets this problem instantly im sitting here like 👁👄👁

    • @hnwlightsugar2280
      @hnwlightsugar2280 Před 4 lety +69

      cant solves even the homework, goes on leetcode easy, can't solve it , give up, cries.

    • @bombbchu
      @bombbchu Před 4 lety +59

      how long do you guys think he has been coding? Life is indeed not fair but you must understand that coding is a skill that takes years and years of practice to get to this level.

    • @ThatGuy56326
      @ThatGuy56326 Před 4 lety +82

      a_bombchu pretty sure his mom had a god damn computer in her womb

  • @DeadManRunning1
    @DeadManRunning1 Před 3 lety +286

    interviewer: "so now let's move on to something completely different"
    ...
    "so let's go back to that binary tree..."

    • @koshey245
      @koshey245 Před 3 lety +3

      Well to be fair it's almost shifting the entire try, so the tree isn't really static anymore persay

    • @shadon_official2510
      @shadon_official2510 Před 3 lety

      Lmaooo

  • @hontonix1413
    @hontonix1413 Před 4 lety +348

    Interviewer: *speaks coding language*
    Him: *explains coding*
    Me: yes that makes sense now

  • @CarlosPerez-te4gx
    @CarlosPerez-te4gx Před 3 lety +123

    Hey guys this is so legit I tested w Google interview and failed but the way this video is presented feels exactly how I felt during my interview. Good luck to you if you are planning to interview =)

  • @miguelrevera6856
    @miguelrevera6856 Před 4 lety +80

    A more eloquent solution for Prompt#2
    For each node, add the sum of (original full tree) depth and re-iterate down to zero adding those sums also.
    e.g. Node#8: its original depth is 3, therefore we know it can be used in up to 3 (sub) trees, each time decreasing in depth. So the total from this node is 3+2+1+0 = 6. The same for Node#9. Node#5 would be 2+1+0 = 3.
    Add for all nodes and you get 26

    • @abhinavreddy3204
      @abhinavreddy3204 Před 4 měsíci

      yep i had the same idea, using a map we can store depths of every node from root node and then we can just do dfs from root node adding contribution of every node i.e n*(n+1)/2 , where n is depth of the node from root node .

  • @hesselbleeker6353
    @hesselbleeker6353 Před 4 lety +687

    i don't even know what he's doing but i like it

  • @junoc-s1720
    @junoc-s1720 Před 3 lety +353

    CZcams finding yet another way to make me feel like an idiot

    • @RSolfactory
      @RSolfactory Před 3 lety

      Tbf it doesn't need much inspiration

  • @---------------------------__

    11:56
    William: "Does it make sense so far"
    Clement: "Yes"
    Me: No. I haven't understood anything.

    • @inordirection_
      @inordirection_ Před 3 lety +5

      It's okay, Clement said yes to keep the interview moving along but he was lost more often than he let on.

  • @MriLevi2
    @MriLevi2 Před 3 lety +316

    So much fun to see. Still in my first year of studying programming, but it's so fascinating to see him think. Very organized way of thinking and obviously very smart too. Hoping I'll be as fluent with it as him in a few years!

    • @jaeseonghan1691
      @jaeseonghan1691 Před 2 lety +8

      hows your journey of programing going so far

    • @justyashin476
      @justyashin476 Před rokem +8

      How’s it been

    • @OneLordeAnimeClips
      @OneLordeAnimeClips Před 7 měsíci +3

      @@justyashin476 He's too busy architecting a solution to the knapsack problem to respond to us plebs

  • @bradvan8156
    @bradvan8156 Před 3 lety +1336

    Me: *furiously typing*
    Interviewer: what’s going on? I’m not seeing anything on the Google Doc?
    Me: *on stackoverflow*

  • @bradvan8156
    @bradvan8156 Před 3 lety +856

    *interview starts for Google *
    Interviewer: alright let’s get started
    Me an intellectual: can I use Microsoft Word instead of Google Docs?
    Interviewer: Get out

  • @brettkruskie2699
    @brettkruskie2699 Před 3 lety +9

    After I watched your interview with Clement, I was so impressed. Your ability to solve this complex problem was very inspiring. You had me subscribed from day 1. Continue to code!

  • @Zorro9129
    @Zorro9129 Před 4 lety +717

    He is the chosen one to take down Google

    • @mr.washingtonsbuddy.8454
      @mr.washingtonsbuddy.8454 Před 3 lety +18

      You were supposed to destroy them, not JOIN them!!!

    • @Choconuss
      @Choconuss Před 3 lety

      he looks like the lil Asian key maker in Matrix in that tiny room!! just way younger lol

  • @codearabawy
    @codearabawy Před 4 lety +13

    I'm happy for you, William! I wish you all the best :)

  • @CharlieAligaen
    @CharlieAligaen Před 4 lety

    Just watched your Mock interview with Clèment. Great job! I'm very impressed. I started coding for fun. Subbed! Looking forward to your future videos!

  • @pilarmaealcazar5139
    @pilarmaealcazar5139 Před 4 lety +1

    Wow inspiring, more video like this please for learning purposes. Thank you! 🙏🏻

  • @nursultandzhumabaev8943
    @nursultandzhumabaev8943 Před 4 lety +255

    Just imagine Clement wrote the problems in text with all the inputs...William would solve all of them like in 10min xD

    • @snehilkumar10
      @snehilkumar10 Před 4 lety +6

      Well, thats coding round. Its more like interview simulation. Interviewer dont give question in paper. They will give you example and then start with all your butt power..

  • @whitesalmon0925
    @whitesalmon0925 Před 4 lety +958

    as a high school student ???
    Me: OK, shredding my university degree right now.

    • @fjdjzfhrsut8063
      @fjdjzfhrsut8063 Před 4 lety +9

      Nah man at least you got a degree. :/

    • @coolmonkey619
      @coolmonkey619 Před 4 lety +161

      Lol. Too bad you can't shred your student loans too

    • @nightshark1156
      @nightshark1156 Před 4 lety +81

      That's like seeing Michael Jordan play basketball and then going home and burning your hoop! People are better at things than you, but that doesn't mean they're better than you.

    • @ralphlagos4210
      @ralphlagos4210 Před 4 lety +18

      He's been at it for a lot longer than most, so he deserves it. US Competitive Coding medalist.

    • @maplestoryinchinese
      @maplestoryinchinese Před 4 lety

      @@coolmonkey619 LMAO

  • @ndntm
    @ndntm Před 4 lety +79

    "just high school student" - funniest shit i've ever heard. Common high school student doesn't have almost 3k CF rating

  • @dimsumpizza4746
    @dimsumpizza4746 Před 3 lety +113

    This must be how aliens feels like when they hear our language

  • @jazzymichael
    @jazzymichael Před 4 lety +95

    I thought I was doing well because I could solve the first part... then they kept adding more and more complexity and I couldn't keep up lmao. I have to re-watch the second half of this video, great job.

    • @lilcraz851
      @lilcraz851 Před 2 lety +1

      At least u solved the first part

  • @leoxiaoyanqu
    @leoxiaoyanqu Před 4 lety +51

    William is definitely being humble and acting like in a real interview (slow down and communicate). Great to watch. Thanks for sharing.
    I actually came up with BFS in mind first and wonder am I missing anything here if using BFS (for the first two prompts)?

  • @justicewillprevail1106
    @justicewillprevail1106 Před 9 měsíci +1

    Great job!!!! I see a bright bright future ahead of you.

  • @kakokapolei123
    @kakokapolei123 Před 3 lety +343

    11:57
    "Does that make sense so far"
    "Yup"
    What you don't see is him quietly going on StackOverflow wondering what the hell he just said

    • @joaolourenco5279
      @joaolourenco5279 Před 3 lety +4

      Dudee the kid is impressive considering the fact he is in high-school, but this video is what you learn in like the 1st year of computer science in like 2 chapters (graphs and threes) in the subject algorithms and data structures.

    • @putinsgaytwin4272
      @putinsgaytwin4272 Před 3 lety

      @@joaolourenco5279 how does this apply to software engineering?

    • @joaolourenco5279
      @joaolourenco5279 Před 3 lety +1

      @@putinsgaytwin4272 it's because you are manipulating data structures with algorithms, ex:heaps.

    • @Arobisme
      @Arobisme Před 3 lety +2

      @@joaolourenco5279 but when I've been graduated for 5 years and haven't done a single thing with trees since then. I forgot it all

    • @tusharsrivastava370
      @tusharsrivastava370 Před 3 lety +1

      @@joaolourenco5279 no it's not... And also it depends on your own tendency to grasp that stuff... I had data structures and algorithms in my 2nd year of college( I'm in 4th currently) and 95% of my classmates still don't know shit about it .. although I'm pretty good at it but the teachers in my college didn't teach us how to code it... They just taught it on a theoretical level and expected us to code it out ourselves... well of course it's better doing it on your own instead of someone teaching you the whole code but this is one of the reasons my friends still don't know shit about it lol

  • @nathanc9050
    @nathanc9050 Před 4 lety +59

    24:19 Clement smiles when tmw makes progress 🙂

  • @matthewwatts2338
    @matthewwatts2338 Před 4 lety +3

    For the 3rd problem, since you're only asked to return the sum of distances to the target node, I don't think you need another dfs. In the first dfs you updated the target node with the info you need. So after dfs1, ans = p.second - (target->sz) + (p.first - target->sz).

  • @eccomusic1386
    @eccomusic1386 Před 2 lety +2

    wow Bro . William's voice is so soothing .
    I can listen to his voice at night and fall asleep . I'm not implying that it is boring , instead it is very relaxing and it gives me tingles (like ASMR) .

  • @thearlowolf7336
    @thearlowolf7336 Před 3 lety +2

    Idk anything about coding but this video made me want to learn how to code! I been trying to find a hobby but this is fascinating and fantastic job!

  • @unconsciousmarty9393
    @unconsciousmarty9393 Před 3 lety +162

    And here i am 24 years old jobless getting rejected in all interviews

    • @xertz4267
      @xertz4267 Před 3 lety +30

      better days to come brother... many of us in the same situation. keep you head high!

    • @voltage3692
      @voltage3692 Před 3 lety +3

      Bhai koi baat hmare bhi din ayenge

    • @TapThatBootie
      @TapThatBootie Před 3 lety +13

      Same here... got my bachelors back in October and still no job offers, only interviews with role play crap...

    • @sanjayk7661
      @sanjayk7661 Před 3 lety

      But your Sharma ji ka beta🙃

    • @CFCMAMO1
      @CFCMAMO1 Před 3 lety +7

      Keep optimistic my friend. It will come.

  • @iskandarsiraj9627
    @iskandarsiraj9627 Před 4 lety +169

    I’m watching this while eating even tho I don’t understand nothing but deep in side hoping I can understand what’s goin on 😂😂

    • @humzauddin6692
      @humzauddin6692 Před 3 lety +1

      bro same. the guy says: yeeeaaapppp, me : hmmmm nice.

    • @bulldozer8950
      @bulldozer8950 Před 3 lety +2

      Exactly maybe I’ll just gain some of this knowledge just through osmosis. Kinda like trying to eat your study guide before the test

  • @jatinkm
    @jatinkm Před 3 lety

    You came up with the optimal solutions so quick!

  • @fernandomendes9914
    @fernandomendes9914 Před 4 lety

    Great Job William continue!

  • @rexcchao1759
    @rexcchao1759 Před 4 lety +2560

    william seems to struggle with english more than the problems itself lol

    • @nexus5648
      @nexus5648 Před 4 lety +127

      I mean, English isn’t his first language so...

    • @mixedmaniac7957
      @mixedmaniac7957 Před 3 lety +140

      He's struggling with speaking itself more than the problem being language specific. The reason for that is because he's speaking while thinking of an actual solution to say on the spot.

    • @austindabomb9
      @austindabomb9 Před 3 lety +18

      He has better English than the interviewer or more understanding and that’s his second language

    • @nickwilson3499
      @nickwilson3499 Před 3 lety +102

      @@Milength when people ask him what languages he speaks, he says them in order of proficiency. First he says 1,200 programming languages then his native language then English.

    • @user-iy5zs4xs1n
      @user-iy5zs4xs1n Před 3 lety +13

      @@nexus5648 it probably was im not sure. he got medal in IOI for the US and just graduated in Taipei American school(one of the most expensive schools in Taiwan)

  • @zeroplays9915
    @zeroplays9915 Před 3 lety +16

    *I feel Like I got Smarter and big-brainier just by watching this guy ace this interview!*

  • @yousefbeiruty6417
    @yousefbeiruty6417 Před 3 lety

    That's a hard question good job I am keeping watching your videos are so helpful improving my skills in understanding problems.

  • @mukulpanchakarla8944
    @mukulpanchakarla8944 Před 4 lety +1

    Keep up the good work clement..could you please make a video on commanly used approaches or ways to solve competitive programs with william

  • @amitnegi361
    @amitnegi361 Před 4 lety +7

    A much simpler solution for the second problem would be to just change one line of code from the first problem.
    ans += dep
    Becomes
    ans += dep * (dep+1) /2
    which is the summation of all number 1 to dep.
    The logic behind it is that the node at depth 3 will be part of 3 subtrees. And the corresponding depth of that node for those subtrees will be 1, 2, 3. Similar for nodes at depth 1 and 2.

    • @Eric-bp3tc
      @Eric-bp3tc Před 9 měsíci

      Thanks buddy, now kindly go back to being a neet

  • @JA-jz2zj
    @JA-jz2zj Před 3 lety +7

    he was hired at 30:10, jittery with voice change, lip bite, hair adjustment and turns of camera ... now that is nerd for love.

  • @obamaobamna811
    @obamaobamna811 Před 2 lety

    Inspirational AF. Both of them hella good at what they do

  • @pratickbhowmick4796
    @pratickbhowmick4796 Před rokem

    Thanks, this was quite instructive!

  • @furroni9471
    @furroni9471 Před 3 lety +20

    Imagine being qualified for Google after High School. Nice work, I will follow your channel and see your progress, it's really interesting.

    • @user-gq7sv9tf1m
      @user-gq7sv9tf1m Před 3 lety +5

      Being qualified and acing the technical part of the interview are different things

    • @jasonstarrising
      @jasonstarrising Před rokem +1

      bro he is OVER qualified

    • @user-tz9jh6pv2j
      @user-tz9jh6pv2j Před 2 měsíci

      @@user-gq7sv9tf1m You'd be surprised. I have a classmate at Stuy HS who graduated with us at 15... he went to MIT and finished by 18. We were class of 2008. He was a VP at Google by 22.

  • @unfrigginbelievable
    @unfrigginbelievable Před 3 lety +9

    Bruh this guy already has an interview with Google at 18, meanwhile I’m turning 18 in a few months and going to start collage in a few months for my CS degree with very little programming background 💀

  • @ritam8767
    @ritam8767 Před 3 lety +2

    The first question can be seen easily as a sequence. Each node in the rth row has depth (r-1) and there are 2^(r-1) such nodes. So it's just the sum of (r-1)*2^(r-1) where r goes from 1 to n, where n is number of rows. Correct me if I'm wrong.

  • @josephpark2093
    @josephpark2093 Před 3 lety

    I swear, I had also learned of everything in what was said here from an Algorithms book but I don't know it as thoroughly as him. I enjoyed this!

  • @blameneeks
    @blameneeks Před 3 lety +15

    That “and 5” really was his time to shine

  • @MrBUDGIESROCK
    @MrBUDGIESROCK Před 4 lety +50

    Im not the only one mesmerized by his pen flipping, right?

  • @Holyblades1982
    @Holyblades1982 Před 4 lety +4

    I am sitting here at 4 in the morning and this came across my feed and I felt I had to watch the entire thing. I have been in IT since I was 14 and I will say I had no idea what the hell was going on the entire time lol. Took coding in high school but I knew in a few days it wasn't for me. Props to you man.

    • @soldiers303
      @soldiers303 Před 3 lety

      Same with me. First time I tried coding in Uni knew it wasn't for me. I guess it's one of those things, that you either understand or don't.

  • @richardhorvatichfittrader

    I wish you would make videos themed on how you got good. Timeline, skills acquired, projects from first to recent, how long do you practice daily, what have you studied, what do you suggest for people to get good or to your level?

  • @vebexplaeya
    @vebexplaeya Před 4 lety +46

    {0:16} Everyone's Gangsta (top right) until they see *Great Great Grandmaster* preparing for coding interview

  • @will-ye
    @will-ye Před 4 lety +18

    The colab we never knew we needed

  • @ameriaitrend
    @ameriaitrend Před 3 lety +39

    Check profile: IOI winner. Check video: calculating depth of nodes...seriously?

  • @pa8l0kool3
    @pa8l0kool3 Před rokem +1

    im drunk rn but i will pay ALL my attention to this video, normally id for sure not watch this video bc of my pride but i LOVE this type of content bc i actually understand it. THANK YOU WILLIAM

  • @ArmanSydikov
    @ArmanSydikov Před 4 lety +47

    Finally joining William Lin Fan Club, I hope tmw spirit will give me strength

  • @isaacmedlin1731
    @isaacmedlin1731 Před 3 lety +3

    I'm coming up in my senior year of college for software and I feel like I could of came up with these solutions but not nearly as fast. With a whiteboard and 3-5 hours it would be possible, but this guys quick with his thought process

  • @milochenmilochen
    @milochenmilochen Před 2 lety +4

    For the 3rd question, even adding the parent node is helpful for using DFS/BFS to solve the problem, but your creative thinking for this question is so cool and the coding for the last question is so amazing. If the interviewee ask to figure out all sumDist for all node, then this solution only need O(N). But the way to add parent node will need O(N^2).

    • @karankumarmageswaran1550
      @karankumarmageswaran1550 Před rokem

      adding parent node would be really helpful, but i'm not so sure an interviewer would allow it. the stuff he added can be directly calculated without changing the input type using functions he previously created. adding a parent node, however, cannot be done without changing the input, or creating a new function to store the parent node for every node

  • @lonelypotatojinneverfound378

    "Does it make sense?"
    No, it doesn't but still gonna watch it

  • @hpeets9116
    @hpeets9116 Před 4 lety +10

    Very entertaining William. I watched the whole thing, couldn't understand the other dude tho. I guess you should take the AP CS test for me now thanks!!!!!

  • @aryatyagi4648
    @aryatyagi4648 Před 4 lety +78

    _MEANWHILE MY TEACHER - TAKE INPUT AND PRINT THE EVEN NO._

    • @Slade69
      @Slade69 Před 3 lety +11

      Also palindrome.

    • @prakashsharma5306
      @prakashsharma5306 Před 3 lety +4

      Fibonacci series

    • @code5829
      @code5829 Před 3 lety

      That is why I’m dropping out when I turn seventeen. Waste of time.

    • @yagnapatel3912
      @yagnapatel3912 Před 3 lety +4

      @@code5829 A Highschool diploma is still important to have. As someone with many siblings I’ve seen how hard it can be for someone even with a college degree to find a job. Please don’t drop out.

    • @yiyi2949
      @yiyi2949 Před 3 lety +2

      @@code5829 listen to the comment above me. Wishing you the best

  • @AnRovik
    @AnRovik Před 3 lety +1

    I'm actually a little jealous... I wish I had your passion at that age. Super impressive either way, you're an inspiration!

  • @Pensive_117
    @Pensive_117 Před 2 lety +3

    Practice and passion makes someone good at something? Woah, I would've never guessed.

  • @getreadyforthepunch3474
    @getreadyforthepunch3474 Před 4 lety +25

    i really thought this was an *interview* oh well this just passed through my feed lol

  • @broefkip
    @broefkip Před 4 lety +24

    And I'm just sitting here: "Yea, I've got a big tree at home too!" I got lost so fast... :/

  • @omanx-
    @omanx- Před 4 lety

    Nice Video!!

  • @shikharsav
    @shikharsav Před 2 lety +143

    I do work at Google (as or writing this), but these are my personal thoughts. First of all I want to say great job Clement and William. I have really enjoyed your videos and want to thank you guys for the great content. William, you are definitely impressive and have a very good chance of acing your Google Interviews if you choose to give them.
    One issue in these interviews is the subconscious bias - Clement knows how good William is so even though he tries to be fair and unbiased he is more likely to give William the benefit of the doubt than an average interviewee would get. For instance the solution for the 3rd problem has some issues - they are pretty basic ones and something that are trivial to catch if you're coding in an IDE (can you spot them?). Still that's something that I (and I guess the average Google interviewer) would bring up after the candidate has written code. Won't impact my hiring decision though.

  • @gianni50725
    @gianni50725 Před 3 lety +21

    Man he got an IOI silver medal, this has to be pure lightwork for him lol

    • @username_kk2177
      @username_kk2177 Před 7 měsíci

      He got top in the world the next year too 👀 This guy's insane

  • @masteryehudi7031
    @masteryehudi7031 Před 3 lety +5

    When he says, "hmmm, k so... k so I think..." that's equivalent to about 4 days of thinking time for me

  • @bigkurz
    @bigkurz Před 4 lety

    Dang bro you killed that problem. Highly impressive

  • @user-hc1hh8er6i
    @user-hc1hh8er6i Před 7 měsíci +2

    this guy nailed it easily .. he's young, sharp, still flexible .
    I wish parents was more caring about their children learning good stuff in their free time instead of wasting time on social networks and wasting time on other stuff ..
    this guy is amazing . I wish my kid one day will be even x10 sharper ! XD

  • @vaibhavmishra4505
    @vaibhavmishra4505 Před 3 lety +43

    For Prompt 2, an easier approach would be to find the depths of each individual node and just add their sums of AP up

    • @shivanshchakrawarti9289
      @shivanshchakrawarti9289 Před 9 měsíci +1

      yes was wondering why he didn't do that , he just needed to update one line

    • @arthg893
      @arthg893 Před 9 měsíci

      @@shivanshchakrawarti9289 can you explain that to me? i’m a bit lost, and if you could can you let me know how he added the mode depth and how they got 16 and 26

    • @brianchallita1050
      @brianchallita1050 Před 7 měsíci

      The complexity of this algorithm would be huge

    • @shivanshchakrawarti9289
      @shivanshchakrawarti9289 Před 7 měsíci

      No
      @@brianchallita1050

    • @RegisteredLate123
      @RegisteredLate123 Před 7 měsíci

      exactly

  • @verbatimpcs
    @verbatimpcs Před 3 lety +15

    I lost when clement said everything is readable..i wish i can understand this..

  • @BuddyReviewTruyen
    @BuddyReviewTruyen Před 3 lety

    U're really a monster algorithms and coding ... niceee

  • @lotr_may
    @lotr_may Před 3 lety

    Congrats William! You crushed it at IOI!

  • @debadiptobiswas5611
    @debadiptobiswas5611 Před 4 lety +55

    how I aced google interview (as a high schoolernaire)

  • @bri-bri8536
    @bri-bri8536 Před 3 lety +4

    I had no idea what was going on...but i found it interesting and watched the whole thing

  • @z08840
    @z08840 Před 2 lety

    for last problem - if you make tree non-directional (by adding parent pointer to each node) you can treat any node as a root for whole tree and apply solution of the second problem

  • @jasper5016
    @jasper5016 Před 9 měsíci

    I loved your video on Clem's channel. I subscribed to your channel. Hope to learn a little bit from you :)

  • @amansinhparmar3336
    @amansinhparmar3336 Před 4 lety +178

    Clement is everywhere!

    • @tuanva6484
      @tuanva6484 Před 4 lety +9

      Like covid :))))

    • @kunal_chand
      @kunal_chand Před 4 lety +12

      His connections are pretty strong.

    • @clem
      @clem Před 4 lety +123

      I'm even in this comment thread! 😏

    • @54M4R7H
      @54M4R7H Před 4 lety

      @@clem 🤯

    • @devendrasingh4776
      @devendrasingh4776 Před 4 lety +1

      @@clem 🤣🤣 nice algo expert...

  • @SriNiVi
    @SriNiVi Před 4 lety +6

    I did quite a few mock interviews from a few engineers from Amazon. TBH, if i aint doing it for the job, its really hard to push myself through the problem to get to a satisfiable approach with optimisation and stuff. But you did a great job over there considering you are really young. Envious.

  • @YouTuber-vl7dw
    @YouTuber-vl7dw Před 4 lety

    Bro I love ur content

  • @flandechocolate9675
    @flandechocolate9675 Před 2 lety +1

    crazy how freaking brilliant some people are

  • @josephhernandez7462
    @josephhernandez7462 Před 4 lety +3

    Next video, William interviewing Clement because William is the boss now.

  • @patrickzhang1961
    @patrickzhang1961 Před 4 lety +3

    William, is it possible for you to do some algorithm tutorials videos? I really want to learn from you

  • @brandijohnson1326
    @brandijohnson1326 Před 4 lety

    Good job young man!

  • @francischempa6418
    @francischempa6418 Před 2 lety

    The best way to follow these videos is to pause at the beginning when the problem is stated and solve it yourself. In most cases I use a different approach. After that, I watch the rest of the video just to learn why the interviewee used a different approach from mine, I will be comparing both approaches, analyzing the pros and cons of both methods.