Google Systems Design Interview With An Ex-Googler
Вставка
- Опубліковано 2 лип 2024
- This is what a systems design interview at Google, Facebook, Amazon, or any other big tech company looks like. Systems design interview questions are vague and challenging, but this video should give you a clear idea of what to expect. If you want to ace the systems design interview, check out SystemsExpert at www.systemsexpert.io
SystemsExpert: www.systemsexpert.io
AlgoExpert: www.algoexpert.io/clem
My LinkedIn: / clementmihailescu
My Twitter: / clemmihai
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!) - Наука та технологія
I hope you all find this mock systems design interview insightful! And if you're in the business of acing your systems design interviews (who isn't? 😎), be sure to check out www.systemsexpert.io where we have more questions like this one as well as a full course on all of the fundamental systems design topics that you need to understand to tackle these types of interviews.
who is the guy taking interview? where he works ?
Clement, I have some questions.
What is the fastest way to become a junior developer in 2020???
What is the best way to learn programming to build advanced projects???
it will be very useful to make another Systems Design Interview?
Dude grow some beard. Would look good🔥
make sure you buy other domains with the same name
🤔✌
I'd like to hear the feedback from the interviewer, I think that's the important part on distinguishing what went well and what didn't
The feedback is probably that he's missed a lot of corner cases (interviewer mentions at least 2 of them in the video), and I don't know why he's not using a messaging queue instead. In short, this is probably a weak interview.
Normally, the interviewers not sure about the solution themselves or they would have a template solutions which they feel that would fit every problem. So, they would not be able to comment on our design.
@@bluespeckcf5949 I thought he could have used a message queue too, but, it wouldn't allow monitoring workers which have gone awol.
@@bluespeckcf5949 can you elaborate a bit more? What exact corner cases did he miss?
@@cloud5887 For Example, one that I caught, was the worker heartbeat, what if the job is successfully completed but didn't send a heartbeat due to a network error, you wouldn't want to run the build again. Another is he never mentioned storage for the build artifacts, and how to resume a build from the artifacts, or use them, if you are building a build system, you definitely need to cover some sort of distributed storage for build artifacts, if you are building 100k times a day you don't want to have to download JS, or .NET, 100k times, even if you are pulling from your own repository you want to eliminate as much bandwidth usage as possible. BUT overall this is a good interview, maybe not perfect, but that is typical for most interviews, I think it was more important to show how he interacted with the interviewer, asking questions, clarifying requirements. Most companies want to see how well you handle overall project communication so as to best deliver according to the stated requirements.
"Ex-Googler" means that you now use Bing or what? /s
hahahahh underrated joke
Yep, now he uses Bing to see StackOverflow answers
maybe duckduckgo
He still uses UA-cam though 🙂
It means he's not evil anymore lol
wow...simply amazing.....this is like a real world experience for the system design interviews
most of the videos on youtube are just about explaining the system design about some popular applications like messenger, tinyurl, dropbox etc...
all of them have one thing in common....all of them explain the design very well in only one aspect....they are all well structured, there are no hiccups, there is not much thinking to do.....they design the system without any flaws...why? because they know the design and there is no interviewer who is asking for in depth details or looking for more clarifying answers...they just explain the system in only one direction
This is totally different and the one which we actually need.
This is by far the best for multiple reasons
1. It shows how a real world interview looks like with all the white boarding sessions
2. the question given by the interviewer is very abstract....the interviewee may know the design in one particular aspect, but the interviewer is looking for some different aspect and asking more in depth details at every stage
3. the interviewee actually asks a series of questions at the start and also keep asking different questions time to time
4. at times the interviewer stops the interviewee because he missed explaining few details and missed details about fault tolerance and keeps asking for more in depth details about how the interviewee is approaching his design
5. its more of a collaborative brainstorming which actually happens in real world
6. it also showed how the interviewee picked some technologies like SQL, GCS, KVS etc and validated it with his explanation, getting approval of the interviewer and proceeding to the next stage at every point in the interview.
Totally worth watching the whole video.....thank you Clement and kudos for creating such a valuable content
hope to see more such videos
Yeah this is exactly how this goes in real interviews. When I interviewed at Amazon for engineering manager, I was asked to write an analytics system with 1 million writes per second. It was a bit more challenging than this example in terms of scale, but still similar in concept.
This is VERY helpful. This is literally better than any video that just tells you general tips that are hard to follow in an interview setting.
I used to have zero understanding of the importance of clarifying requirements and used to ask typical dimension clarifying question without knowing how that could actually help me solving the problem at hand. You really showed how you could incorporate the information you gained by asking clarifying questions through this mock interview - appreciate it
What I loved most is, it actually went on like a real interview, where candidate doesn't know all the answers, and kept building on the assumptions, kept extending the designs. Thank you for making it look realistic!
Thank you Clément for the great video. I learned so much about System Design in less than an hour. Keep it up!
This is really beneficial, thank you for taking the time to go through a full mock interview.
Clement you nailed it man. Fabulously awesome content. I’ve learned a lot from this. Please make more videos like this. 👏👏👏
Kudos to you Clement and team. This is one of the best interviews I have seen in a long time. Thanks for sharing!
Your help and free content is appreciated, and I am rooting for the success your entire business. There is nothing brighter than an honest and smart effort. Keep shining.
This was so good. Thank you @Clement for giving us an insight on what goes on in a real system design interview. Kudos to the interviewer as well. He asked brilliant questions and put up some interesting extra questions to make it difficult yet understandable.
Subscribed ✅
Clement, I really like the way how questioned to dissect every aspect of the question, to collect as much as information which is a super motivating tool for all developers.
Thanks Clément! What I really enjoyed about this video is that someone non-technical like myself, can still gain valuable insight/understanding into how to tackle these tricky system design questions. Great video!
Every time clement was the interviewer but now for a change clement is the interviewee.
Gotta flex my owns skills _sometimes_ ! 😎
Lol clement does sound like a interviewee
It seems like the interviewer is getting educated from clement lol
Chinglin Sheng An interviewer has no motivation to speak a lot, while an interviewee needs to think loud
I am so inspired and motivated by your videos Clement. Gonna dive into AlgoExpert starting tomorrow, super excited!
Such an AMAZING video Clement. Before this video, I went through few others but this one literally beated them all. The quality of the questions asked and the way you responded gave a Google feel. Thanks ALOT for bringing such high quality content. Absolutely terrific.
This was really good. I often paused the video to offer my 2 cents and thought out loud. Really liked the collaboration between Clement and the interviewer. Also, one subtle thing is Clement’s frightlessness in asking even the most simple questions and repeating things in his own words. This is what allowed him to really build and understanding of the problem, as the interviewer’s words may not click the first time and they are meant to be ambiguous so it fosters clarifying questions.
His interviewing skills really showed off here. So much to learn!
Very good content as usual. I'm doing all mock interviews available in SystemsExpert and I'm very impressed by how much effort you put on this.
Brilliant setup. Great cross questioning and really makes the viewer think. Good going Clement!
Hi Clement you're really doing great works for people, I like the way you shares these insightful contents.
Great video Clement. Thank you for sharing an insight into how these interviews are conducted.
2 things I would have prodded more for as the interviewer are:
1) How do you deal with downtime while switching between the versions?
2) How do you manage DB changes as well as the code changes discussed here.
Thanks for the great content. Even if someone doesn't get a job at a FAANG company, it will help them become a better programmer. Your courses are definitely a step up from the vague books, tutorials, and blogs that were available sparingly just a few short years ago. While some of those resources were adequate for people who learn well from books, the videos help those who are visual learners by actually seeing the diagrams, and hearing what to say, how to say it, and what questions to ask. Thanks for providing this service.
No one:
Clément: Thinking back to my experience with code deployment systems.
I will leverage that :D
Thank you so much for this mock interview. This is one of the best video about system-design interview for starters to learn on what to expect in a design interview and how to respond to make the interview a success....
Great video. I totally recommend pausing the video after each feedback from interviewer and try to continue the design based on his comments. And great job, Clement. You basically recaptured Gitlab CI’s structure :)
The SQL transaction would ensure that all of the SQL statements would run together or not at all (rollback), but it doesn't ensure atomicity. In this design, to prevent multiple workers from running the same job concurrently, wouldn't you need to specify the isolation level on the transaction in order to prevent a non-repeatable read? Example: worker 1 selects the oldest "queued" job. worker 2 selects the oldest "queued" job. worker 1 updates the job status to "running".
Thanks a lot Clem, we need more mock SD interviews just like this for different size companies and different apps
I really like this simulated version of the system design interview. I do have more clarity now on what I should be emphasizing on more in terms of approaching the problem statement. Thanks Clement.
Going for multiple onsite interview all with system design interview, this is the most helpful material I have seen so far
Thank you Clement. You are producing many high quality videos with useful information for software engineers. I always learn something interesting. Hats off to you.
You're great. Keep creating quality contents for us !
I'll do my best!
This was very useful. Not only did it help me get a better understanding of systems design from a software development perspective, it also gave me some ideas for better designing data science specific projects.
Thanks to both of you. Keep up the great work. 😊
I can recommend “grokking the system design interview” on educative.io and github.com/donnemartin/system-design-primer#index-of-system-design-topics
@@stepanseliuk8042 bra
It's a great interview, looking foward more videos like this!!
I really like this approach in your videos! Thank you for your effort
I've always found estimating workload to be a challenging part of design, especially when you do not have as much information as you'd like to go on. So in one instance I have gone for determining the nightmare scenario and developing system specs based on that.
This is really awesome. This video is an eye-opener. Now I consider the system design question is not just a question, but it is a real task in the company. And the interviewers already know what they want, but they don't speak for themself. So an interviewee should find out what they want using additional questions like real life!
A very complete and useful analysis of a complex problem like this one. Thanks a lot!
Bravo pour ta vidéo Clément, tu fais un excellent travail ! C'est précieux d'avoir accès à de telles connaissances, merci de rendre cela plus accessible. Let's go!
Hi Clement! Thank you for your effort.
Hi Shelly's Clan! You're very welcome.
I loved this. Thanks so much for taking the time to put this high quality video! I've a small comment that I can't get out of my head: The SQL transaction that workers use to grab jobs seem to have a race condition that might make 2 or more workers grab the same job. I don't think ACID here protects from that. Locking needs to be done somehow to prevent that, and the first option I'd explore, as it's the simplest, is to change the SELECT to SELECT FOR UPDATE, assuming the underlying SQL engine supports it which is guaranteed to lock the resulting row for a single worker until it had a chance to perform the update on the status. If SELECT FOR UPDATE is not supported, we can explore other options such as manual row-level or table-level locking.
Great stuff, thanks again!
Was thinking the same :)
Same thought. The transaction's atomicity does not mean only one of the concurrent update requests will be success.
Exactly my thought. Plus I was thinking why he wouldn’t use a tool built for queues instead of making sql fit into this use case. Especially when the interviewer asked him do you think this will serve the purpose and he doubled down on it lol. Note to myself: listen carefully when such a question comes up haha
Came here to say this
You can actually build a queue in SQL without SELECT FOR UPDATE, or any implicit locks. You do an update on the row, setting its state to RUNNING, where the id matches and the row is in the QUEUED state. If the affected rows is 0, the task has already been picked up. If it is 1, you have picked up the task. Note that autocommits need to be enabled on the UPDATE, or there is no difference from SELECT FOR UPDATE.
First of all, thanks for making these available Clem. I seen a lot of videos about the systems design interview in preparation for my interviews and I'm a SystemsExpert customer, but I'm wondering if you could explain the difference between a novice , intermediate, and expert level performance. What criteria can be used to determine what level someone is and how able they are at designing good systems. Thanks!
Love it. Looking forward to more of these. I like the open endedness of system design. System's expert has a great glossery section. I can't wait for all the designs to be unlocked. Just a few more days! I would love a discussion type section to ask question and discuss my own choices. Still, love the work done so far. But don't stop. 😁👍
Really glad to hear that you like it! And thanks for the feedback; the discussion section you're mentioning is something we're currently considering adding 👀
@@clem no worries if you don't. Loving the work so far. 😊
this was superb !! thanks Clement!
Awesome. Just like the interviewer said, this architecture is very close to the one's being used in the real industry - just like in my company. I was so amazed you just thought of the design on the spot. Again, great content!
lol i mean this is definitely based on experience.
Great to see this sort of thing. So many people trying to get in to tech are obsessed just with software engineering. There's a whole gamut of careers and skill sets in tech, and hopefully this will open people's eyes to the opportunities aside from software engineering (nothing wrong with software engineering, btw).
This is the kind of interview *is* for software engineering. This is what senior SWEs at major tech companies go through in the interview process.
A great example of a System Design interview, really looking forward to more this kind of videos
Nicely Done. Very impressed how you think and build up slowly and systematically
It was brilliant, thank you Clément Mihailescu!
I've seen some of your videos before, but this one got me to subscribe. This truly felt like a real interview and I can't wait to see more. Keep up the great work! Maybe you and Antoine (I hope I'm spelling his name correctly) can switch roles for the next one?
great presentation. looks like a totally real interview. guy on left is even little bit annoyed. very real
Or for the queue, use SQS and be done with. Heartbeat by extending visibility of the message, all good.
Very helpful video, Clement. Keep going!
Amazing content! Thank you for making this. I have a question regarding the peer-to-peer deployment solution proposed. How does that work? Is there any existing tools or services that provides this capability?
Thank you for sharing insight into the process of system design. I think an important question relating to the regional swarms sharing new builds may have went unanswered. Using this design, how do you determine which node(s) download the builds initially from GCS in order for it to be shared via the p2p network while avoiding hundreds or even thousands of them simultaneously attempting that initial download?
I had the same thoughts. I think you could implement an election process to select 1 or more leaders who would be allowed to download from GCS. If the leader dies, the P2P network would then elect a new one.
The way you delivered intro
deserves a like :)
This was extremely interesting! I have no background in system design, but really thought this was cool!
Fantastic video. Full of knowledge and very engaging. Thanks for this Clement!
One different approach for managing the workers could be to have just one service poll the SQL table (queue) and spawn new instances on demand (Spot instances, may be) to run the jobs. Rest of the architecture remains the same i.e the spawned instances still send heartbeat signals. This could prevent over provisioning of workers especially during times when no builds are run (code freeze) or very few builds are run. But it comes with an additional waiting time equivalent to that taken by a new instance to boot up when none of the available instances are available to take up a new job.
riigtht and mathemtiacally it may not be suitable
Great interview video: I liked the most is the interaction between the interviewer and interviewee. Some thoughts on the design: 1) the SQL database can be a Queue system such as Kafka or Pub/Sub from GCP, which handles the scale very well with partitions. Given the large scale, the frequent query and updates to the SQL database will harm the performance, especially update the worker's heartbeats every second in the table. So a message broker will be the best solution. Worker status / heartbeat should be monitored and reported to a monitoring system such as Prometheus. Worker can push its health check status to Prometheus. 2) The interviewer tried to ask system design in Non-Abstract way, meaning how many servers are needed, do an analysis on bandwidth, timing, storage in a datacenter, and non-uniformed load (x1.25), then 3 datacenter deployment in a region, to derive the footprint per datacenter and global footprint. I hope the interviewee can elaborate on the Non-Abstract design more. Overall, a great system design interview. Thank you very much.
I guess problem with Kafka is that it stores the msges in topic only for some period of time, and also how would you update the record inside the topic . But there could be a sql - Kafka replica tho
I had imagined a distributed queue and a separate process to store the jobs for retaining history if needed. DB for queue will be expensive. Maybe even a DB+ Redis Cache where the server pulled off from a queue structure if access to cloud services is a constraint
100% right. I can add two more things on top of this.
1. Why building SQL queries is important for system design interview? We should deal with more abstract design, and maybe, later, it's possible to talk about SQL in depth, but they wasted so much time on it.
2. The presented SQL query will now work properly under load, this is why a queue system is by far superior, I couldn't understand why he wouldn't just use that, we can retain the data for as long as we want and slap extra metadata on top.
I think SQL is indeed a better choice than message queue (i.e., Kafka) here. MQ for stream processing might be appropriate for super high QPS workflows, but assuming a giant tech company with 40k devs each with 2 commits per day, that's only 0.9 QPS builds coming into this build system, which is well within the abilities of a SQL DB and complete overkill for MQ. Additional reasons why MQ is not an ideal option:
1) MQ tends to have low retention, you'll need to end up storing your jobs in some persistent store like SQL or NoSQL DB anyway to preserve full history
2) It's difficult to parallelize MQ unless you have multiple partitions / topics which match the number of workers -- this is because coordinating multiple workers consuming the same MQ partition is difficult. Yet the low QPS of input to this system does not warrant partitioning to me.
3) As the presenter explained, SQL DB has built-in consistency where build workers need to acquire a read/write lock to obtain the rights to build a job. MQ does not provide this out of the box, so it's up to client to coordinate worker pool. See point 2 above on why this is difficult.
4) MQ does not preserve order of jobs between partitions, and it was a requirement that jobs be roughly started in the same order they come in.
I think jumping to the conclusion that we need MQ for *any* kind of queue can be a detrimental mindset in system design, and could hurt a candidate in a system design interview. It's worth understanding the tradeoffs and explaining this to the interviewer.
@@Core433 How does one enter the career path of system design? What prerequisite knowledge, certifications, skills would you think they would need? Are there particular programming languages or tools for home situations one can practice in by designing their own simple small systems using free tools?
This really helped me in my interview . Thank you 😊
This was great. I am a little rusty on System Design and this got my brain revved up again.
This is a great initiative, having open programming interview. It's my first interview I witnessed live. Imagine how long I have to go. But that doesn't intimidate me either.
Very insightful.
Watched the whole thing.
Thank you Clement
Thanks for the video. The p2p network part for downloading build is interesting. :)
Oh man, awesome content. Thank you very much!
This is more like an interview about implementing a scalable queue.
I wish I saw this before I went to an interview recently. I touched the high level design but I was lack of explaining more details in each service. Now I know why I failed. Thanks for the video.
Can you share more about the problem statement?
this is a high quality content! Thanks a lot!
Great job. I would like to see a feedback at the end of the interview, but it is just my humble opinion. Thanks
Man top class session I really enjoy it damn good u covered all the basics concept..
More practical videos like this are required
Most time spent on build system, not too many details covered about the deployment systems like safety of deployment, health checks, configurable deployment speeds, rollbacks, global service health \ availability checks to pause, incident management. These things are highest order bit for any large scale company as no one wants a global or regional outage.
Loved it, learned something new in system designing.
Was very interesting, thank you for sharing. Cant imagine why someone should dislike this video..
I love this. Very much. Thank you guys
I love systems design, especially coming from the Hadoop + ETL world 😎
He looked so excited about this mock inteview!
Very helpful video, thank you
I wondered if a pub/sub design would be more valuable in this scenario than a polling design
What do you do if multiple users publish the deploy message at the same time, and since it's spread out globally - how will you know which build to deploy first ?
Learning some of the ideas in here helped me land a FAANG job. As a junior engineer I didn't think to use a SQL database to implement a queue for real systems at scale.
great job man.. may i suggest extra tiny table having the enum status against a timestamp so we can get each status date and time
Excellent video! Thank you
This is really great. Thanks for making such videos. Really informative and helpful.
Appreciate the Good-luck at the end homie!
Great mock interview session 👍🏽. Question: what do you think about some kind of status on the main KVS to ensure that a binary has been completely downloaded everywhere before allowing the KVS to be updated?
I didn't understand why you took so long to start designing the actual system (40 minutes to design the queue). Also, a couple of times the "Binger" (ex-Googler) asked you a couple of times to explain what would back your queue. And when you said it would be a SQL database, he asked you how the dequeue operation would be, you spent more time than I expected to explain it.
I would use some already existent queue system and use another database to store the building/deploying data.
Despite that, thank you for the amazing content, Clement! keep it up!
Thanks for the Google system design sneak peek.
Clement, Nice interview, I liked it. Only one thing, I am not sure about the fact that two servers won't pick up the same job using the code you've done. You might do a more complicated logic to pick up that job. If two jobs do the select at the same time, both will get the same job unless you are blocking the table.
The interviewee was quite weak I have to say.
He could have done at least a SELECT FOR UPDATE SKIP LOCKED or equivalent.
Pretty impressive stuff, that's a sophisticated system design challenge.
it's very useful for me to particate the same system design problem with so many people , it improve me so such.
A very helpful video. Keep up the good work.
The last part of the build trigger P2p network can be handles by a consensus protocol like RAFT, most disributed consensus systems today (Consul, Kubernete, nosql DBs etc) are handling state in that way and sending commands to the rest of the workers to set the desired state.
Super useful, thanks!
Loved this, learnt new things
Thanks for the wonderful explanation.
new vid from Clem, POG
POG is exactly the word to use.
Informative interview! Enlightening to hear Clement's and the interviewer's thought processes.
One question: are there any other options to implement the queue other than a SQL database table?
I appreciate this a lot, it helps cleaar some ideas and helps reinforce our thoughts as well.
One thing though, the number of writes for last_h seems high, a liveness/heartbeat check may work as well with the monitoring/auxillary service just subscribing to a MQ with an event set ( start/stop ). And just add the Worker information in the DB table. That ways, any build logs on the worker can also be easily verifiable and writes for Last_h would reduce a lot.
However, this is just a small thought, and this system design itself is splendid enough
This is great, Clem. It's good to see you asking so many clarifying questions. I sometimes have the wrong-headed mindset where I don't want to ask a question that could reflect negatively on me.
One thing: What does "2-3 nines" mean?
99.99-99.999% availability
Great video Clement.
Glad you liked it!