Google Coding Interview With A College Student

2019 ж. 25 Жел.
1 521 951 Рет қаралды

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!)

Пікірлер
  • Big thanks to Tim for being willing to do this coding interview in front of all of KZhead! Check out the video we did on his channel here kzhead.info/sun/o86DpdWPjqN7d4E/bejne.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

    @clem@clem4 жыл бұрын
    • 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 ?

      @michaelanggriawan8131@michaelanggriawan81314 жыл бұрын
    • @@michaelanggriawan8131 You'll have access to AlgoExpert for 1 year after you buy it; hope to see you on the platform soon!

      @clem@clem4 жыл бұрын
    • 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 ?

      @riteshrastogi5388@riteshrastogi53884 жыл бұрын
    • 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

      4 жыл бұрын
    • @@clem sir tell me question..in written form... i am not understanding ur voice ..... plsss write here question... and i like this type videos...

      @rahulxcronos8168@rahulxcronos81684 жыл бұрын
  • This dude is being interviewed for a job at Google and is using Firefox for the interview! What an absolut madlad!

    @BrosOfPranks@BrosOfPranks4 жыл бұрын
    • BrosOfPranks u do realise it says mock interview.

      @dotnetdevni@dotnetdevni4 жыл бұрын
    • @@dotnetdevni of course I do, I just thought it would be funny anyways

      @BrosOfPranks@BrosOfPranks4 жыл бұрын
    • He's also using Linux, firefox is a better choice there.

      @Poison69@Poison694 жыл бұрын
    • @@Poison69 firefox is a better choice on microsoft too

      @tubewoodycool@tubewoodycool4 жыл бұрын
    • I'm watching this on firefox :)

      @aandhereitgoes@aandhereitgoes4 жыл бұрын
  • Microsoft Word is my favorite IDE

    @boggeshzahim3713@boggeshzahim37134 жыл бұрын
    • Mine is sheet of paper

      @alexandrb6397@alexandrb63974 жыл бұрын
    • Mine is air

      @joshuatube2255@joshuatube22554 жыл бұрын
    • mine is documents rename field

      @Endrit719@Endrit7194 жыл бұрын
    • Mine is the KZhead comment section.

      @clem@clem4 жыл бұрын
    • my favorite IDE is cmd

      @PaleOrchid@PaleOrchid4 жыл бұрын
  • I feel like I would instantly forget everything I ever learned about coding in an interview like this :/

    @TheVideomaster138@TheVideomaster1384 жыл бұрын
    • Me Too

      @rjose705@rjose7054 жыл бұрын
    • I forgot how to write "Hello World", by watching this

      @AlexDMI1982@AlexDMI19824 жыл бұрын
    • I felt the same 😂😅

      @samahsaeed1261@samahsaeed12614 жыл бұрын
    • 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.

      @47Mortuus@47Mortuus4 жыл бұрын
    • That why u do practice interviews

      @gokusgames@gokusgames4 жыл бұрын
  • Friend: What do you watch in your spare time? Me: It's complicated

    @lightlysal@lightlysal4 жыл бұрын
    • underrated comment

      @razorhxh7371@razorhxh73713 жыл бұрын
    • Hahaha what a mood

      @piano-fe4bv@piano-fe4bv3 жыл бұрын
    • how exactly is it complicated? If anything it's useful and people could learn something from it

      @sharjeelahmed7913@sharjeelahmed79132 жыл бұрын
    • @@sharjeelahmed7913 mate it's a joke

      @lightlysal@lightlysal2 жыл бұрын
  • Thanks again for doing the interview Clement! I learned a lot and got some great practice. Hope everyone enjoyed :)

    @TechWithTim@TechWithTim4 жыл бұрын
    • Impressed, You are a genius Tim.

      @pragyakulshresth8828@pragyakulshresth88284 жыл бұрын
    • 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!

      @kevund16@kevund163 жыл бұрын
    • Tech with Tim, I love your channel, I was shocked that I saw your face on another channel

      @kasineva9983@kasineva99833 жыл бұрын
    • 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! 🤜🏼🤛🏾

      @Nervosa80@Nervosa803 жыл бұрын
    • Sooo good

      @ismailfaturrohman5887@ismailfaturrohman58873 жыл бұрын
  • People: If you dont watch movies or shows, what do you watch? Me: Google coding interviews

    @joelo3907@joelo39074 жыл бұрын
    • wait shit tf am I doing I'm boutta pirate a movie or smthn

      @floop7624@floop76244 жыл бұрын
    • mostDEV feel this

      @cammikula6863@cammikula68634 жыл бұрын
    • my man

      @VincentOldMark@VincentOldMark4 жыл бұрын
    • Hentai

      @Mistyfgdf@Mistyfgdf3 жыл бұрын
    • Love it! You are not alone loll haha

      @quirkyquester@quirkyquester3 жыл бұрын
  • Why am I watching this I’m a biology student

    @DaPokeBoss@DaPokeBoss4 жыл бұрын
    • Same, honestly have no idea wtf goin on

      @kevincorrigan1754@kevincorrigan17544 жыл бұрын
    • As an bioinformatician I found this useful af xD

      @kennethwiinintendo@kennethwiinintendo4 жыл бұрын
    • @@kennethwiinintendo wtf is that lol

      @DanielNyong@DanielNyong4 жыл бұрын
    • Because the media told us to learn to code.

      @Filelor@Filelor4 жыл бұрын
    • @@DanielNyong basically analytics using Crispr, MoTor, and other gene sequencing software to locate certain genes within DNA libraries and such.

      @steveschaninger2535@steveschaninger25354 жыл бұрын
  • 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.

    @nicktaylor1003@nicktaylor10034 жыл бұрын
    • 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.

      @is1hair@is1hair4 жыл бұрын
    • @@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.

      @drunkenfarmer2513@drunkenfarmer25134 жыл бұрын
    • @@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.

      @Menaceirl@Menaceirl4 жыл бұрын
    • 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?

      @is1hair@is1hair3 жыл бұрын
    • @@drunkenfarmer2513 you are absolutely right , In my last interview he gave me one question which need binary search , I directly answered it,

      @shera2667@shera26673 жыл бұрын
  • Just tell me when you want to have the meeting and I'll adjust my schedule....

    @hunter1801@hunter18014 жыл бұрын
    • lol

      @maskahleo@maskahleo4 жыл бұрын
    • ...drop the mic... leave the room...

      @waszp1@waszp14 жыл бұрын
    • my Favorite comment

      @PrinzeUsman@PrinzeUsman4 жыл бұрын
    • 😂😂😂

      @sheimypazserpa5454@sheimypazserpa54543 жыл бұрын
    • you killed me Sheimy Paz Serpa 😂😂😂

      @n_fan329@n_fan3293 жыл бұрын
  • And then there’s me getting an error in my hello world program 🤣😅

    @Skater1234282@Skater12342824 жыл бұрын
    • feel you bro

      @alexjimenez6452@alexjimenez64524 жыл бұрын
    • you are not alone

      @S4NTIS0@S4NTIS04 жыл бұрын
    • I can't CS to save my life!

      @x000s2@x000s24 жыл бұрын
    • 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.

      @yummyishere@yummyishere4 жыл бұрын
    • 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

      @n124ajdx@n124ajdx4 жыл бұрын
  • 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.

    @nicholasjohnson9765@nicholasjohnson97654 жыл бұрын
    • 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

      @hyanbatista3281@hyanbatista32814 жыл бұрын
    • @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.

      @feo130@feo1304 жыл бұрын
    • @@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.

      @keithdenzelroque2072@keithdenzelroque20724 жыл бұрын
    • 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

      @gracewood6768@gracewood67684 жыл бұрын
    • 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.

      @ActuallyAudacity@ActuallyAudacity4 жыл бұрын
  • 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.

    @MarioMastar@MarioMastar3 жыл бұрын
    • 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.

      @James-yz4cc@James-yz4cc2 жыл бұрын
    • Did you get the job!??

      @brandonnguyen9082@brandonnguyen90822 жыл бұрын
    • @@brandonnguyen9082 😁

      @cutiefeet2528@cutiefeet25282 жыл бұрын
  • "Military time" aka the time the rest of the world uses.

    @Imsemble@Imsemble4 жыл бұрын
    • most of the world doesn't actually use military time

      @driipz5027@driipz50274 жыл бұрын
    • @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.

      @tl469@tl4694 жыл бұрын
    • TL Oh I’m sorry, I guess I need to do my research

      @driipz5027@driipz50274 жыл бұрын
    • @@tl469 Exactly!

      @smcalpha@smcalpha4 жыл бұрын
    • Aka the good time

      @Dylanm94@Dylanm944 жыл бұрын
  • Those mock interview are the best thing ever. So useful. Keep up the great work Clement!

    @harispapadopoulos4295@harispapadopoulos42954 жыл бұрын
    • Lumanog ikaw ba yan?

      @josebenjamin1777@josebenjamin1777 Жыл бұрын
  • 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!

    @cimbonda24@cimbonda244 жыл бұрын
  • Me in 58 minutes Printf; ("hello)

    @charleskhedia242@charleskhedia2424 жыл бұрын
    • Charles Khedia that ones gunna need a bit more work lol

      @EpochIsEpic@EpochIsEpic4 жыл бұрын
    • for i in range(1,10000000000000000): print("I want to learn machine learning and AI") i+=1

      @abskamo7483@abskamo74833 жыл бұрын
    • @@abskamo7483 you don't need increment I in a for loop.

      @noahnolte7288@noahnolte72883 жыл бұрын
    • Lol

      @ikramrafi6481@ikramrafi64813 жыл бұрын
    • @@abskamo7483 y the increment tho?

      @bluesteel1@bluesteel13 жыл бұрын
  • 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.

    @daphneloustalet9792@daphneloustalet97922 жыл бұрын
  • wow! I was so excited to resolve this exercise by my own skills, this guy really good

    @francisconogales2644@francisconogales26444 жыл бұрын
  • 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!

    @Grr1967@Grr19674 жыл бұрын
  • 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 ! :)

    @Vampenji1012@Vampenji10124 жыл бұрын
  • I'm a fan of this two guy . I've been following this channel and also tim

    @ericjhuneespa3381@ericjhuneespa33814 жыл бұрын
  • Well my self esteem has been destroyed

    @CarlosRodriguez-vg2ob@CarlosRodriguez-vg2ob4 жыл бұрын
    • 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

      @vladventura1928@vladventura19284 жыл бұрын
    • @@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.👍👍👍👍👍

      @yashpandey350@yashpandey3504 жыл бұрын
    • @@yashpandey350Google hires top talent, ofc it's the ones who put in that extra effort and go the extra mile that get in FANG.

      @Skryzeeful@Skryzeeful4 жыл бұрын
    • even more so because he's 19 haha

      @bobsmith-ty5pp@bobsmith-ty5pp3 жыл бұрын
    • Solving lots of problems should help big time imo

      @dex8137@dex81373 жыл бұрын
  • 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.

    @gideonokyeremensah6647@gideonokyeremensah66474 жыл бұрын
  • 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.

    @gmcfalls@gmcfalls3 жыл бұрын
  • I feel stressed watching this LOL

    @sadfool@sadfool4 жыл бұрын
  • 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.

    @venkatasriharsha4227@venkatasriharsha42272 жыл бұрын
    • how did you practice?

      @kios1973@kios19732 жыл бұрын
    • 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.

      @fabiajero@fabiajero Жыл бұрын
  • What a great video Clement and Tim you've got a lot of courage tackling this while videotaping. Great job...

    @francisaiello6197@francisaiello61974 жыл бұрын
  • 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

    @not_proton@not_proton3 жыл бұрын
  • 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.

    @youcefouadjer855@youcefouadjer8554 жыл бұрын
  • 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!

    @michaelmaybe9@michaelmaybe94 жыл бұрын
  • 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.

    @Evilshrimp02@Evilshrimp024 жыл бұрын
  • This is so fun!! Wish there would be more mock interviews!

    @user-mr8uz4ju7e@user-mr8uz4ju7e4 жыл бұрын
  • 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!!

    @hetav6714@hetav67144 жыл бұрын
    • 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.

      @gartekk1987@gartekk19874 жыл бұрын
    • Hetav PANDYA makes me feel a lot better cuz holy heck was he great!

      @killerlpacman_1852@killerlpacman_18524 жыл бұрын
    • 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?

      @killerlpacman_1852@killerlpacman_18524 жыл бұрын
    • @@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.

      @gartekk1987@gartekk19874 жыл бұрын
    • @@gartekk1987 You just GAVE ME HOPE

      @triparadox.c@triparadox.c4 жыл бұрын
  • I can confirm CS students deal with a lot of of calendar and comparison problems lol

    @ICeyCeR3Al@ICeyCeR3Al4 жыл бұрын
  • 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!

    @User36282@User362822 жыл бұрын
  • Good job Tim and good luck on your future interviews!

    @brandijohnson1326@brandijohnson13264 жыл бұрын
  • I think it is funny that the GOOGLE interview is on Linux on firefox and the headphone he is wearing are Apple Airpods

    @takurotim3496@takurotim34964 жыл бұрын
    • Fun fact, most google employees use linux

      @aphotic3181@aphotic31814 жыл бұрын
    • Aphotic Of course, their servers run on Linux so it makes way more sense to use a UNIX system vs ChromeOS lol (or Windows)

      @henrylecompte4533@henrylecompte45333 жыл бұрын
    • @@henrylecompte4533 jup makes sense... but they do make Google Pixel buds etc.

      @takurotim3496@takurotim34963 жыл бұрын
  • 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

    @grelgen@grelgen4 жыл бұрын
  • 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!

    @vince.j@vince.j3 жыл бұрын
  • Loved this video, guys. Great work and GOOD LUCK Tim!

    @reidyoung298@reidyoung2984 жыл бұрын
  • Was subscribed to Tim long time ago happy to see a collab between you ✌🏻☮️

    @neeraj1bh@neeraj1bh4 жыл бұрын
    • Neeraj Bhatt 💪

      @TechWithTim@TechWithTim4 жыл бұрын
  • 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).

    @jerritanderson212@jerritanderson2124 жыл бұрын
  • “That’ll append our pointers” Huzzah! A man of culture

    @brettmcintyre6329@brettmcintyre63294 жыл бұрын
    • Why "append" instead of "increase"?

      @TheCarmacon@TheCarmacon4 жыл бұрын
    • @@TheCarmacon I'm guessing that it's because he writes in Python

      @gutymarquezrocks17@gutymarquezrocks174 жыл бұрын
    • how pythonic of him

      @ashleybrown2698@ashleybrown26983 жыл бұрын
  • 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.

    @benjamindavidson3344@benjamindavidson33444 жыл бұрын
  • A simple solution to the Calender question: The times were given already, first we had to find their time gap blocks, then find the time block in which both were available : ['10:30', '12:00'], ['13:00', '16:00'], ['18:00', '20:00'] - Person1 ['11:30', '12:30'], ['15:00', '16:00'], ['17:00', '18:30'] - Person2 Find the maximum starting time and minimum ending time as Person2's starting time is 11:30 while Person1's starting time is 10:30 similarly the ending time is 12:00 and 12:30 respectively. The common time for both would start with the maximum time that is 11:30 because they both are available during that time block and similarly the ending time must be the minimum time as Person1 does not have time after 12:00. According to this algorithm, We make a new list with the maximum starting time and minimum ending time for all 3 inputs and the output is : ['11:30', '12:00'], ['15:00', '16:00'], ['18:00', '18:30'] Though this is when there is no 30 minutes time block assigned.

    @cdename@cdename4 жыл бұрын
  • 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!!

    @chriscarlisle8997@chriscarlisle89974 жыл бұрын
    • That's a great way to extract as much value as possible from these mock coding interview videos!

      @clem@clem4 жыл бұрын
    • did u do it?

      @saadafshar@saadafshar4 жыл бұрын
    • Sadegh Afshari no it’s been a month now and he’s still working on it

      @efrainmoreno1154@efrainmoreno11544 жыл бұрын
    • @@efrainmoreno1154 lol

      @devdin8157@devdin81574 жыл бұрын
    • @@efrainmoreno1154 lol

      @watchout1435@watchout14354 жыл бұрын
  • 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.

    @bossbuckgaming@bossbuckgaming4 жыл бұрын
    • 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.

      @Ruktiet@Ruktiet2 жыл бұрын
    • @@Ruktiet Well actually sudo is used in unix so they probably just mistakenly used the wrong spelling.

      @adidavid5287@adidavid52872 жыл бұрын
  • now tim works in microsoft few years later tim : microsoft coding interview with bois

    @nikhilt3755@nikhilt37553 жыл бұрын
  • 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.

    @lechium02@lechium024 жыл бұрын
    • stephen _q practice, practice, practice

      @splash1490@splash14904 жыл бұрын
    • 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.

      @LosTresPollos7@LosTresPollos74 жыл бұрын
  • I've landed the job I wanted but I still get super stressed seeing videos like this.

    @boggeshzahim3713@boggeshzahim37134 жыл бұрын
    • What's your job

      @udbhavtiwari1682@udbhavtiwari16823 жыл бұрын
    • @@udbhavtiwari1682 full stack dev, making software for banks

      @boggeshzahim3713@boggeshzahim37132 жыл бұрын
  • 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.

    @everything_programming7096@everything_programming70963 жыл бұрын
  • randomly saw your vid and i really liked it a lot! subscribed you both

    @WaslooSx@WaslooSx4 жыл бұрын
  • I have an Interview coming up for the Google internship. This is really going to help. Thanks man love the channel

    @BalefulStriker@BalefulStriker4 жыл бұрын
    • Glad you found the video helpful, and good luck on your interviews!

      @clem@clem4 жыл бұрын
    • Baleful Strike how did it go? all good?

      @Asuraedits@Asuraedits4 жыл бұрын
  • 20:40 That moment of realisation.

    @rdius4822@rdius48224 жыл бұрын
  • That was so great it gave me confidence to be confident when im u0 for my interviews

    @MuMu124@MuMu1243 жыл бұрын
  • 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.

    @blastoice9281@blastoice92813 жыл бұрын
  • 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.

    @almaring2839@almaring28394 жыл бұрын
    • Thought the same

      @rafaelmartins8500@rafaelmartins85004 жыл бұрын
  • 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.

    @Seawolf159@Seawolf1594 жыл бұрын
  • 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.

    @linhvu6905@linhvu69054 жыл бұрын
  • 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.

    @jasper909@jasper9094 жыл бұрын
  • Easy looking questions with deep algorithms inside.

    @rakshit3515@rakshit35154 жыл бұрын
    • “This is so easy he can just..... wait no that doesn’t work”

      @Adam-de8jm@Adam-de8jm4 жыл бұрын
    • @@Adam-de8jm literally every time i try to solve an algorithm

      @emirs769@emirs7694 жыл бұрын
  • @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 KZhead. I'd love to see this on KZhead and I'm sure people would too :-)

    @farhan787@farhan7874 жыл бұрын
    • This is a really cool idea! Thanks for the suggestion; I'll see what I can do 😛

      @clem@clem4 жыл бұрын
  • Loved the session, an insightful one. Please continue. ❤️

    @rpavanshetty@rpavanshetty3 жыл бұрын
  • 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.

    @Sam-yu4ve@Sam-yu4ve4 жыл бұрын
  • 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

    @Freakarium@Freakarium4 жыл бұрын
    • Giorgi Giorgadze english pls

      @xephyr2371@xephyr23714 жыл бұрын
  • I am currently having an interview. This was just what I needed!

    @YashSharma-uw8dn@YashSharma-uw8dn4 жыл бұрын
    • Perfect timing!

      @clem@clem4 жыл бұрын
    • You should probably focus on your interviewer

      @benwincelberg9684@benwincelberg96844 жыл бұрын
    • yeah what are you doing why are you on your phone

      @scepto43@scepto434 жыл бұрын
    • So, how did it go?

      @S4NTIS0@S4NTIS04 жыл бұрын
  • 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.

    @iismitch55@iismitch557 ай бұрын
  • thank you Clément good job and continue to do this kind of video :) !!

    @ahmedturki9415@ahmedturki94154 жыл бұрын
  • We had this question as an assignment during our second programming course in comp sci & software engineering :D

    @FadeStrategy@FadeStrategy4 жыл бұрын
    • My first thought was how is Tim going to gain Clement's Google calendar auth token -_-

      @Filelor@Filelor4 жыл бұрын
    • what school do you go to?

      @Vageta1999@Vageta19994 жыл бұрын
  • 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

    @Feinschmacker@Feinschmacker4 жыл бұрын
  • 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

    @KingUnity22@KingUnity223 жыл бұрын
  • Thank you Clément ! This is valuable content!

    @quirkyquester@quirkyquester3 жыл бұрын
  • Clem, please write the full question statement at the beginning so we could try to answer the question more easily.

    @finiteimpulse3765@finiteimpulse37654 жыл бұрын
  • I feel like Google would benefit from just creating their own collaborative coding environment as a replacement for Google Docs in this situation

    @radrad5119@radrad51194 жыл бұрын
    • 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 :/

      @maakkz@maakkz4 жыл бұрын
    • 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

      @codypatnaude9171@codypatnaude91714 жыл бұрын
    • 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.

      @nav_pk@nav_pk4 жыл бұрын
    • @@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.

      @codypatnaude9171@codypatnaude91714 жыл бұрын
    • @@codypatnaude9171 during proper google interviews they turn off spell check and calitalize new lines and all the "auto" features. its essentially a textpad.

      @zakridouh@zakridouh4 жыл бұрын
  • i love clement's smile of like proudness when tim get's on the right track its fckn adorable

    @gracey9024@gracey90243 жыл бұрын
  • Big thanks to you , because of you I again got motivated about programming

    @jatinpatil2428@jatinpatil24283 жыл бұрын
  • When you have been working as a developer for e while and see and student cracking hard questions ....

    @trusterzero6399@trusterzero63994 жыл бұрын
  • 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...

    @rammozs@rammozs4 жыл бұрын
    • it's just showing off lol

      @charan775@charan7754 жыл бұрын
  • 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. 👍

    @nmanohar@nmanohar4 жыл бұрын
  • Thank you for created a video as reference. I learned something new to day :)

    @limlimminhkhai@limlimminhkhai4 жыл бұрын
  • I think I will forget everything when I get to interview🤣🤣and Here am I who want to work in google but doesn't even know how to print a simple pattern😭😭😭

    @manisharegmi2397@manisharegmi23973 жыл бұрын
  • 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

    @jordinario@jordinario4 жыл бұрын
    • nice

      @shyshka_@shyshka_4 жыл бұрын
    • nice

      @edishasanov7128@edishasanov71284 жыл бұрын
    • same idea. nice.

      @lx4302@lx43024 жыл бұрын
    • This is a bit overcomplicated of a solution, having to parse every minute isn't very efficient.

      @Tranewrekk@Tranewrekk4 жыл бұрын
    • I dont understand a single thing you just said. But im intrigued

      @perfectdark287@perfectdark2874 жыл бұрын
  • 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.

    @justinallan8427@justinallan84274 жыл бұрын
  • 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.

    @nikushaa9@nikushaa94 жыл бұрын
  • The collab i was waiting for!!!How did you read my mind Clement???

    @ateamcoolboy5815@ateamcoolboy58154 жыл бұрын
    • Wait, you didn't know? Clement the Mind Reader Mihailescu didn't give it away? 😎

      @clem@clem4 жыл бұрын
    • Nice pfp

      @CUBKITS@CUBKITS4 жыл бұрын
  • me after this interview printf("die");

    @lavhithpragada1928@lavhithpragada19283 жыл бұрын
  • Good job, Tim! wish you the best!

    @codearabawy@codearabawy4 жыл бұрын
  • 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.

    @chilly2171@chilly21712 жыл бұрын
  • The whole interview you were staring at his algorithm while tossing your head around.

    @rbt-0007@rbt-00074 жыл бұрын
  • 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

    @itsamevic@itsamevic4 жыл бұрын
  • Having a guess at the bug: the pointers might be incremented to beyond the length of the corresponding list, but as the while condition is p1

    @counterleo@counterleo3 жыл бұрын
  • 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😅.

    @ayubhaji2441@ayubhaji24413 жыл бұрын
  • 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 :)

    @iggy9121@iggy91214 жыл бұрын
  • Google DOCS is my ide starting today.

    @bismeetsingh352@bismeetsingh3524 жыл бұрын
    • So much cringe.

      @Filelor@Filelor4 жыл бұрын
    • Filelor 😂

      @kensei4237@kensei42373 жыл бұрын
  • 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!

    @markonikolic1386@markonikolic13864 жыл бұрын
  • Solved task more universally using arrays of minutes from 0 to 23*60+59 filled by 1/0 - available or not at this minute. Then multiply two arrays per item and find a sequence of 1s greater or equal to needed.

    @justtorrie@justtorrie4 жыл бұрын
  • Having my video call google interview in two days and this helped me get a good insight into how it's like. THANKS!

    @cartshub@cartshub4 жыл бұрын
    • Sunny Maugin how did it go?

      @zalfredo325@zalfredo3254 жыл бұрын
    • How was it?

      @WarriorX16@WarriorX164 жыл бұрын
  • 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.

    @RepentofSin@RepentofSin3 жыл бұрын
    • Yes - also easy to generalize to any number of participants / calendars

      @bboyhusky@bboyhusky Жыл бұрын
  • 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!)

    @BlackLight7Gaming@BlackLight7Gaming Жыл бұрын
KZhead