Google Coding Interview With A College Student

  Рет қаралды 1,540,455

Clément Mihailescu

Clément Mihailescu

Күн бұрын

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 KZbin! Check out the video we did on his channel here kzbin.info/www/bejne/pputpqSNjNZ4eqs, 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 :)
@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 KZbin comment section.
@PaleOrchid
@PaleOrchid 4 жыл бұрын
my favorite IDE is cmd
@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 4 жыл бұрын
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 4 жыл бұрын
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
@TheVideomaster138
@TheVideomaster138 4 жыл бұрын
I feel like I would instantly forget everything I ever learned about coding in an interview like this :/
@RohanDaDev
@RohanDaDev 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
@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.
@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 4 жыл бұрын
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 4 жыл бұрын
@@drunkenfarmer2513 you are absolutely right , In my last interview he gave me one question which need binary search , I directly answered it,
@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.
@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 4 жыл бұрын
😂😂😂
@n_fan329
@n_fan329 4 жыл бұрын
you killed me Sheimy Paz Serpa 😂😂😂
@MarioMastar
@MarioMastar 4 жыл бұрын
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 3 жыл бұрын
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!??
@schlouloupsse
@schlouloupsse 2 жыл бұрын
@@brandonnguyen9082 😁
@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 3 жыл бұрын
how exactly is it complicated? If anything it's useful and people could learn something from it
@lightlysal
@lightlysal 3 жыл бұрын
@@sharjeelahmed7913 mate it's a joke
@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.
@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?
@viajeromero
@viajeromero 2 жыл бұрын
Also, the reason is because once you saw the answer to the problem, it's difficult to forget the core of the solution, and next time you review the problem, it's much easier. The tough part is when you have to figure out a problem you haven't seen before.
@harispapadopoulos4295
@harispapadopoulos4295 4 жыл бұрын
Those mock interview are the best thing ever. So useful. Keep up the great work Clement!
@josebenjamin1777
@josebenjamin1777 2 жыл бұрын
Lumanog ikaw ba yan?
@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 4 жыл бұрын
Hentai
@quirkyquester
@quirkyquester 4 жыл бұрын
Love it! You are not alone loll haha
@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
@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 4 жыл бұрын
for i in range(1,10000000000000000): print("I want to learn machine learning and AI") i+=1
@noahnolte7288
@noahnolte7288 4 жыл бұрын
@@abskamo7483 you don't need increment I in a for loop.
@ikramrafi6481
@ikramrafi6481 4 жыл бұрын
Lol
@bluesteel1
@bluesteel1 4 жыл бұрын
@@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
@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
@ICeyCeR3Al
@ICeyCeR3Al 4 жыл бұрын
I can confirm CS students deal with a lot of of calendar and comparison problems lol
@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
@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
@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
@not_proton
@not_proton 4 жыл бұрын
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
@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 3 жыл бұрын
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.
@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
@rdius4822
@rdius4822 4 жыл бұрын
20:40 That moment of realisation.
@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.
@nikhilt3755
@nikhilt3755 4 жыл бұрын
now tim works in microsoft few years later tim : microsoft coding interview with bois
@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.
@boggeshzahim3713
@boggeshzahim3713 4 жыл бұрын
I've landed the job I wanted but I still get super stressed seeing videos like this.
@udbhavtiwari1682
@udbhavtiwari1682 4 жыл бұрын
What's your job
@boggeshzahim3713
@boggeshzahim3713 3 жыл бұрын
@@udbhavtiwari1682 full stack dev, making software for banks
@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
@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 4 жыл бұрын
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 4 жыл бұрын
@@henrylecompte4533 jup makes sense... but they do make Google Pixel buds etc.
@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
@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.
@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
@user23724
@user23724 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!
@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
@brettmcintyre6329
@brettmcintyre6329 4 жыл бұрын
“That’ll append our pointers” Huzzah! A man of culture
@gutymarquezrocks17
@gutymarquezrocks17 4 жыл бұрын
@@TheCarmacon I'm guessing that it's because he writes in Python
@ashleybrown2698
@ashleybrown2698 4 жыл бұрын
how pythonic of him
@sadfool
@sadfool 4 жыл бұрын
I feel stressed watching this LOL
@cdename
@cdename 4 жыл бұрын
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.
@trusterzero6399
@trusterzero6399 4 жыл бұрын
When you have been working as a developer for e while and see and student cracking hard questions ....
@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!
@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!
@akyikai
@akyikai 4 жыл бұрын
This question is a fairly simple question. He is all over the place. The key is first to find the "available time" and focus on it for both parties and change the variable type from string and apply the boundary or rules. Then do the arithmetic by exclusion to remove useless data array entry and inclusion to compare the 2 arrays after the exclusion
@manisharegmi2397
@manisharegmi2397 4 жыл бұрын
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😭😭😭
@lavhithpragada1928
@lavhithpragada1928 4 жыл бұрын
me after this interview printf("die");
@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?
@cameronpatterson6161
@cameronpatterson6161 4 жыл бұрын
My idea for first question. (Before I watched on) Step 1: Declare a list of all the minutes in the day. (1440 minutes) e.g. List DayMinutes. Get start of day in UTC minutes and have 24x60=1440 consecutive numbers Step 2: Convert the calendar time strings into integer representations of the minutes in the day. Note these should both be UTC formats or similar for compatibility with different days Step 3: For each persons calendar Step 4: For each block in the calendar Step 5: Delete from the list of minutes (DayMinutes), all of the minutes described by the calendar block. (So iterate through DayMinutes. If its equal to the startvalue, delete it and all the next ones until you reach the end value). Also delete all of the minutes outside peoples working hours At this point you will have a reduced list of all the minutes that EVERY participant has free that day. (Could be more than 2 people) Step 6: Write a function that checks for consecutive numbers in that list. (If DayMinutes[n] = DayMinutes[n-1] + 1 its consecutive. Otherwise its a jump) Record the jump positions to work out consecutive block start and end times, and note the length of the current consecutive block Step 7: You are looking for sections of consecutive numbers of length greater than or equal to the meeting length (e.g. 30). If your consecutive numbers are greater than the meeting length, add the start and the end of that consecutive block to your output Step 7: Convert back to time strings You will end up with an output of all the blocks longer than the meeting length, which every participant has available.
@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
@gracey9024
@gracey9024 4 жыл бұрын
i love clement's smile of like proudness when tim get's on the right track its fckn adorable
@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 :)
@jonatansvensson8346
@jonatansvensson8346 2 жыл бұрын
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
@francisconogales2644
@francisconogales2644 4 жыл бұрын
wow! I was so excited to resolve this exercise by my own skills, this guy really good
@ayushmishra1207
@ayushmishra1207 5 ай бұрын
Thanks for this I paused the video at 6:30 and I started thinking and explainng the approach like a real interview and My approach was to : put these two calender into a single Big_calender take the maximum of lower limit of starting time of person1 and person 2 (start_lo) and minimum of upper limit of ending time of person1 and person 2 (end_up) schedule a artificial meeting between (end_up, start_lo) and put this meeting into Big_calender sort the calender on the basis of end time only merge the overlapping intervals in Big_calender and find available time between two consecutive meetings by taking out the pair of (starting, end ) one by one that's all Thanks again
@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).
@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 ! :)
@OneDicz
@OneDicz 4 жыл бұрын
Now I know why I can’t work at Google
@d4nkdesu
@d4nkdesu 4 жыл бұрын
It's not that difficult dude.. you just need to practice... Tbh i too easily found a way to do this...but when he mentioned tuples of available time.. it instantly hit me..damn it was so much easier... It's all about practice and tbh some luck too ..if you're able to luckily hit the right idea... Keep working hard ... All the best
@tahaqtr7439
@tahaqtr7439 4 жыл бұрын
Its not like its impossible. You need to stop making a big deal out of it.
@kevin_m7
@kevin_m7 4 жыл бұрын
This is a simple merge interval problem
@arxci9402
@arxci9402 4 жыл бұрын
@@tahaqtr7439 It isn't simple for everyone. No need to be a dick. You didn't start out as a pro...
@verryondrums
@verryondrums 4 жыл бұрын
hahaha I feel you :D
@kobodera8261
@kobodera8261 4 жыл бұрын
Very interresting. I have not watched this past the initial problem (but I will). What I did was to turn the times into pure numbers (minutes). I then added mock appointments from 0 to the "start time" of each individual, and also "ending appointments" for the individual with the shortest schedule from the their end time to the other individuals end time. This way all the times where nobody was working was "filled" and as such would not be part of the equation. After that I just when from each array to check if the last value matched the first value of the next one. If it did then do nothing, if they differed then I added the numbers from the last end point to the next starting point, thus creating a schedule with nothing but spare times. After checking which spare times was big enough to fit the meeting time required it was a simple job of turning the interval numbers back to times. Now I am very interrested in seeing how Tim sovled it :)
@some_20s_guy
@some_20s_guy 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?
@aaronbcj
@aaronbcj 2 жыл бұрын
if the meeting is in blocks of 30 minutes, then we can create a hashtable upfront between overlapping bounds (say 9am to 6pm in 30 minute increments) then filling each slot by running over each person's calender once. hash["9:00-9:30"] = 1 hash["9:30-10:00"] = 1 hash["10:00-10:30"] = 0 .. for a meeting from 9:00-10:00 then collect all keys with 0s (free times) and build range. This way it is much easier to merge multiple calendars and not just two.
@itsamevic
@itsamevic 4 жыл бұрын
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
@bismeetsingh352
@bismeetsingh352 4 жыл бұрын
Google DOCS is my ide starting today.
@Filelor
@Filelor 4 жыл бұрын
So much cringe.
@kensei4237
@kensei4237 4 жыл бұрын
Filelor 😂
@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?
@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.
@RepentofSin
@RepentofSin 4 жыл бұрын
You could create an array of every minutes during a day(1440), and remove items from the array for the unavailable mins for each person and also the out of bound times. In the end you would just create a list of available blocks of times from the remaining items in the array.
@bboyhusky
@bboyhusky 2 жыл бұрын
Yes - also easy to generalize to any number of participants / calendars
@chilly2171
@chilly2171 3 жыл бұрын
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.
@rbt-0007
@rbt-0007 4 жыл бұрын
The whole interview you were staring at his algorithm while tossing your head around.
@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.
@paradoxyou6604
@paradoxyou6604 4 жыл бұрын
Wouldn't it just be easier to convert everything to minutes and use set theory More math less coding but gets the problem solved
@Pedro-je6on
@Pedro-je6on 4 жыл бұрын
could you please elaborate?
@jgs1659
@jgs1659 4 жыл бұрын
What I thought, I will try to implement it
@Marius-ir1qn
@Marius-ir1qn 4 жыл бұрын
so much talking on an easy problem
@softparadigm
@softparadigm 4 жыл бұрын
yup, its just the intersection of two sets, and then a subset of that set
@Luckyydee
@Luckyydee 4 жыл бұрын
Thats how i solved it. A couple of loops will do most of the job
@vince.j
@vince.j 4 жыл бұрын
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!
@ericjhuneespa3381
@ericjhuneespa3381 4 жыл бұрын
I'm a fan of this two guy . I've been following this channel and also tim
@francisaiello6197
@francisaiello6197 4 жыл бұрын
What a great video Clement and Tim you've got a lot of courage tackling this while videotaping. Great job...
@dev__adi
@dev__adi 4 жыл бұрын
Having watched these mock interviews, it almost feels like that the interviewee has to follow a script- * ask for sample input / output. * then ask the interviewer if your assumptions are correct. ask if this kind of input will be allowed or not allowed * don't stay quiet at all, speak whatever comes to mind. * figure out a naive solution * interviewer will tell you edge cases and perf issues. * then just keep communicating whatever solution (even if you're not sure if it will fully work). * in code, assume helper function and data structures like stack exists. * give complexity analysis in the end. How can mere mortals figure out the right solutions while doing all the above is beyond me. Thank god I do frontend development. Spared for now. BTW thanks for making this video Clement. Keep rocking
@clem
@clem 4 жыл бұрын
I think your "script" isn't too far from the truth, *but* I would argue that it's not so much a script as it is the general ideal way to go about solving this type of coding problem collaboratively. Oh, and mere mortals can figure out the right solutions while doing all this with some practice! (This is where I'd plug in AlgoExpert 😛) I hope you enjoyed it; keep rocking as well!
@ViAikBreeck
@ViAikBreeck 4 жыл бұрын
To me that just seems like a very natural way to show how you solve a problem in front of another person.
@rahulxcronos8168
@rahulxcronos8168 4 жыл бұрын
bro can u tell me this answer in hin hindi
@fangiscool1
@fangiscool1 4 жыл бұрын
The questions you ask the interviewer change the process a lot, so it can't really be called a script. But, generally your outline is how you solve any problem, so you're not really adding anything novel.
@michaelantoun9353
@michaelantoun9353 4 жыл бұрын
At 24:00, there is no need to merge the times. Instead of merging the times, just skip the first item in the list. More generally, from the first to the second-to-last element, make an 'availability window' comparing the ending time of the current window with the starting time of the next one. If there is no availability greater than 30 minutes in between (end > next start + 30), don't add a window. Otherwise, add a window containing that time.
@neeraj1bh
@neeraj1bh 4 жыл бұрын
Was subscribed to Tim long time ago happy to see a collab between you ✌🏻☮️
@TechWithTim
@TechWithTim 4 жыл бұрын
Neeraj Bhatt 💪
@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 );
@ArtyomPalvelev
@ArtyomPalvelev 4 жыл бұрын
Pro tip: you can disable automatic capitalization in Google Docs.
@sausytime
@sausytime 4 жыл бұрын
(You could also use google collab)
@erik.rodriguez
@erik.rodriguez 4 жыл бұрын
Change font to Courier New
@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.
@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.
@justtorrie
@justtorrie 4 жыл бұрын
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.
@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.
@1shaymark
@1shaymark 4 жыл бұрын
Much simpler solution is just go over all the times boundries in order, and just add 1 for each "beggin" and subtruct 1 for each "end", if you reach 0 its free time for 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 KZbin. I'd love to see this on KZbin 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 😛
@zulqarnainbar4435
@zulqarnainbar4435 4 жыл бұрын
Ouh that monotone of Tim....gotta say love it so much watching his Long Hours of videos
@Filelor
@Filelor 4 жыл бұрын
bump, did you watch his 12 hour live stream where he made that game?
@zulqarnainbar4435
@zulqarnainbar4435 4 жыл бұрын
@@Filelor sometimes, mostly just rewatching the Live
@JoSe-cs7ip
@JoSe-cs7ip 4 жыл бұрын
"Military time" aka universal "24-hour time"
@Freakk47
@Freakk47 4 жыл бұрын
I'm a third year software engineering student and I wouldn't have known how to do this. Well rip my job hunt in the future
@jay_ta708
@jay_ta708 4 жыл бұрын
this will probably be one of the best internship/job related interview videos i will ever see! thank you both!
@clem
@clem 4 жыл бұрын
Wow, I’m glad you found it so useful!
@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
@anthonydickerson4627
@anthonydickerson4627 3 жыл бұрын
"""Coding challenge to take 2 peoples schedules and find a time for an interview""" calendar1 = [["9:00", "10:30"], ["12:00", "13:00"], ["16:00", "18:00"]] bound1 = ["9:00", "20:00"] calendar2 = [["10:00", "11:30"], ["12:30", "14:30"], ["14:30", "15:00"], ["16:00", "17:00"]] bound2 = ["10:00", "18:30"] BLOCK = 30 unavail =[] avail = [] def s2m(time): """convert a string in the format of HH:MM and convert to minutes""" hour, minute = time.split(":") minutes = int(hour) * 60 + int(minute) return minutes def m2s(time): """convert time from minute to HH:MM formated string""" hour = time // 60 minute = time % 60 return "%02i:%02i" % (hour, minute) def cal2min(cal_list): """converts calendar from text to minutes""" a_list = [] for item in cal_list: start = s2m(item[0]) end = s2m(item[1]) a_list.append([start, end]) return a_list def min2cal(min_list): """converts calendar from minutes to str""" a_list = [] for item in min_list: start = m2s(item[0]) end = m2s(item[1]) a_list.append([start, end]) return a_list def get_bounds(bound_list1, bound_list2): """determines the earliest and latest times for a meeting""" start1 = s2m(bound_list1[0]) start2 = s2m(bound_list2[0]) end1 = s2m(bound_list1[1]) end2 = s2m(bound_list2[1]) bounds = [[0, max(start1, start2)], [min(end1, end2), 1440]] return bounds def get_avail(unavail_list): """finds all of the available times for the meeting""" start = 0 end = 0 a_list = [] for item in unavail_list: start = item[0] if start - end >= BLOCK: a_list.append([end, start]) end = item[1] return a_list bound = get_bounds(bound1, bound2) newcalendar1 = cal2min(calendar1) newcalendar2 = cal2min(calendar2) unavail = bound + newcalendar1 + newcalendar2 unavail.sort() avail = get_avail(unavail) str_avail = min2cal(avail) print(str_avail)
@albertopatino7244
@albertopatino7244 3 жыл бұрын
This code will not work for all the cases. That is the nice of this problem!
@kouyang1771
@kouyang1771 3 жыл бұрын
youre wasting time convertime the string into minutes. remember to not do things that aren't necessary. if the client asks for strings why give them ints. you could easilly turn the ints back into strings but then thats another step. this would be very slow if youre trying to setup a meeting for 100000 plus users
@anthonydickerson4627
@anthonydickerson4627 3 жыл бұрын
@@kouyang1771 The conversions are necessary to be able to do meaningful comparisons. The scope of the project was not for 100000 plus users. It is for two.
@anthonydickerson4627
@anthonydickerson4627 3 жыл бұрын
@@albertopatino7244 The cases are provided, and it solves the problem.
@albertopatino7244
@albertopatino7244 3 жыл бұрын
@@anthonydickerson4627 I forgot to include test set. Change: calendar1 = [["9:00", "12:00"], ["12:00", "13:00"], ["16:00", "18:00"]] #calendar1 = [["9:00", "10:30"], ["12:00", "13:00"], ["16:00", "18:00"]]
@brandijohnson1326
@brandijohnson1326 4 жыл бұрын
Good job Tim and good luck on your future interviews!
@nobodyspecial5342
@nobodyspecial5342 4 жыл бұрын
Me, an accounting student, who has an exam tomorrow (or today) : I don't know what I'm watching but yes tell me how a Google coding interview works
@TheTruthFadeswithTime28
@TheTruthFadeswithTime28 4 жыл бұрын
same here but thinking about switching to computer science.
@josephfernandez9767
@josephfernandez9767 4 жыл бұрын
Thank you Clement for the video. I am in no way a great programmer. However, i did spend time trying to figure out the solution for this. Here's my version in python. I didn't implement the 30 min window. That's simple to implement once we get the full availability. p1_cal = '05:00-10:30,11:00-11:30,12:00-13:00,15:00-18:00' #x = '11:00-11:30,12:00-13:00' p2_cal = '06:00-10:00,13:00-14:00' #y = '13:00-14:00' p1_avail = '08:00-16:00' p2_avail = '09:00-20:00' start_time = end_time = '' avail = [] print ('Calendar for Person 1 : ', p1_cal, ' ', sep='') print ('Calendar for Person 2 : ', p2_cal, ' ', sep='') start_time = p1_avail[:5] if p1_avail[:5] > p2_avail[:5] else p2_avail[:5] end_time = p1_avail[6:] if p1_avail[6:] < p2_avail[6:] else p2_avail[6:] #merge person 1 and person 2 calendar, then sort in ascending order of blocked time temp = p1_cal.split(',') + p2_cal.split(',') temp.sort() temp = [i.split('-') for i in temp] #If first meeting starts later in the day, #then add availability for beginning of day if start_time < temp[0][0]: avail.append([start_time,temp[0][0]]) print ('Both individuals are available betweeen :', start_time,'and', end_time, ' ') #loop thru merged calendar to remove overlapping times #if start time of next meeting is before end time of previous meeting, #then ignore start time of next meeting i = 0 while i < len(temp)-1: if temp[i][1] >= temp[i+1][1]: del temp[i+1] continue if temp[i][1] > temp[i+1][0]: temp[i+1][0] = temp[i][1] i +=1 #above loop provides all blocked time #if end time of one meeting is start time of next meeting, ignore #if there is a gap and the gap is between acceptable window, #then add this window to availability for i in range(len(temp)-1): if temp[i][1] == temp[i+1][0]: continue elif start_time = temp[i+1][0]: avail.append([temp[i][1],temp[i+1][0]]) #If last meeting ends before end of the day, #then add availability for remaining part of day if end_time > temp[len(temp)-1][1]: avail.append([temp[len(temp)-1][1],end_time]) print ('Available schedule for meetings for both individuals are: ') for i in avail: print (i,end='\t')
@alenvarghesec.k8001
@alenvarghesec.k8001 4 жыл бұрын
For i in range(1000): Print("thanks to tim and clement")
@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.
@finiteimpulse3765
@finiteimpulse3765 4 жыл бұрын
Clem, please write the full question statement at the beginning so we could try to answer the question more easily.
@sachinpaul2111
@sachinpaul2111 Жыл бұрын
Very nice question. I was screaming “overlapping intervals” at my screen the whole time but then realized the dude is 19 and I was like “I couldn’t even add 2 and 2 at 19 and this guy is solving this question on demand” Very nice video
@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
@EthanChiu-r6p
@EthanChiu-r6p 4 жыл бұрын
This is so fun!! Wish there would be more mock interviews!
Google Coding Interview With A Normal Software Engineer
59:56
Clément Mihailescu
Рет қаралды 1,6 МЛН
Google Coding Interview With A High School Student
57:24
Clément Mihailescu
Рет қаралды 4,2 МЛН
Perfect Pitch Challenge? Easy! 🎤😎| Free Fire Official
00:13
Garena Free Fire Global
Рет қаралды 100 МЛН
СКОЛЬКО ПАЛЬЦЕВ ТУТ?
00:16
Masomka
Рет қаралды 3,3 МЛН
Hoodie gets wicked makeover! 😲
00:47
Justin Flom
Рет қаралды 133 МЛН
Каха и лужа  #непосредственнокаха
00:15
Google Systems Design Interview With An Ex-Googler
59:59
Clément Mihailescu
Рет қаралды 768 М.
Medium Google Coding Interview With Ben Awad
51:27
Clément Mihailescu
Рет қаралды 1,3 МЛН
Coding Interview | Software Engineer @ Bloomberg (Part 1)
30:05
Keep On Coding
Рет қаралды 4,7 МЛН
How to: Work at Google - Example Coding/Engineering Interview
24:02
Life at Google
Рет қаралды 7 МЛН
Google Frontend Interview With A Frontend Expert
47:59
Clément Mihailescu
Рет қаралды 1 МЛН
Acing Google Coding Interview as an 18 year old High School Student
48:57
William Lin (tmwilliamlin168)
Рет қаралды 2,8 МЛН
Google Coding Interview With A Facebook Software Engineer
49:59
Clément Mihailescu
Рет қаралды 945 М.
React Coding Interview Ft. Clément Mihailescu
47:08
Conner Ardman
Рет қаралды 136 М.
Google Coding Interview With A Competitive Programmer
54:17
Clément Mihailescu
Рет қаралды 2,5 МЛН
TCP/IP for Programmers
3:03:31
Eli the Computer Guy
Рет қаралды 227 М.
Perfect Pitch Challenge? Easy! 🎤😎| Free Fire Official
00:13
Garena Free Fire Global
Рет қаралды 100 МЛН