Google Coding Interview With A College Student

  Рет қаралды 1,526,454

Clément Mihailescu

Clément Mihailescu

4 жыл бұрын

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 700
@clem
@clem 4 жыл бұрын
Big thanks to Tim for being willing to do this coding interview in front of all of KZfaq! Check out the video we did on his channel here kzfaq.info/get/bejne/ptB6qNSIvNepdH0.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 жыл бұрын
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 жыл бұрын
@@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 жыл бұрын
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 жыл бұрын
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 жыл бұрын
@@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 жыл бұрын
This dude is being interviewed for a job at Google and is using Firefox for the interview! What an absolut madlad!
@dotnetdevni
@dotnetdevni 4 жыл бұрын
BrosOfPranks u do realise it says mock interview.
@BrosOfPranks
@BrosOfPranks 4 жыл бұрын
@@dotnetdevni of course I do, I just thought it would be funny anyways
@Poison69
@Poison69 4 жыл бұрын
He's also using Linux, firefox is a better choice there.
@tubewoodycool
@tubewoodycool 4 жыл бұрын
@@Poison69 firefox is a better choice on microsoft too
@aandhereitgoes
@aandhereitgoes 4 жыл бұрын
I'm watching this on firefox :)
@TheVideomaster138
@TheVideomaster138 4 жыл бұрын
I feel like I would instantly forget everything I ever learned about coding in an interview like this :/
@rjose705
@rjose705 4 жыл бұрын
Me Too
@AlexDMI1982
@AlexDMI1982 4 жыл бұрын
I forgot how to write "Hello World", by watching this
@samahsaeed1261
@samahsaeed1261 4 жыл бұрын
I felt the same 😂😅
@47Mortuus
@47Mortuus 4 жыл бұрын
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 жыл бұрын
That why u do practice interviews
@boggeshzahim3713
@boggeshzahim3713 4 жыл бұрын
Microsoft Word is my favorite IDE
@alexandrb6397
@alexandrb6397 4 жыл бұрын
Mine is sheet of paper
@joshuatube2255
@joshuatube2255 4 жыл бұрын
Mine is air
@Endrit719
@Endrit719 4 жыл бұрын
mine is documents rename field
@clem
@clem 4 жыл бұрын
Mine is the KZfaq comment section.
@PaleOrchid
@PaleOrchid 4 жыл бұрын
my favorite IDE is cmd
@DaPokeBoss
@DaPokeBoss 4 жыл бұрын
Why am I watching this I’m a biology student
@kevincorrigan1754
@kevincorrigan1754 4 жыл бұрын
Same, honestly have no idea wtf goin on
@kennethwiinintendo
@kennethwiinintendo 4 жыл бұрын
As an bioinformatician I found this useful af xD
@DanielNyong
@DanielNyong 4 жыл бұрын
@@kennethwiinintendo wtf is that lol
@Filelor
@Filelor 4 жыл бұрын
Because the media told us to learn to code.
@steveschaninger2535
@steveschaninger2535 4 жыл бұрын
@@DanielNyong basically analytics using Crispr, MoTor, and other gene sequencing software to locate certain genes within DNA libraries and such.
@TechWithTim
@TechWithTim 4 жыл бұрын
Thanks again for doing the interview Clement! I learned a lot and got some great practice. Hope everyone enjoyed :)
@pragyakulshresth8828
@pragyakulshresth8828 4 жыл бұрын
Impressed, You are a genius Tim.
@kevund16
@kevund16 3 жыл бұрын
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 жыл бұрын
Tech with Tim, I love your channel, I was shocked that I saw your face on another channel
@Nervosa80
@Nervosa80 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 жыл бұрын
Friend: What do you watch in your spare time? Me: It's complicated
@razorhxh7371
@razorhxh7371 3 жыл бұрын
underrated comment
@piano-fe4bv
@piano-fe4bv 3 жыл бұрын
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 жыл бұрын
@@sharjeelahmed7913 mate it's a joke
@hunter1801
@hunter1801 4 жыл бұрын
Just tell me when you want to have the meeting and I'll adjust my schedule....
@maskahleo
@maskahleo 4 жыл бұрын
lol
@waszp1
@waszp1 4 жыл бұрын
...drop the mic... leave the room...
@PrinzeUsman
@PrinzeUsman 4 жыл бұрын
my Favorite comment
@sheimypazserpa5454
@sheimypazserpa5454 3 жыл бұрын
😂😂😂
@n_fan329
@n_fan329 3 жыл бұрын
you killed me Sheimy Paz Serpa 😂😂😂
@nicholasjohnson9765
@nicholasjohnson9765 4 жыл бұрын
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 жыл бұрын
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 жыл бұрын
@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 жыл бұрын
@@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 жыл бұрын
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 жыл бұрын
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.
@joelo3907
@joelo3907 4 жыл бұрын
People: If you dont watch movies or shows, what do you watch? Me: Google coding interviews
@floop7624
@floop7624 4 жыл бұрын
wait shit tf am I doing I'm boutta pirate a movie or smthn
@cammikula6863
@cammikula6863 4 жыл бұрын
mostDEV feel this
@VincentOldMark
@VincentOldMark 4 жыл бұрын
my man
@Mistyfgdf
@Mistyfgdf 3 жыл бұрын
Hentai
@quirkyquester
@quirkyquester 3 жыл бұрын
Love it! You are not alone loll haha
@nicktaylor1003
@nicktaylor1003 4 жыл бұрын
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 жыл бұрын
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 жыл бұрын
@@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 жыл бұрын
@@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 жыл бұрын
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 жыл бұрын
@@drunkenfarmer2513 you are absolutely right , In my last interview he gave me one question which need binary search , I directly answered it,
@MarioMastar
@MarioMastar 3 жыл бұрын
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 жыл бұрын
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 жыл бұрын
Did you get the job!??
@cutiefeet2528
@cutiefeet2528 2 жыл бұрын
@@brandonnguyen9082 😁
@daphneloustalet9792
@daphneloustalet9792 2 жыл бұрын
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.
@harispapadopoulos4295
@harispapadopoulos4295 4 жыл бұрын
Those mock interview are the best thing ever. So useful. Keep up the great work Clement!
@josebenjamin1777
@josebenjamin1777 Жыл бұрын
Lumanog ikaw ba yan?
@cimbonda24
@cimbonda24 4 жыл бұрын
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!
@Skater1234282
@Skater1234282 4 жыл бұрын
And then there’s me getting an error in my hello world program 🤣😅
@alexjimenez6452
@alexjimenez6452 4 жыл бұрын
feel you bro
@S4NTIS0
@S4NTIS0 4 жыл бұрын
you are not alone
@x000s2
@x000s2 4 жыл бұрын
I can't CS to save my life!
@yummyishere
@yummyishere 4 жыл бұрын
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 жыл бұрын
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
@Imsemble
@Imsemble 4 жыл бұрын
"Military time" aka the time the rest of the world uses.
@driipz5027
@driipz5027 4 жыл бұрын
most of the world doesn't actually use military time
@tl469
@tl469 4 жыл бұрын
@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 жыл бұрын
TL Oh I’m sorry, I guess I need to do my research
@smcalpha
@smcalpha 4 жыл бұрын
@@tl469 Exactly!
@Dylanm94
@Dylanm94 4 жыл бұрын
Aka the good time
@venkatasriharsha4227
@venkatasriharsha4227 2 жыл бұрын
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 жыл бұрын
how did you practice?
@fabiajero
@fabiajero Жыл бұрын
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.
@charleskhedia242
@charleskhedia242 4 жыл бұрын
Me in 58 minutes Printf; ("hello)
@EpochIsEpic
@EpochIsEpic 4 жыл бұрын
Charles Khedia that ones gunna need a bit more work lol
@abskamo7483
@abskamo7483 3 жыл бұрын
for i in range(1,10000000000000000): print("I want to learn machine learning and AI") i+=1
@noahnolte7288
@noahnolte7288 3 жыл бұрын
@@abskamo7483 you don't need increment I in a for loop.
@ikramrafi6481
@ikramrafi6481 3 жыл бұрын
Lol
@bluesteel1
@bluesteel1 3 жыл бұрын
@@abskamo7483 y the increment tho?
@CarlosRodriguez-vg2ob
@CarlosRodriguez-vg2ob 4 жыл бұрын
Well my self esteem has been destroyed
@vladventura1928
@vladventura1928 4 жыл бұрын
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 жыл бұрын
@@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 жыл бұрын
@@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 жыл бұрын
even more so because he's 19 haha
@dex8137
@dex8137 4 жыл бұрын
Solving lots of problems should help big time imo
@francisconogales2644
@francisconogales2644 4 жыл бұрын
wow! I was so excited to resolve this exercise by my own skills, this guy really good
@brettmcintyre6329
@brettmcintyre6329 4 жыл бұрын
“That’ll append our pointers” Huzzah! A man of culture
@TheCarmacon
@TheCarmacon 4 жыл бұрын
Why "append" instead of "increase"?
@gutymarquezrocks17
@gutymarquezrocks17 4 жыл бұрын
@@TheCarmacon I'm guessing that it's because he writes in Python
@ashleybrown2698
@ashleybrown2698 3 жыл бұрын
how pythonic of him
@gideonokyeremensah6647
@gideonokyeremensah6647 4 жыл бұрын
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.
@gmcfalls
@gmcfalls 3 жыл бұрын
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.
@ericjhuneespa3381
@ericjhuneespa3381 4 жыл бұрын
I'm a fan of this two guy . I've been following this channel and also tim
@nikhilt3755
@nikhilt3755 4 жыл бұрын
now tim works in microsoft few years later tim : microsoft coding interview with bois
@Grr1967
@Grr1967 4 жыл бұрын
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!
@not_proton
@not_proton 3 жыл бұрын
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
@youcefouadjer855
@youcefouadjer855 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.
@hetav6714
@hetav6714 4 жыл бұрын
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 жыл бұрын
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 жыл бұрын
Hetav PANDYA makes me feel a lot better cuz holy heck was he great!
@killerlpacman_1852
@killerlpacman_1852 4 жыл бұрын
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 жыл бұрын
@@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 жыл бұрын
@@gartekk1987 You just GAVE ME HOPE
@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 жыл бұрын
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 ! :)
@rdius4822
@rdius4822 4 жыл бұрын
20:40 That moment of realisation.
@michaelmaybe9
@michaelmaybe9 4 жыл бұрын
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!
@ICeyCeR3Al
@ICeyCeR3Al 4 жыл бұрын
I can confirm CS students deal with a lot of of calendar and comparison problems lol
@boggeshzahim3713
@boggeshzahim3713 4 жыл бұрын
I've landed the job I wanted but I still get super stressed seeing videos like this.
@udbhavtiwari1682
@udbhavtiwari1682 3 жыл бұрын
What's your job
@boggeshzahim3713
@boggeshzahim3713 2 жыл бұрын
@@udbhavtiwari1682 full stack dev, making software for banks
@neeraj1bh
@neeraj1bh 4 жыл бұрын
Was subscribed to Tim long time ago happy to see a collab between you ✌🏻☮️
@TechWithTim
@TechWithTim 4 жыл бұрын
Neeraj Bhatt 💪
@lechium02
@lechium02 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.
@bossbuckgaming
@bossbuckgaming 4 жыл бұрын
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 жыл бұрын
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 жыл бұрын
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.
@chriscarlisle8997
@chriscarlisle8997 4 жыл бұрын
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 жыл бұрын
That's a great way to extract as much value as possible from these mock coding interview videos!
@saadafshar
@saadafshar 4 жыл бұрын
did u do it?
@efrainmoreno1154
@efrainmoreno1154 4 жыл бұрын
Sadegh Afshari no it’s been a month now and he’s still working on it
@devdin8157
@devdin8157 4 жыл бұрын
@@efrainmoreno1154 lol
@watchout1435
@watchout1435 4 жыл бұрын
@@efrainmoreno1154 lol
@sadfool
@sadfool 4 жыл бұрын
I feel stressed watching this LOL
@brandijohnson1326
@brandijohnson1326 4 жыл бұрын
Good job Tim and good luck on your future interviews!
@user-mr8uz4ju7e
@user-mr8uz4ju7e 4 жыл бұрын
This is so fun!! Wish there would be more mock interviews!
@grelgen
@grelgen 4 жыл бұрын
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
@Freakarium
@Freakarium 4 жыл бұрын
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
@gracey9024
@gracey9024 3 жыл бұрын
i love clement's smile of like proudness when tim get's on the right track its fckn adorable
@reidyoung298
@reidyoung298 4 жыл бұрын
Loved this video, guys. Great work and GOOD LUCK Tim!
@jerritanderson212
@jerritanderson212 4 жыл бұрын
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).
@takurotim3496
@takurotim3496 4 жыл бұрын
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 жыл бұрын
Fun fact, most google employees use linux
@henrylecompte4533
@henrylecompte4533 3 жыл бұрын
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.
@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!
@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!
@Seawolf159
@Seawolf159 4 жыл бұрын
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.
@BalefulStriker
@BalefulStriker 4 жыл бұрын
I have an Interview coming up for the Google internship. This is really going to help. Thanks man love the channel
@clem
@clem 4 жыл бұрын
Glad you found the video helpful, and good luck on your interviews!
@Asuraedits
@Asuraedits 4 жыл бұрын
Baleful Strike how did it go? all good?
@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.
@MuMu124
@MuMu124 4 жыл бұрын
That was so great it gave me confidence to be confident when im u0 for my interviews
@almaring2839
@almaring2839 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.
@rafaelmartins8500
@rafaelmartins8500 4 жыл бұрын
Thought the same
@rakshit3515
@rakshit3515 4 жыл бұрын
Easy looking questions with deep algorithms inside.
@Adam-de8jm
@Adam-de8jm 4 жыл бұрын
“This is so easy he can just..... wait no that doesn’t work”
@emirs769
@emirs769 4 жыл бұрын
@@Adam-de8jm literally every time i try to solve an algorithm
@ahmedturki9415
@ahmedturki9415 4 жыл бұрын
thank you Clément good job and continue to do this kind of video :) !!
@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.
@lavhithpragada1928
@lavhithpragada1928 3 жыл бұрын
me after this interview printf("die");
@YashSharma-uw8dn
@YashSharma-uw8dn 4 жыл бұрын
I am currently having an interview. This was just what I needed!
@clem
@clem 4 жыл бұрын
Perfect timing!
@benwincelberg9684
@benwincelberg9684 4 жыл бұрын
You should probably focus on your interviewer
@scepto43
@scepto43 4 жыл бұрын
yeah what are you doing why are you on your phone
@S4NTIS0
@S4NTIS0 4 жыл бұрын
So, how did it go?
@rpavanshetty
@rpavanshetty 4 жыл бұрын
Loved the session, an insightful one. Please continue. ❤️
@WaslooSx
@WaslooSx 4 жыл бұрын
randomly saw your vid and i really liked it a lot! subscribed you both
@farhan787
@farhan787 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 KZfaq. I'd love to see this on KZfaq and I'm sure people would too :-)
@clem
@clem 4 жыл бұрын
This is a really cool idea! Thanks for the suggestion; I'll see what I can do 😛
@Feinschmacker
@Feinschmacker 4 жыл бұрын
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
@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.
@Sam-yu4ve
@Sam-yu4ve 4 жыл бұрын
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.
@trusterzero6399
@trusterzero6399 4 жыл бұрын
When you have been working as a developer for e while and see and student cracking hard questions ....
@jordinario
@jordinario 4 жыл бұрын
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 жыл бұрын
nice
@edishasanov7128
@edishasanov7128 4 жыл бұрын
nice
@AlexandrBorschchev
@AlexandrBorschchev 4 жыл бұрын
same idea. nice.
@Tranewrekk
@Tranewrekk 4 жыл бұрын
This is a bit overcomplicated of a solution, having to parse every minute isn't very efficient.
@perfectdark287
@perfectdark287 4 жыл бұрын
I dont understand a single thing you just said. But im intrigued
@codearabawy
@codearabawy 4 жыл бұрын
Good job, Tim! wish you the best!
@limlimminhkhai
@limlimminhkhai 4 жыл бұрын
Thank you for created a video as reference. I learned something new to day :)
@finiteimpulse3765
@finiteimpulse3765 4 жыл бұрын
Clem, please write the full question statement at the beginning so we could try to answer the question more easily.
@FadeStrategy
@FadeStrategy 4 жыл бұрын
We had this question as an assignment during our second programming course in comp sci & software engineering :D
@Filelor
@Filelor 4 жыл бұрын
My first thought was how is Tim going to gain Clement's Google calendar auth token -_-
@Vageta1999
@Vageta1999 4 жыл бұрын
what school do you go to?
@quirkyquester
@quirkyquester 3 жыл бұрын
Thank you Clément ! This is valuable content!
@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
@radrad5119
@radrad5119 4 жыл бұрын
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 жыл бұрын
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 жыл бұрын
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 жыл бұрын
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 жыл бұрын
@@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 жыл бұрын
@@codypatnaude9171 during proper google interviews they turn off spell check and calitalize new lines and all the "auto" features. its essentially a textpad.
@manisharegmi2397
@manisharegmi2397 3 жыл бұрын
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😭😭😭
@chilly2171
@chilly2171 2 жыл бұрын
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.
@samsmusichub
@samsmusichub 4 жыл бұрын
Hey it's Tech With Tim! I'm really looking forward to this one.
@ateamcoolboy5815
@ateamcoolboy5815 4 жыл бұрын
The collab i was waiting for!!!How did you read my mind Clement???
@clem
@clem 4 жыл бұрын
Wait, you didn't know? Clement the Mind Reader Mihailescu didn't give it away? 😎
@CUBKITS
@CUBKITS 4 жыл бұрын
Nice pfp
@iggy9121
@iggy9121 4 жыл бұрын
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 :)
@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.
@omermarom6592
@omermarom6592 4 жыл бұрын
honestly i would rather have 15 mins alone in my head to solve a problem than an hour where i cant be silent for more than 10 seconds.. respect for this guy.
@rbt-0007
@rbt-0007 4 жыл бұрын
The whole interview you were staring at his algorithm while tossing your head around.
@jakeosaur237
@jakeosaur237 4 жыл бұрын
interview: "write me an algorithm to count the number of times I nod in this video"
@RubixCubed3
@RubixCubed3 4 жыл бұрын
Let nodCount = 0; On Nod => ( nodCount += 1 );
@tbtitans21
@tbtitans21 4 жыл бұрын
Thanks for the video! I came up with the same original solution that Tim did and your approach was much simpler. I was wondering if you had any advice on coming up with the simplest approach to solving a problem? That to me seems like one of the most important questions, because you save on code complexity and therefore modularity/maintainability and even on how quickly you can come up with the solution. So do you have any advice on maybe a mindset (eg asking myself "How can I do this in the easiest way?" or something along those lines) you use to approach problems and find simple, sensical approaches?
@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.
@goni2867
@goni2867 4 жыл бұрын
This problem can be solved very easy in O(n), just create a bool array of 24*60 if the meetings can be scheduled at every minute, or only 24*2 if the time blocks are 30 minutes, iterate through the calendars and convert the starting and the end points to int and mark all the values as 1. After make a for loop starting from max(boundaries_person1_start, boundaries_person2_start) until min(boundaries_person1_end, boundaries_person2_end) and append to the solution list all the free sequences.
@aayushnirwan1772
@aayushnirwan1772 4 жыл бұрын
Great :)
@netbotcl586
@netbotcl586 4 жыл бұрын
I would expect an actual coding interview to generalize the problem to something like this:Given set A contains N segments, each segment is defined as [A[i].l,A[i].r] with -10^9
@TechAddictClub
@TechAddictClub 4 жыл бұрын
Was thinking the same.
@goni2867
@goni2867 4 жыл бұрын
@@netbotcl586 That is a totally different problem, Clement said that the input format is in military time from the google calendar, no clock has 1e9 : -1e9
@netbotcl586
@netbotcl586 4 жыл бұрын
@Mihaela Badea I think they are kind of similar because they are both the overlapping subsegments problem type. I don't think the input format matters too much in this case.
@rammozs
@rammozs 4 жыл бұрын
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 жыл бұрын
it's just showing off lol
@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. 👍
@jenniferm2370
@jenniferm2370 4 жыл бұрын
He is hired!!! I almost burnt dinner, trying to watch this until the end. At least I found a new KZfaqr to watch :)
@farhan787
@farhan787 4 жыл бұрын
There's not a single video that doesn't make me feel to destroy that Like button ❤❤
@thebrain678
@thebrain678 4 жыл бұрын
I forgot how to breath during this interview 😂
@jonatansvensson8346
@jonatansvensson8346 Жыл бұрын
I know this video is old but I found a beautiful solution and I couldn't find any comment showcasing it so I thought I might aswell do so. The algoritm starts by creating 2 arrays (one for each person) that represent the free blocks of time throughout the day. We don't need the elements of the arrays to be pairs of times but rather we can create our own data type that represents a given time and wether or not it is the start or end of a free block (for example time=13:00 start=true). For example if lets say one person is free 12:00-13:30, instead of storing the pair[12:00, 13:30] as an element in the persons "freetime-array" we could store the 2 elements e={time=12:00, start=true} and e2={time=13:30, start=false}. We then sort the array in increasing order with respect to the time variable and get a useful way to represent the "freetime-array". We then create a third array that consists of all elements from both of the previously described arrays (both of those are the same btw, just for the two different people). If we sort the third array, once again increasing order according to time, we get something wonderful. What we have done I basically sort of merged together both persons blocks of free time. Lets call this third array a3. Now comes the clever step. We will look for indices j such that a3[j].start and !a3[j+1].start. The time in-between a3[j].time and a3[j+1].time will be time where both people are free. Its easy to verify this (tip: there are basically 2 different cases. Either both the element at j and j+1 come from the same persons free time-array or they don't)! A little harder to verify is that checking for all possible j:s will give us all such interval where both people are free but tbh its pretty straight forward aswell. Yeah so thats basically it
@iismitch55
@iismitch55 9 ай бұрын
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.
@cartshub
@cartshub 4 жыл бұрын
Having my video call google interview in two days and this helped me get a good insight into how it's like. THANKS!
@zalfredo325
@zalfredo325 4 жыл бұрын
Sunny Maugin how did it go?
@WarriorX16
@WarriorX16 4 жыл бұрын
How was it?
@bismeetsingh352
@bismeetsingh352 4 жыл бұрын
Google DOCS is my ide starting today.
@Filelor
@Filelor 4 жыл бұрын
So much cringe.
@kensei4237
@kensei4237 3 жыл бұрын
Filelor 😂
@jatinpatil2428
@jatinpatil2428 3 жыл бұрын
Big thanks to you , because of you I again got motivated about programming
@frostychris89
@frostychris89 4 жыл бұрын
Great vid, enjoyed the watch.
Google Coding Interview With A High School Student
57:24
Clément Mihailescu
Рет қаралды 4 МЛН
Google Coding Interview With A Facebook Software Engineer
49:59
Clément Mihailescu
Рет қаралды 924 М.
Василиса наняла личного массажиста 😂 #shorts
00:22
Денис Кукояка
Рет қаралды 9 МЛН
Каха ограбил банк
01:00
К-Media
Рет қаралды 10 МЛН
#26  More Example on For loop
13:40
yitayew solomon
Рет қаралды 1
How Much Money I've Made As A Software Engineer, Entrepreneur, And YouTuber
14:18
Medium Google Coding Interview With Ben Awad
51:27
Clément Mihailescu
Рет қаралды 1,2 МЛН
How I Failed the Google Coding Interview (and lessons I learned)
14:24
Interview with a Competitive Programmer
25:13
Joma Tech
Рет қаралды 1,2 МЛН
I Solved 1583 Leetcode Questions  Here's What I Learned
20:37
ThePrimeTime
Рет қаралды 539 М.
If Coding Interviews Kept It Real
4:16
Keep On Coding
Рет қаралды 635 М.
Easy Google Coding Interview With Ben Awad
28:00
Clément Mihailescu
Рет қаралды 997 М.
How to NOT Fail a Technical Interview
8:26
Fireship
Рет қаралды 1,3 МЛН
Most Tech Interview Prep is GARBAGE. (From a Principal Engineer at Amazon)
12:57
После ввода кода - протирайте панель
0:18
Samsung S24 Ultra professional shooting kit #shorts
0:12
Photographer Army
Рет қаралды 30 МЛН