Google Coding Interview With A College Student

Поделиться
HTML-код
  • Опубликовано: 25 дек 2019
  • In this video, I conduct a mock Google coding interview with a college student, Tim, who's preparing for software engineer intern interviews. As a Google Software Engineer, I interviewed dozens of candidates. This is exactly what a real Google software engineer interview looks like. This is also the type of coding interview that you'd get at any other big tech company.
    Check out the video we made on Tim's channel: • Good Programming Proje...
    Prepping for coding interviews? Practice with 85 video explanations of popular interview questions and a full-fledged coding workspace on AlgoExpert: www.algoexpert.io (use "clem" promo code for a discount!)
  • НаукаНаука

Комментарии • 1,7 тыс.

  • @clem
    @clem  4 года назад +575

    Big thanks to Tim for being willing to do this coding interview in front of all of RUclips! Check out the video we did on his channel here ruclips.net/video/pjJuqWWqEDI/видео.html, and here are a few timestamps for the coding interview:
    0:00 - Introduction
    2:09 - Intro chat
    3:03 - Interview starts
    49:12 - Interview ends (overtime starts)
    52:58 - Debrief
    59:40 - Conclusion

    • @michaelanggriawan8131
      @michaelanggriawan8131 4 года назад +5

      Hi , clement. I would like to buy algoexpert after I buying this course is there period of validity ? or once I buy that course i can use it forever ?

    • @clem
      @clem  4 года назад +6

      @@michaelanggriawan8131 You'll have access to AlgoExpert for 1 year after you buy it; hope to see you on the platform soon!

    • @riteshrastogi5388
      @riteshrastogi5388 4 года назад +16

      Hello Clément Mihailescu !
      I want to ask something. Don't you think that the candidate over complicated the solution. I know its a bit easy when I am not put right into the test ; but still when I took a first look at the problem ; I found an easy way to it.
      What we can do is convert all times to minutes. Means that if we have time 00:28 ; we can say that this is eqivalent to minute number 28 in the day. If we have time 1:30 ; we can say this is minute number 90 in the day.
      Generalization can be for time hh:mm ; minute number : hh*60 + min. And now instead of having time slots as time slots ; they are just n slots of the form l to r ( inclusive ) ; and l and r are integers.
      Now the time when we could not meet is the union of all intervals ( Union like we do for sets ).
      So every minute in the day minus this union is the free time ! we just will need to do two things :
      1 : Do this union operation properly
      2 : Convert back the free minutes into slots of free times.
      well task 1 is a standard problem ; while task 2 is the reverse of what we did before !
      For union operation ; I can suggest that we could declare a bool array and make its size = 24 * 60 = number of minutes in a day. Mark all non-free times using false ; and the times that are still true are free times in the day.
      So space complexity is O(1) constant = 24 * 60 bytes ( not a lot ) ; and time complexity = O(n * 24 * 60 ) again not much even if one does perform union operation in a naive way ; althogh there are better ways to do the union operation and complexity can surely be improved I think. One way to improve the union operation is to use the difference array ! It allows updates in range sum in O(1). And thus time complexity could be taken down to O(n).
      Thus using difference array -
      Space complexity - O(24 * 60 )
      Time complexity - O(n)
      Difference array tutorial can be found here : www.geeksforgeeks.org/difference-array-range-update-query-o1/
      What you say of this solution ?

    •  4 года назад +1

      Even a senior developer would not have written in 45 minutes I am sure I am c# developer if get some time with c# developer could you one round of interview like this and even on system design interviews as well please

    • @rahulxcronos8168
      @rahulxcronos8168 4 года назад +1

      @@clem sir tell me question..in written form... i am not understanding ur voice ..... plsss write here question... and i like this type videos...

  • @BrosOfPranks
    @BrosOfPranks 4 года назад +5873

    This dude is being interviewed for a job at Google and is using Firefox for the interview! What an absolut madlad!

    • @dotnetdevni
      @dotnetdevni 4 года назад +102

      BrosOfPranks u do realise it says mock interview.

    • @BrosOfPranks
      @BrosOfPranks 4 года назад +417

      @@dotnetdevni of course I do, I just thought it would be funny anyways

    • @Poison69
      @Poison69 4 года назад +127

      He's also using Linux, firefox is a better choice there.

    • @tubewoodycool
      @tubewoodycool 4 года назад +125

      @@Poison69 firefox is a better choice on microsoft too

    • @aandhereitgoes
      @aandhereitgoes 4 года назад +34

      I'm watching this on firefox :)

  • @TheVideomaster138
    @TheVideomaster138 4 года назад +2707

    I feel like I would instantly forget everything I ever learned about coding in an interview like this :/

    • @rjose705
      @rjose705 4 года назад +13

      Me Too

    • @AlexDMI1982
      @AlexDMI1982 4 года назад +242

      I forgot how to write "Hello World", by watching this

    • @samahsaeed1261
      @samahsaeed1261 4 года назад +1

      I felt the same 😂😅

    • @47Mortuus
      @47Mortuus 4 года назад +125

      Yeah because then, in that very moment, you realize it's not about coding at all - it's about the ability to solve problems.
      Coding is "just" a language.

    • @gokusgames
      @gokusgames 4 года назад +12

      That why u do practice interviews

  • @boggeshzahim3713
    @boggeshzahim3713 4 года назад +4226

    Microsoft Word is my favorite IDE

    • @alexandrb6397
      @alexandrb6397 4 года назад +319

      Mine is sheet of paper

    • @joshuatube2255
      @joshuatube2255 4 года назад +134

      Mine is air

    • @Endrit719
      @Endrit719 4 года назад +167

      mine is documents rename field

    • @clem
      @clem  4 года назад +1299

      Mine is the RUclips comment section.

    • @PaleOrchid
      @PaleOrchid 4 года назад +28

      my favorite IDE is cmd

  • @DaPokeBoss
    @DaPokeBoss 4 года назад +2883

    Why am I watching this I’m a biology student

    • @kevincorrigan1754
      @kevincorrigan1754 4 года назад +95

      Same, honestly have no idea wtf goin on

    • @kennethwiinintendo
      @kennethwiinintendo 4 года назад +47

      As an bioinformatician I found this useful af xD

    • @DanielNyong
      @DanielNyong 4 года назад +43

      @@kennethwiinintendo wtf is that lol

    • @Filelor
      @Filelor 4 года назад +42

      Because the media told us to learn to code.

    • @steveschaninger2535
      @steveschaninger2535 4 года назад +27

      @@DanielNyong basically analytics using Crispr, MoTor, and other gene sequencing software to locate certain genes within DNA libraries and such.

  • @TechWithTim
    @TechWithTim 4 года назад +1920

    Thanks again for doing the interview Clement! I learned a lot and got some great practice. Hope everyone enjoyed :)

    • @pragyakulshresth8828
      @pragyakulshresth8828 4 года назад +15

      Impressed, You are a genius Tim.

    • @kevund16
      @kevund16 3 года назад +13

      Just when you are wondering why many programmers are losing lots of Hair..........., And doing coding with thousands of people watching takes guts, Well done Tim!

    • @kasineva9983
      @kasineva9983 3 года назад +2

      Tech with Tim, I love your channel, I was shocked that I saw your face on another channel

    • @Nervosa80
      @Nervosa80 3 года назад +3

      In my opinion, Tim did well considering his level of experience at the time. I know Tim started coding at like age eleven but coding and system development, (especially on the fly, and for an audience,) are two completely different animals altogether. It was interesting to watch Tim almost come of age in this one “interview.” Nice job, Tim! Great collaboration. Very informative. I admire both of you guys a ton. And, I watch your channels all the time. Tim, Clément, love you! Keep creating great content! 🤜🏼🤛🏾

    • @ismailfaturrohman5887
      @ismailfaturrohman5887 3 года назад

      Sooo good

  • @lightlysal
    @lightlysal 4 года назад +290

    Friend: What do you watch in your spare time?
    Me: It's complicated

    • @razorhxh7371
      @razorhxh7371 3 года назад +4

      underrated comment

    • @piano-fe4bv
      @piano-fe4bv 3 года назад +1

      Hahaha what a mood

    • @sharjeelahmed7913
      @sharjeelahmed7913 2 года назад

      how exactly is it complicated? If anything it's useful and people could learn something from it

    • @lightlysal
      @lightlysal 2 года назад +1

      @@sharjeelahmed7913 mate it's a joke

  • @joelo3907
    @joelo3907 4 года назад +1053

    People: If you dont watch movies or shows, what do you watch?
    Me: Google coding interviews

    • @floop7624
      @floop7624 4 года назад +11

      wait shit tf am I doing I'm boutta pirate a movie or smthn

    • @cammikula6863
      @cammikula6863 4 года назад +4

      mostDEV feel this

    • @VincentOldMark
      @VincentOldMark 4 года назад +1

      my man

    • @Mistyfgdf
      @Mistyfgdf 3 года назад

      Hentai

    • @quirkyquester
      @quirkyquester 3 года назад +1

      Love it! You are not alone loll haha

  • @nicholasjohnson9765
    @nicholasjohnson9765 4 года назад +860

    For 19 years old, he did really well. At 19, I was just learning basic programming principles. Didn't even have any concept of time or space complexity yet. Good job.

    • @hyanbatista3281
      @hyanbatista3281 4 года назад +101

      I'm a 22 years old Brazilian student and I've just finished my first semester at CS and I can't do what this guy do yet. That's a shame but I'm jealous of his intelligence. It's really bad feeling like your whole existence is a waste kkkkkk

    • @feo130
      @feo130 4 года назад +55

      @YoshiPeach Mario 100%. A lot of folks start doing this as literal children. By the time they are in university, it's no longer gibberish to them.

    • @keithdenzelroque2072
      @keithdenzelroque2072 4 года назад +28

      @@hyanbatista3281 ye in the end it's all experience, and if you do feel down about someone being better than you just simply acknowledge your intelligence, not to bring you or anyone down since this also goes for me but if you think you're lacking knowledge then simply strive to get better and try to fix your problems. In the end even relearning the basics would help you accomplish or solve any problems about the harder ones, again coding is not a simple job where you do the same thing everyday but as time goes by you're building up those experiences, it's like driving for example where you struggle at first but at the end you can even talk with someone while driving or even drive like a maniac and I think it goes for coding as well.

    • @gracewood6768
      @gracewood6768 4 года назад +5

      We all know that coding is same as math. We all have different solutions but same answer. The competition just goes into the time complexity of the code

    • @ActuallyAudacity
      @ActuallyAudacity 4 года назад +7

      I learnt time and space complexities when I was 17. I understood the logic behind the question and was trying the question myself and actually did the combining od the calendars and comparing times before Clement hinted it but the thing I struggled a little bit with was the actual coding behind it.

  • @MarioMastar
    @MarioMastar 3 года назад +298

    I have to say, this video may have helped me get a job at Microsoft. I always froze at the technical interviews focusing SO much on solving the problem mentally, but seeing how Tim takes the time to explain his thought process and then write out his plan, then solve it, I tried that myself and got far more positive reactions even when I wasn't able to compile the code in time.
    It goes to show, Interviewing is a skill that can be learned and this video is mega useful for learning what people are looking for.

    • @James-yz4cc
      @James-yz4cc 2 года назад +14

      Speak your thoughts, especially if you got stuck. That helps the interviewers know you and guide you toward the solution. This comes really important in real work scenarios.

    • @brandonnguyen9082
      @brandonnguyen9082 2 года назад +4

      Did you get the job!??

    • @cutiefeet2528
      @cutiefeet2528 2 года назад +1

      @@brandonnguyen9082 😁

  • @nicktaylor1003
    @nicktaylor1003 4 года назад +922

    Ive been told these interviews are:
    30% - can you solve this problem in code
    70% - how does the candidate problem solve, what is their personally under pressure, can they catch their own mistakes.

    • @is1hair
      @is1hair 4 года назад +81

      It would make sense. However, I feel like the 30% is more of a deal breaker if you aren’t actually capable of solving the problem lmao.

    • @drunkenfarmer2513
      @drunkenfarmer2513 4 года назад +81

      @@is1hair Most people getting hired fail to solve the problem in these interview
      fyi: When I say fail, I mean not doing it the most efficient way but it can also be a complete fail.
      Tips: Start by solving the problem with a naive approach and then work you way down to optimize. Even if you cant get the most efficient way, the interviewer will see how you can solve a problem. If you just show the best solution first try, the interviewer won't see enough of your thinking and might think you just remembered most interview problems solutions without knowing why they are the better option.

    • @Menaceirl
      @Menaceirl 4 года назад +43

      @@is1hair Actually in some cases, interviewers (not necessarily good interviewers) set you up to fail, and see how you handle the process of solving something incorrectly and it going wrong.

    • @is1hair
      @is1hair 3 года назад +3

      Johannes Terzis lmao, fair enough, I suppose. Out of curiosity, what are you looking for when you say you’re looking for ‘how’ they solve the problem?

    • @shera2667
      @shera2667 3 года назад +4

      @@drunkenfarmer2513 you are absolutely right , In my last interview he gave me one question which need binary search , I directly answered it,

  • @hunter1801
    @hunter1801 4 года назад +576

    Just tell me when you want to have the meeting and I'll adjust my schedule....

    • @maskahleo
      @maskahleo 4 года назад +9

      lol

    • @waszp1
      @waszp1 4 года назад +34

      ...drop the mic... leave the room...

    • @PrinzeUsman
      @PrinzeUsman 4 года назад +4

      my Favorite comment

    • @sheimypazserpa5454
      @sheimypazserpa5454 3 года назад +1

      😂😂😂

    • @n_fan329
      @n_fan329 3 года назад

      you killed me
      Sheimy Paz Serpa
      😂😂😂

  • @Skater1234282
    @Skater1234282 4 года назад +1648

    And then there’s me getting an error in my hello world program 🤣😅

    • @alexjimenez6452
      @alexjimenez6452 4 года назад +33

      feel you bro

    • @S4NTIS0
      @S4NTIS0 4 года назад +28

      you are not alone

    • @x000s2
      @x000s2 4 года назад +7

      I can't CS to save my life!

    • @yummyishere
      @yummyishere 4 года назад +22

      sometimes when I'm trying to experiment I just want an output to be error so I know exactly what is "that" capable of doing, so if I get some output I'd expect, I'm just like "fine, whatever", but when I get error or some crazy stuff as output, then I learn much more, because I know what I can't expect from "it" to do. so in my opinion, errors and crazy outputs makes you better programmer.

    • @n124ajdx
      @n124ajdx 4 года назад +2

      i didn't have problem with the " hello,world" .
      but the first time i got a bug was when i was making my first GUI with Tkinter .
      later i find that the solution was so easy that i was thinking how stupid i was

  • @harispapadopoulos4295
    @harispapadopoulos4295 4 года назад +202

    Those mock interview are the best thing ever. So useful. Keep up the great work Clement!

  • @cimbonda24
    @cimbonda24 4 года назад +6

    Great Channel. What I appreciate in your "interview" videos is the fact that you concentrate a lot on the interaction between interviewer and interviewee.
    Making clear the problem is a huge factor, there actually you get your answers for your solution. I hope all the students that are looking for an internship are watching this.
    Wish you good luck with the channel, very good content!

  • @Imsemble
    @Imsemble 4 года назад +2721

    "Military time" aka the time the rest of the world uses.

    • @driipz5027
      @driipz5027 4 года назад +131

      most of the world doesn't actually use military time

    • @tl469
      @tl469 4 года назад +349

      @Driipz That's totally incorrect. Most countries in the world use the 24-hour-clock. Only the US and a few other countries do not.

    • @driipz5027
      @driipz5027 4 года назад +69

      TL Oh I’m sorry, I guess I need to do my research

    • @smcalpha
      @smcalpha 4 года назад +17

      @@tl469 Exactly!

    • @Dylanm94
      @Dylanm94 4 года назад +27

      Aka the good time

  • @daphneloustalet9792
    @daphneloustalet9792 2 года назад +25

    I’m a CS student and I’m struggling… But honestly it’s validating to stumble upon these videos and watch them around every six months as the coding jargon gradually becomes an intelligible language that makes sense. It’s honestly quite beautiful.

  • @venkatasriharsha4227
    @venkatasriharsha4227 2 года назад +25

    1 year ago when I saw this video, I thought this is way above my head. But now I feel this is so simple and I can spot that logic just on seeing the question. The reason for this is practice, it brings u the confidence that u need to move ahead.

    • @kios1973
      @kios1973 2 года назад +1

      how did you practice?

    • @fabiajero
      @fabiajero Год назад +2

      Also, the reason is because once you saw the answer to the problem, it's difficult to forget the core of the solution, and next time you review the problem, it's much easier. The tough part is when you have to figure out a problem you haven't seen before.

  • @Grr1967
    @Grr1967 4 года назад +11

    Amazing video, really gives a reliable picture of what an interview is all about. I actually paused it and came out with a nice solution to the first approach that Tim suggested. I think that by holding the numbers in a class containing the start/end times (instead of [0] and [1] indexes), and adding some useful functions to it like a function that takes another object of that class and gives you the overlapping time between them as an object of that class - the code may become much more elegant and readable (I believe even more readable than the single list approach) but naturally much more difficult to do in 45 minutes time unless if you're very used to creating those handy classes naturally. Thanks so much for uploading it, and good luck Tim!

  • @gmcfalls
    @gmcfalls 3 года назад +2

    What a great problem. I'm going to try to do this in one pass by starting with the person with the earliest start time and then track gap time based on the meeting starts and ends without any internal loops. It was very helpful listening to your discussion/feedback. Algoexpert sounds like something I need to try out.

  • @gideonokyeremensah6647
    @gideonokyeremensah6647 4 года назад +1

    I really love this video. It is very informative. I also want to say that Tim did so well in nailing the framework of the solution to the problem and finally writing such a code not too complex to understand.

  • @francisconogales2644
    @francisconogales2644 4 года назад +18

    wow! I was so excited to resolve this exercise by my own skills, this guy really good

  • @ericjhuneespa3381
    @ericjhuneespa3381 4 года назад +22

    I'm a fan of this two guy . I've been following this channel and also tim

  • @francisaiello6197
    @francisaiello6197 4 года назад

    What a great video Clement and Tim you've got a lot of courage tackling this while videotaping. Great job...

  • @Vampenji1012
    @Vampenji1012 4 года назад +40

    This reminds me (just a tiny bit) of the interview I've got for a full time job.
    Except it was a general culture thingy instead of an actual algorithm to create.
    That was a great video ! :)

  • @michaelmaybe9
    @michaelmaybe9 4 года назад +8

    As a prospective high school student looking into CS, I really enjoyed this. I think problem solving like this is just so interesting and I could imagine myself pursuing a job that's problem solving heavy like this. Thank you very much, great content!

  • @charleskhedia242
    @charleskhedia242 4 года назад +394

    Me in 58 minutes
    Printf; ("hello)

    • @EpochIsEpic
      @EpochIsEpic 4 года назад +17

      Charles Khedia that ones gunna need a bit more work lol

    • @abskamo7483
      @abskamo7483 3 года назад +10

      for i in range(1,10000000000000000):
      print("I want to learn machine learning and AI")
      i+=1

    • @noahnolte7288
      @noahnolte7288 3 года назад +14

      @@abskamo7483 you don't need increment I in a for loop.

    • @ikramrafi6481
      @ikramrafi6481 3 года назад +1

      Lol

    • @bluesteel1
      @bluesteel1 3 года назад

      @@abskamo7483 y the increment tho?

  • @youcefouadjer855
    @youcefouadjer855 4 года назад +4

    Hello Clément thanks for sharing those tricks with us, and please keep making free content like this you are a source of inspiration for many college students and developers in many countries.

  • @not_proton
    @not_proton 3 года назад +7

    I would say this is the most realistic coding interview in this channel. Others, who came here (like William lin) were godlike in their algorithm and coding skills, Tim certainly is more relatable candidate. I am about his age, and studying in college (in 2020) too. So, awesome experience for me

  • @CarlosRodriguez-vg2ob
    @CarlosRodriguez-vg2ob 4 года назад +476

    Well my self esteem has been destroyed

    • @vladventura1928
      @vladventura1928 4 года назад +42

      Same, I actually feel like I'm hot garbage straight from the nearest dumpster. I'm 22, one semester away from an associates (transfering to umass lowell for bachelors) and i felt pretty good about myself until i watched this. oh well; congrats to him, his effort has paid off

    • @yashpandey350
      @yashpandey350 4 года назад +10

      @@vladventura1928 Mine too. I was thinking that Google is peanut butter but after watching this I understand that I've to do so many things to get that position.👍👍👍👍👍

    • @Skryzeeful
      @Skryzeeful 4 года назад +4

      @@yashpandey350Google hires top talent, ofc it's the ones who put in that extra effort and go the extra mile that get in FANG.

    • @bobsmith-ty5pp
      @bobsmith-ty5pp 4 года назад +4

      even more so because he's 19 haha

    • @dex8137
      @dex8137 4 года назад +5

      Solving lots of problems should help big time imo

  • @bossbuckgaming
    @bossbuckgaming 4 года назад +8

    One note, as you are going through your logic I would recommend as I like to do, building out a scaffold with comments documenting your "thinking out loud" in sudo logic. This way when you get into code mode, it is much easier to retrace your steps. Food for thought! Great video! It was super interesting learning how Google does it.

    • @Ruktiet
      @Ruktiet 2 года назад +1

      Good advice. Also: where you write "sudo", you probably mean "pseudo", which is indeed pronounced like "sudo". Not trying to be a know-it-all, just correcting you if you're open to that and if you weren't already aware.

    • @adidavid5287
      @adidavid5287 2 года назад

      @@Ruktiet Well actually sudo is used in unix so they probably just mistakenly used the wrong spelling.

  • @Evilshrimp02
    @Evilshrimp02 4 года назад +1

    Thank you for this information. Every time I thought I understood how to solve the issue. I was wrong again. But I'm glad I got to learn how to go about a situation like this. Thank you guys for taking your time to do this. Have a wonderful afternoon.

  • @User36282
    @User36282 2 года назад

    I paused this video as soon as you asked him the question and although it took me a while, I managed to solve it. It's funny, I spent ages trying to figure it out in code, then I just drew it out on paint and solved it in a few minutes, then just had to transfer it into code, which was much easier after solving it by drawing it. I'm loving these problems, I think you're getting me addicted to them. Every single video of yours now I'm pausing and doing them. They are really fun questions!

  • @hetav6714
    @hetav6714 4 года назад +567

    Title: "Interview with a college student"
    TIM is no ordinary college student, don't believe me watch his videos. He teaches much better than my prof!!

    • @gartekk1987
      @gartekk1987 4 года назад +140

      Yeah this is not like an interview with an ordinary student, hell not even with an ordinary programmer candidate would look like. He has a nearly flawless and extremely quick thought process when coming up with a solution. Normally there would be much more silence, stumbling and thinking. Not even mentioning coming up with a solution while constantly talking, I am unable to do it properly and I actually work as a Python dev.

    • @killerlpacman_1852
      @killerlpacman_1852 4 года назад +20

      Hetav PANDYA makes me feel a lot better cuz holy heck was he great!

    • @killerlpacman_1852
      @killerlpacman_1852 4 года назад +1

      gartekk1987 I just finished a semester in college and I really enjoyed working with python. What are some locations or places that I would use python as the main writing language?

    • @gartekk1987
      @gartekk1987 4 года назад +5

      @@killerlpacman_1852 If you are asking me about specific locations in like US, where Python is used by a lot of companies, then I am unfortunately not your guy, as I live and work in Poland. If you want to know fields where Python can be used then the big ones are AI/Deep Learning, Big Data/Data Analytics and Web Development, but Python can pretty much be used nearly anywhere, even form embedded programming.

    • @triparadox.c
      @triparadox.c 4 года назад +6

      @@gartekk1987 You just GAVE ME HOPE

  • @neeraj1bh
    @neeraj1bh 4 года назад +5

    Was subscribed to Tim long time ago happy to see a collab between you ✌🏻☮️

  • @brandijohnson1326
    @brandijohnson1326 4 года назад +1

    Good job Tim and good luck on your future interviews!

  • @vince.j
    @vince.j 3 года назад

    Wow, it's a nice example of coding interview. Recently I've got a invitation of Google foobar challenge while I was working as a Internship, and your videos are really helpful. I hope I can make it through the interview!

  • @chriscarlisle8997
    @chriscarlisle8997 4 года назад +86

    I'm going to follow along and pause the video before Tim works on an answer and see how I solve it vs how he did and how long it takes me. Thanks for putting out this content, it is very helpful!!

    • @clem
      @clem  4 года назад +49

      That's a great way to extract as much value as possible from these mock coding interview videos!

    • @saadafshar
      @saadafshar 4 года назад +3

      did u do it?

    • @efrainmoreno1154
      @efrainmoreno1154 4 года назад +39

      Sadegh Afshari no it’s been a month now and he’s still working on it

    • @devdin8157
      @devdin8157 4 года назад +3

      @@efrainmoreno1154 lol

    • @watchout1435
      @watchout1435 4 года назад +2

      @@efrainmoreno1154 lol

  • @lechium02
    @lechium02 4 года назад +4

    I'm always impressed by coders intuition, i've tried coding several times and it never quite clicks with me. Props to everyone out there who has the skills for it.

    • @splash1490
      @splash1490 4 года назад

      stephen _q practice, practice, practice

    • @LosTresPollos7
      @LosTresPollos7 4 года назад

      In my opinion, this capacity for intensive critical thinking in a super short time frame comes as a result of lots of testing ones own knowledge. He is a CS college student, so he is constantly being tested on his code and his abilities, and the sheer amount of projects you do and the objectives you try to accomplish manage to pull an impressive amount of intuition out of you. The kind of highly time-sensitive intensive programming skill required at these interviews is something he has likely been developing for years, even without knowing it.

  • @user-mr8uz4ju7e
    @user-mr8uz4ju7e 4 года назад +2

    This is so fun!! Wish there would be more mock interviews!

  • @reidyoung298
    @reidyoung298 4 года назад

    Loved this video, guys. Great work and GOOD LUCK Tim!

  • @BalefulStriker
    @BalefulStriker 4 года назад +15

    I have an Interview coming up for the Google internship. This is really going to help. Thanks man love the channel

    • @clem
      @clem  4 года назад +1

      Glad you found the video helpful, and good luck on your interviews!

    • @Asuraedits
      @Asuraedits 4 года назад +2

      Baleful Strike how did it go? all good?

  • @jerritanderson212
    @jerritanderson212 4 года назад +3

    Interesting question. I am happy to see something different! I am sick of seeing recursion questions. Took maybe 1.5 hours around 100 lines of code used c#. I actually ended up doing what Tim wanted to do originally before you changed his mind. I found it more logical as a human to take this approach! You find the available time with both schedules (inclusive of the day start and end boundaries). These results are passed into a method that finds overlapping available time of the schedules. The overlapping spare times are compared with the meeting length requirements to produce the suggested time slots. Highly re-usable and writing it like this I can compare more than 2 schedules for availability (Even could specify who can and cannot make it during a time slot).

  • @benjamindavidson3344
    @benjamindavidson3344 4 года назад

    Dang as I was watching this I had that thought right before you said it. He should merge to one list first. So much easier watching a coding interview than it is doing one. This is a great video.

  • @blastoice9281
    @blastoice9281 3 года назад

    Great video! I found coming out with a logical solution is not that hard but the coding, oh boy as u mentioned its quite a headache due to the fact that we presented with quite a lot of information and one is under the pressure of the interview.

  • @brettmcintyre6329
    @brettmcintyre6329 4 года назад +97

    “That’ll append our pointers”
    Huzzah! A man of culture

    • @TheCarmacon
      @TheCarmacon 4 года назад +2

      Why "append" instead of "increase"?

    • @gutymarquezrocks17
      @gutymarquezrocks17 4 года назад +4

      @@TheCarmacon I'm guessing that it's because he writes in Python

    • @ashleybrown2698
      @ashleybrown2698 3 года назад

      how pythonic of him

  • @almaring2839
    @almaring2839 4 года назад +4

    Quick useful info for comparing time strings when it is in military format, there is no need to convert the string into hours and minutes, one can actually just compare the two strings with normal string comparison operators and the result would be as expected.

  • @MuMu124
    @MuMu124 4 года назад +1

    That was so great it gave me confidence to be confident when im u0 for my interviews

  • @everything_programming7096
    @everything_programming7096 3 года назад

    This is great man, I definitely got down the coding but the on the fly type of interview can be very scary. I have to keep coding and learning to be the very best I can be.

  • @farhan787
    @farhan787 4 года назад +4

    @Clement your mock interview videos are awesome and we love it and we want to see more of it, just a suggestion that you can pick your top performers from AlgoExpert and interview them on RUclips. I'd love to see this on RUclips and I'm sure people would too :-)

    • @clem
      @clem  4 года назад +5

      This is a really cool idea! Thanks for the suggestion; I'll see what I can do 😛

  • @nikhilt3755
    @nikhilt3755 3 года назад +32

    now tim works in microsoft
    few years later
    tim : microsoft coding interview with bois

  • @linhvu6905
    @linhvu6905 4 года назад

    Yet another great video from Clement. I've already purchased both agoexpert and systemexpert and the ROI has been over expectation thus far. here is my approach to the problem in the video.
    Personally took me about a year to learn stuff by myself, with stuffs like codewars, kaggle and recently algoexpert. The algoexpert data structure crash course is crucial, I recommend people to watch them everyday until they finally grasp the ideas. I don't have great work ethics or talented at all, and have been playing video games consistently, but as I combined watching the videos and solving algoexpert and problems on codewars, I've been able to progress, and progress is everything. Even the easy problems on algoexpert have been quite hard for someone without the basics of data structures like me, and watching the crash course as well as doing related codewar problems has been TREMENDOUS (codeforces is just way too hard to be honest). I truly believe that everyone with interest in programming should use algoexpert and watch clement youtube videos, and codewars DOES help a lot imo.
    Here is the approach I would take for the problem in the video (I personally think this problem is probably not that difficult, because i have hardly been able to solve problems on codewars and algoexpert on paper without throwing a lot of stuff at the wall, and the problem clement gave errichto is just... impossible for me). Also if you're a newbie that have been learning python and wanting to learn js (like me), algoexpert and codewars is really the way to go!
    # add a 1 for each time block of 1st person, and a 2 for each of the 2nd person, for easy comparison
    person1 = [[10:20,12:15,1],[12:20,14:15,1],etc]
    person2 = [[11:20,12:15,2],[13:20,14:15,2],etc]
    full_list = combine the 2 lists [[10:20,12:15,1],[11:20,12:15,2],etc]
    convert all time into int like ([1020,1215],[1120,1215]) (easy)
    result = []
    i = 0
    while i full_list[i+1][0] and full_list[i][2] != full_list[i+1][2] : # if one is 1 and the other is 2 then the 2 time blocks belong to 2 different people
    curr_list = full_list[i] + full_list[i+1] #all 4 items of the 2 time blocks considered
    sort curr_list
    result.append(curr_list[1],curr_list[2]) #the middle 2 elements of curr_list automatically becomes the result regardless
    i += 1
    merge overlapping items in result list and return result.

  • @ahmedturki9415
    @ahmedturki9415 4 года назад

    thank you Clément good job and continue to do this kind of video :) !!

  • @takurotim3496
    @takurotim3496 4 года назад +86

    I think it is funny that the GOOGLE interview is on Linux on firefox and the headphone he is wearing are Apple Airpods

    • @aphotic3181
      @aphotic3181 4 года назад +9

      Fun fact, most google employees use linux

    • @henrylecompte4533
      @henrylecompte4533 3 года назад +1

      Aphotic Of course, their servers run on Linux so it makes way more sense to use a UNIX system vs ChromeOS lol (or Windows)

    • @takurotim3496
      @takurotim3496 3 года назад

      @@henrylecompte4533 jup makes sense... but they do make Google Pixel buds etc.

  • @YashSharma-uw8dn
    @YashSharma-uw8dn 4 года назад +90

    I am currently having an interview. This was just what I needed!

    • @clem
      @clem  4 года назад +11

      Perfect timing!

    • @benwincelberg9684
      @benwincelberg9684 4 года назад +149

      You should probably focus on your interviewer

    • @scepto43
      @scepto43 4 года назад +10

      yeah what are you doing why are you on your phone

    • @S4NTIS0
      @S4NTIS0 4 года назад +11

      So, how did it go?

  • @jasper909
    @jasper909 4 года назад

    Only having listened to the explanation so far and not the implementation required, this very much reminds me of an in band list approach to a memory allocator.
    After having seen the sample input/output it reminds of comparing posting lists in boolean retrieval.
    I would start at the beginning of the earliest bound given and try to find the first block available, then cycle through the other person's calendar up to a point equal, schedule, or up until the earliest past the original available block and then switch back again etc.

  • @quirkyquester
    @quirkyquester 3 года назад

    Thank you Clément ! This is valuable content!

  • @ICeyCeR3Al
    @ICeyCeR3Al 4 года назад +68

    I can confirm CS students deal with a lot of of calendar and comparison problems lol

  • @sadfool
    @sadfool 4 года назад +132

    I feel stressed watching this LOL

  • @WaslooSx
    @WaslooSx 4 года назад

    randomly saw your vid and i really liked it a lot! subscribed you both

  • @gracey9024
    @gracey9024 3 года назад +1

    i love clement's smile of like proudness when tim get's on the right track its fckn adorable

  • @boggeshzahim3713
    @boggeshzahim3713 4 года назад +65

    I've landed the job I wanted but I still get super stressed seeing videos like this.

  • @rakshit3515
    @rakshit3515 4 года назад +146

    Easy looking questions with deep algorithms inside.

    • @Adam-de8jm
      @Adam-de8jm 4 года назад +45

      “This is so easy he can just..... wait no that doesn’t work”

    • @emirs769
      @emirs769 4 года назад +23

      @@Adam-de8jm literally every time i try to solve an algorithm

  • @jatinpatil2428
    @jatinpatil2428 3 года назад

    Big thanks to you , because of you I again got motivated about programming

  • @limlimminhkhai
    @limlimminhkhai 4 года назад

    Thank you for created a video as reference. I learned something new to day :)

  • @grelgen
    @grelgen 4 года назад +6

    how i'd do it:
    1. create list of meeting segments with length = meeting time from max(start_times) to min(end_times)
    2. start on list 1, cut segments from available list that fall within each unavailable segment
    3. repeat for n
    4. create available meeting times from joinable meeting segments
    unless this was server side work in which case i would just redo the oracle so that it could all be done in sql

  • @cartshub
    @cartshub 4 года назад +3

    Having my video call google interview in two days and this helped me get a good insight into how it's like. THANKS!

  • @KingUnity22
    @KingUnity22 4 года назад

    Im glad i could keep up. It would take me a little longer to formulate that solution, but remember once a solution is thought up, putting it in code is much much easier

  • @ayubhaji2441
    @ayubhaji2441 3 года назад

    I enjoyed this I like how well tim did try his best to explain how he thinks will work. Well that a goal for me to thrive for, to get better at knowing how to communicate my answer rather than just writing something I dont know how it would work. A small lesson and advice from ones struggles😅.

  • @rdius4822
    @rdius4822 4 года назад +44

    20:40 That moment of realisation.

  • @FadeStrategy
    @FadeStrategy 4 года назад +40

    We had this question as an assignment during our second programming course in comp sci & software engineering :D

    • @Filelor
      @Filelor 4 года назад +13

      My first thought was how is Tim going to gain Clement's Google calendar auth token -_-

    • @Vageta1999
      @Vageta1999 4 года назад +3

      what school do you go to?

  • @rpavanshetty
    @rpavanshetty 4 года назад

    Loved the session, an insightful one. Please continue. ❤️

  • @nmanohar
    @nmanohar 4 года назад

    Best part was them using Apple headphones😀Do. Appreciate the effort here, to boldly go where not may googlians has gone before. Thanks for sharing and helping future candidates. Love googles approach to hire great problem solvers. 👍

  • @Seawolf159
    @Seawolf159 4 года назад +12

    At the beginning i thought, what the hell, isn't this really simple? But to see Tim struggle made me actually think, maybe it's not that easy.

  • @jay_ta708
    @jay_ta708 4 года назад +6

    this will probably be one of the best internship/job related interview videos i will ever see! thank you both!

    • @clem
      @clem  4 года назад +3

      Wow, I’m glad you found it so useful!

  • @codearabawy
    @codearabawy 4 года назад

    Good job, Tim! wish you the best!

  • @iismitch55
    @iismitch55 8 месяцев назад

    Noticing the time outside the shift is just a meeting really cleans things up. The other thing, if you know what calendar each time belongs to and whether it is a start or end time, you can line each individual time up in an array and loop through 1 time using 2 booleans for availability status of each person.

  • @Feinschmacker
    @Feinschmacker 4 года назад +5

    I would do it actually a little different:
    First find the maximum day starting boundary. In this case person 2.
    Set currentTime to this day boundary
    From there
    1. go to other persons calender
    2. check if they have time : (find first meeting ending over your current time. see if according starting time is less then current time)
    a if they have time
    a1 get from each calendar the lowest starting time of a meeting >= current time (if no meeting get day end boundary)
    a2 select the minimum of both as currentEndTime
    a3 add element currentTime, currentEndTime to available time frames
    a4 set currentTime = endTime of meeting which started earlier and repeat from 1
    b if they have no time
    go to ending of the meeting currently in and repeat from 1
    3. elimate timeframes less then needed time

  • @ateamcoolboy5815
    @ateamcoolboy5815 4 года назад +23

    The collab i was waiting for!!!How did you read my mind Clement???

    • @clem
      @clem  4 года назад +15

      Wait, you didn't know? Clement the Mind Reader Mihailescu didn't give it away? 😎

    • @CUBKITS
      @CUBKITS 4 года назад

      Nice pfp

  • @Sam-yu4ve
    @Sam-yu4ve 4 года назад +1

    You just need to take the earliest start time of a meeting and merge it with the latest start time of a meeting (for both calenders) whenever the two calenders clash at any time. 30 minute slots can be created within the inital bounds for whenever the calenders do not clash.

  • @chilly2171
    @chilly2171 2 года назад +1

    when comparing 2 blocks , get the max start time, compare it to the min end time and check if there's enough to have a meeting, if there's enough to have a meeting, add the array of max start time to min end time to the output.

  • @radrad5119
    @radrad5119 4 года назад +234

    I feel like Google would benefit from just creating their own collaborative coding environment as a replacement for Google Docs in this situation

    • @maakkz
      @maakkz 4 года назад +9

      Rad Rad there’s google collaboratory, I use it to test short, simple programs in python at work on google chrome bc IT doesn’t let us install anything :/

    • @codypatnaude9171
      @codypatnaude9171 4 года назад +12

      Tons of environments DO exist for this purpose. I've interviewed at FAANG companies and have never once been asked to code in a word processor

    • @nav_pk
      @nav_pk 4 года назад +24

      Because the aim is not to see if the interviewee can write a runnable code because sometimes they mess up the syntax or have typos or whatever, they can always google it even at work. The aim is to check if the candidate can come up with a logical solution that works and has the ability to translate that to an understandable pseudocode, something you'll have to do at the job. Sure, Google can come up with something for that but why invest time and money on something that Google docs does well already.

    • @codypatnaude9171
      @codypatnaude9171 4 года назад +5

      @@nav_pk sure, but you could use an editor that doesnt spell check and capitalize on new lines. Same reason I don't write code on my phone.

    • @zakridouh
      @zakridouh 4 года назад +3

      @@codypatnaude9171 during proper google interviews they turn off spell check and calitalize new lines and all the "auto" features. its essentially a textpad.

  • @Freakarium
    @Freakarium 4 года назад +7

    1st function: find the possible start times and durations for each person based on their schedule and limitation (working day duration etc)
    2nd function: find values within the array of starting point of a person falls between starting point plus duration of the meeting (30 min) of the second person starting point and endpoints of second person is greater then first person

    • @xephyr2371
      @xephyr2371 4 года назад

      Giorgi Giorgadze english pls

  • @chrisogonas
    @chrisogonas 4 месяца назад

    Useful and informative! Thanks folks.

  • @kobodera8261
    @kobodera8261 3 года назад

    Very interresting. I have not watched this past the initial problem (but I will).
    What I did was to turn the times into pure numbers (minutes). I then added mock appointments from 0 to the "start time" of each individual, and also "ending appointments" for the individual with the shortest schedule from the their end time to the other individuals end time. This way all the times where nobody was working was "filled" and as such would not be part of the equation.
    After that I just when from each array to check if the last value matched the first value of the next one. If it did then do nothing, if they differed then I added the numbers from the last end point to the next starting point, thus creating a schedule with nothing but spare times.
    After checking which spare times was big enough to fit the meeting time required it was a simple job of turning the interval numbers back to times.
    Now I am very interrested in seeing how Tim sovled it :)

  • @iggy9121
    @iggy9121 4 года назад +3

    Hello everyone! I came across this video today and found the problem very interesting! So what I decided to do, was pause the video after Clement gave Tim the sample input/output and coded it myself (to skip to the point, I attached my Java solution below)! I did everything in a google doc and it took me 45 minutes to write the solution.
    Once I had written the solution, however, I wanted to check my answer! Thus I moved everything over to my IDE and changed the auto-capitalization from google doc and other errors such as me missing parenthesis and such. But voila!
    Once I fixed all of the general typing/spelling errors, I ran my code and it succeeded! It produced the same output as the sample output given in the video.
    I thought that some of you may be interested in seeing a working solution, so here I am providing mine! I wrote my solution in Java and here is the google doc link of the cleaned code. Also, in case you were wondering, I wrote the documentation as I was solving the problem. I did not go back afterward and add the comments.
    Enjoy! This was an awesome problem to solve!
    docs.google.com/document/d/1O9oAP24bnS5T4uoVxjcJL7CPtHxjKWalXwen_VVeDRY/edit?usp=sharing
    P.S. I'm a junior at the University of Washington, double majoring in Computer Science and Comprehensive Physics, just incase you we're wondering what my background is :)

  • @finiteimpulse3765
    @finiteimpulse3765 4 года назад +5

    Clem, please write the full question statement at the beginning so we could try to answer the question more easily.

  • @nikushaa9
    @nikushaa9 4 года назад

    Get a 60*24 sized array of bools (can also be done with bits if confident) initially all filled with zeroes, each representing a minute.
    Iterate over the first list and for each tuple set the corresponding bool of each minute between the start and end time to 1.
    Iterate over the second list and basically do the same thing, except instead of setting the bool to 1, check if they're already set to 1 and if they are, the given minute is part of the answer. It's trivial after that.
    Gets done in two loops, very easy to code and can be optimized significantly given enough time.

  • @markonikolic1386
    @markonikolic1386 4 года назад

    I paused and tried myself. I had a different idea that might be a bit faster but more prone to having bugs. The thought process took about 40min with explaining so I wouldn't have had time to write a code. Also the code writing will take me much longer since I am not as good as this guy. Second year of college studying computer science. Since I can only do C++ and Java for now(much more comfortable with C++ and would chose it for the interview) handling strings would've been a bit harder. All in all I am happy to see that the question is not as hard as I thought it would be. I am not close to passing it yet and still need to write a code(tomorrow or something because it's 3:30 am) to see if there are any bugs. Still, this is a boost to my self esteem and a good motivation to keep learning. Great video!

  • @RepentofSin
    @RepentofSin 3 года назад +4

    You could create an array of every minutes during a day(1440), and remove items from the array for the unavailable mins for each person and also the out of bound times. In the end you would just create a list of available blocks of times from the remaining items in the array.

    • @bboyhusky
      @bboyhusky Год назад +1

      Yes - also easy to generalize to any number of participants / calendars

  • @TechAddictClub
    @TechAddictClub 4 года назад +3

    Great content.
    A small improvement, instead of the compareTime function, a simple helper functions to convert time string to just minutes (hh*60 + mm) will be even more generic and even more useful, if we store those minutes integers in the intermediate arrays. That way, arithmetic (comparison, in-between check etc) will be even easier. While creating the output, we can easily use a similar helper function to convert that minutes back to time string.
    That's what I think. Any suggestion will be appreciated.

    • @clem
      @clem  4 года назад +4

      That's what we suggest on our solution to this problem on AlgoExpert 😉

    • @chrysostomoskaraliolios5813
      @chrysostomoskaraliolios5813 4 года назад

      I would have done it by constructing a bit array with one bit per minute. And then simply do bit masking. Which is more a solution embedded engineers would use.

  • @samsmusichub
    @samsmusichub 4 года назад

    Hey it's Tech With Tim! I'm really looking forward to this one.

  • @BlackLight7Gaming
    @BlackLight7Gaming Год назад

    a fun way to look about merging the tables is the following logic using blocks (windows of time on a timelite that is occupied):
    while looking through a block with respect to every other block, if the start/end point of one of the blocks is in-between the start and the end of the other block, you could view them as overlapping, and thus as a bigger scope block of atleast 1 occupied person and should be documented as one bigger block whose limits is the max of the ends of the blocks and the min of the start of the blocks.
    1 edge case is when no block like that is found, meaning the block in the first calendar isnt overlapping any other block in the second calendar, thus the block is a stand-alone in the bigger picture of blocks, thus needs to be documented as is.
    another edge case is where the blocks have overlapping starts/ends, in which the solution would be adding an equal sign to each 'between' comparison
    with that simple algorithm u can map the entire shared schedule and then run a function that would find the time windows between the shared calendar blocks.
    no way i wouldve gotten this in just 45 minutes and having someone be present, heck, it took me 2 hours with debugging, but it was a great sport!
    (seems to work fine with the dataset presented in the video, and i cant think of any other edgecases, but i would love to hear if u find something!)

  • @jordinario
    @jordinario 4 года назад +76

    Here's my take on this problem:
    - Convert the times into integers (minutes, so 2:00 becomes 120)
    - Calculate the free time (pairs of times just like shown in video) each person has
    - Make a bit representation of each minute in a day (24*60 bits), if that person has free time in that minute, set that bit to 1, 0 otherwise
    - Do an AND operation between the bit representations of free time of every person (joining everyone's free time)
    - Convert that bit representation back to pairs of times. If the time range is greater than 30 minutes, then accept that pair
    - Profit
    You can implement that with constant extra space (if you needed to find availability of 3 or more people at the same time), and time complexity is O(n + m): N is for number of calendars being read (2 in that case) and M is the total number of existing meetings

    • @shyshka_
      @shyshka_ 4 года назад +3

      nice

    • @edishasanov7128
      @edishasanov7128 4 года назад +2

      nice

    • @lx4302
      @lx4302 4 года назад +2

      same idea. nice.

    • @Tranewrekk
      @Tranewrekk 4 года назад +8

      This is a bit overcomplicated of a solution, having to parse every minute isn't very efficient.

    • @perfectdark287
      @perfectdark287 4 года назад +10

      I dont understand a single thing you just said. But im intrigued

  • @lavhithpragada1928
    @lavhithpragada1928 3 года назад +42

    me after this interview
    printf("die");

  • @bukvoj6562
    @bukvoj6562 3 года назад

    This helped me a lot, thank you.

  • @justinallan8427
    @justinallan8427 4 года назад

    There was much much simpler way to do this. Map the input lists to AVAILABLE time slots for each person. Then joint filter them keeping only the overlapping available time slots. End result is a list of timeslots that both parties have available. We can then filter out slots that do not meet the bounds or duration requirements.

  • @rammozs
    @rammozs 4 года назад +41

    He mentions his OCD will kick in, and then he put the available time of person2 in the first place, available time of person1 in second place, and in one set he uses double quotes and in another one he doesn't...

    • @charan775
      @charan775 4 года назад +4

      it's just showing off lol

  • @itsamevic
    @itsamevic 4 года назад +8

    wow Clément is a genius, It takes time to interpret and understand code from another person, he did it immediately, even better than Tim, just WOW

  • @zeamanuelkiflu5497
    @zeamanuelkiflu5497 4 года назад

    this is a very interesting interview, i had no idea google conduct this type of interviews, it makes me feel a beginner b/c i thought i was good at solving algorithms and implementing codes, but i have to learn more.