Google Systems Design Interview With An Ex-Googler

Sdílet
Vložit

Komentáře • 868

  • @clem
    @clem  Před 4 lety +141

    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.

    • @ajourney179
      @ajourney179 Před 4 lety +5

      who is the guy taking interview? where he works ?

    • @Andrew-ez9ft
      @Andrew-ez9ft Před 4 lety

      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???

    • @KeyrptNetwork
      @KeyrptNetwork Před 4 lety +3

      it will be very useful to make another Systems Design Interview?

    • @VishalSingh-kc1jn
      @VishalSingh-kc1jn Před 4 lety +3

      Dude grow some beard. Would look good🔥

    • @techwithwhiteboard3483
      @techwithwhiteboard3483 Před 4 lety +2

      make sure you buy other domains with the same name
      🤔✌

  • @charliel.5794
    @charliel.5794 Před 4 lety +479

    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

    • @bluespeckcf5949
      @bluespeckcf5949 Před 4 lety +131

      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.

    • @vishnuv4813
      @vishnuv4813 Před 4 lety +7

      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.

    • @gavindmello
      @gavindmello Před 4 lety +15

      @@bluespeckcf5949 I thought he could have used a message queue too, but, it wouldn't allow monitoring workers which have gone awol.

    • @cloud5887
      @cloud5887 Před 4 lety +2

      @@bluespeckcf5949 can you elaborate a bit more? What exact corner cases did he miss?

    • @SpencerYork1534
      @SpencerYork1534 Před 4 lety +56

      @@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.

  • @lasophistique3513
    @lasophistique3513 Před 3 lety +91

    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!

  • @nishantt6419
    @nishantt6419 Před 4 lety +186

    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

    • @elliemay1748
      @elliemay1748 Před 4 lety +2

      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.

  • @zss123456789
    @zss123456789 Před 4 lety +29

    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.

  • @khoavo5758
    @khoavo5758 Před 3 lety +800

    "Ex-Googler" means that you now use Bing or what? /s

  • @jlove1296
    @jlove1296 Před 2 lety +28

    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

  • @charan775
    @charan775 Před 4 lety +129

    Every time clement was the interviewer but now for a change clement is the interviewee.

    • @clem
      @clem  Před 4 lety +63

      Gotta flex my owns skills _sometimes_ ! 😎

    • @kevinsheng8775
      @kevinsheng8775 Před 4 lety +1

      Lol clement does sound like a interviewee

    • @kevinsheng8775
      @kevinsheng8775 Před 4 lety +7

      It seems like the interviewer is getting educated from clement lol

    • @yunjiehong4649
      @yunjiehong4649 Před 4 lety +8

      Chinglin Sheng An interviewer has no motivation to speak a lot, while an interviewee needs to think loud

  • @samehghanmi4487
    @samehghanmi4487 Před 4 lety +22

    Thank you Clément for the great video. I learned so much about System Design in less than an hour. Keep it up!

  • @AshutoshAnandashu
    @AshutoshAnandashu Před 4 lety +47

    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 ✅

  • @ramkrishnakulkarni8289
    @ramkrishnakulkarni8289 Před 4 lety +33

    Clement you nailed it man. Fabulously awesome content. I’ve learned a lot from this. Please make more videos like this. 👏👏👏

  • @kkkarki6880
    @kkkarki6880 Před 4 lety +26

    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.

  • @crankerson
    @crankerson Před 3 lety +5

    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".

  • @ankitGrover-LTD
    @ankitGrover-LTD Před 4 lety +2

    Kudos to you Clement and team. This is one of the best interviews I have seen in a long time. Thanks for sharing!

  • @ashrafkotbofficial
    @ashrafkotbofficial Před 3 lety +19

    This is really beneficial, thank you for taking the time to go through a full mock interview.

  • @ShubhamSingh-ku2ow
    @ShubhamSingh-ku2ow Před 3 lety +11

    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.

  • @jeffhsipepi
    @jeffhsipepi Před 3 lety +1

    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!

  • @aritraroy4220
    @aritraroy4220 Před 4 lety +3

    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.

  • @animalrocket4809
    @animalrocket4809 Před 2 lety +2

    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!

  • @Nyquiiist
    @Nyquiiist Před 4 lety +3

    I am so inspired and motivated by your videos Clement. Gonna dive into AlgoExpert starting tomorrow, super excited!

  • @l_karuhanga
    @l_karuhanga Před 4 lety +92

    No one:
    Clément: Thinking back to my experience with code deployment systems.

  • @akkshayganesh1136
    @akkshayganesh1136 Před 4 lety +37

    Brilliant setup. Great cross questioning and really makes the viewer think. Good going Clement!

  • @eduardolucas9896
    @eduardolucas9896 Před 4 lety +1

    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.

  • @Adam-ro2zv
    @Adam-ro2zv Před 3 lety +7

    Hi Clement you're really doing great works for people, I like the way you shares these insightful contents.

  • @thefunkyhermit
    @thefunkyhermit Před 2 lety +9

    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.

  • @kalmurza
    @kalmurza Před 4 lety +12

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

  • @waynegreen7970
    @waynegreen7970 Před 4 lety +1

    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.

  • @zeno_aratus
    @zeno_aratus Před 3 lety +7

    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.

  • @konstantinrebrov675
    @konstantinrebrov675 Před 4 lety

    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.

  • @chimpu92
    @chimpu92 Před 4 lety

    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....

  • @hugovargas8737
    @hugovargas8737 Před 4 lety +1

    I really like this approach in your videos! Thank you for your effort

  • @pushpendrahirwani9105
    @pushpendrahirwani9105 Před 3 lety

    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.

  • @saadakhtar2000
    @saadakhtar2000 Před 4 lety +42

    You're great. Keep creating quality contents for us !

    • @clem
      @clem  Před 4 lety +6

      I'll do my best!

  • @gelosagustin5872
    @gelosagustin5872 Před 4 lety +2

    It's a great interview, looking foward more videos like this!!

  • @josephwong2832
    @josephwong2832 Před 4 lety +27

    Thanks a lot Clem, we need more mock SD interviews just like this for different size companies and different apps

  • @rbianchidev
    @rbianchidev Před 3 lety +1

    A very complete and useful analysis of a complex problem like this one. Thanks a lot!

  • @thinklessdomore4549
    @thinklessdomore4549 Před 3 lety +1

    this was superb !! thanks Clement!

  • @fygascod
    @fygascod Před 4 lety +10

    Or for the queue, use SQS and be done with. Heartbeat by extending visibility of the message, all good.

  • @hbgl8889
    @hbgl8889 Před 3 lety +11

    This is more like an interview about implementing a scalable queue.

  • @notoriouscrt8684
    @notoriouscrt8684 Před 3 lety +3

    What hardware do you use to draw like that? Is it just a Wacom tablet?

  • @AmrMostafaY
    @AmrMostafaY Před 3 lety +13

    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!

    • @ihorhula
      @ihorhula Před 3 lety +3

      Was thinking the same :)

    • @jiaruitian677
      @jiaruitian677 Před 3 lety +1

      Same thought. The transaction's atomicity does not mean only one of the concurrent update requests will be success.

    • @nameunknown007
      @nameunknown007 Před 2 lety +1

      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

    • @JohnTowell
      @JohnTowell Před 2 lety

      Came here to say this

    • @swoogan
      @swoogan Před 2 lety +2

      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.

  • @edreesosman3415
    @edreesosman3415 Před 4 lety

    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?

  • @guiyuxu4084
    @guiyuxu4084 Před 2 lety

    Going for multiple onsite interview all with system design interview, this is the most helpful material I have seen so far

  • @BiancaAguglia
    @BiancaAguglia Před 4 lety +17

    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. 😊

    • @stepanseliuk8042
      @stepanseliuk8042 Před 4 lety +2

      I can recommend “grokking the system design interview” on educative.io and github.com/donnemartin/system-design-primer#index-of-system-design-topics

    • @PoulJulle-wb9iu
      @PoulJulle-wb9iu Před 4 lety

      @@stepanseliuk8042 bra

  • @suboii2978
    @suboii2978 Před 3 lety +14

    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!

  • @shellysclan1901
    @shellysclan1901 Před 4 lety +9

    Hi Clement! Thank you for your effort.

    • @clem
      @clem  Před 4 lety +5

      Hi Shelly's Clan! You're very welcome.

  • @dudukiwi
    @dudukiwi Před 3 lety

    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!

  • @rajasubasubramanian9365
    @rajasubasubramanian9365 Před 4 lety +2

    @Clément Mihailescu : How do we ensure the goal state set right - what I mean is say commit1 we generate build B1 and would like to deploy it - followed by another engineer who do commit2 and generates build B2 and would like to deploy it. When B2 gets deployed which means that B1 changes would also get included. So when it's deployed in the following order B1 -> B2 then there will not be an issue. But what happens when the build is deployed in the order B2 -> B1? How does the system here captures it? Or am I missing something here?

  • @Kitsuki42
    @Kitsuki42 Před 4 lety +1

    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!

  • @alexandrudascal5585
    @alexandrudascal5585 Před 4 lety +2

    A great example of a System Design interview, really looking forward to more this kind of videos

  • @billb.8980
    @billb.8980 Před 4 lety +15

    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?

    • @Tourach74
      @Tourach74 Před 3 lety +3

      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.

  • @illuminek
    @illuminek Před 4 lety +17

    @clement which tool do you use for white boarding and drawing for system design?

    • @nobytes2
      @nobytes2 Před 3 lety

      There's literally thousands of drawings apps.

  • @valeriyblyus3958
    @valeriyblyus3958 Před 3 lety

    It was brilliant, thank you Clément Mihailescu!

  • @mattrex002
    @mattrex002 Před 4 lety

    Nicely Done. Very impressed how you think and build up slowly and systematically

  • @hazzhaston4777
    @hazzhaston4777 Před 4 lety +4

    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. 😁👍

    • @clem
      @clem  Před 4 lety +1

      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 👀

    • @hazzhaston4777
      @hazzhaston4777 Před 4 lety

      @@clem no worries if you don't. Loving the work so far. 😊

  • @iorekby
    @iorekby Před 4 lety +6

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

    • @danielrocks234
      @danielrocks234 Před 2 lety

      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.

  • @TheDsasadsad
    @TheDsasadsad Před 4 lety

    Very insightful.
    Watched the whole thing.
    Thank you Clement

  • @mikedqin
    @mikedqin Před 2 lety +55

    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.

    • @artemtraer7615
      @artemtraer7615 Před 2 lety +1

      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

    • @mputcha
      @mputcha Před 2 lety +3

      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

    • @dorcohen3522
      @dorcohen3522 Před 2 lety +2

      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.

    • @Core433
      @Core433 Před rokem +11

      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.

    • @xtzyshuadog
      @xtzyshuadog Před rokem

      @@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?

  • @oleksii7691
    @oleksii7691 Před rokem

    Oh man, awesome content. Thank you very much!

  • @nasserrcorcuera93
    @nasserrcorcuera93 Před 4 lety

    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!

    • @JM_utube
      @JM_utube Před 4 lety

      lol i mean this is definitely based on experience.

  • @chainer22
    @chainer22 Před 4 lety +8

    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?

  • @codeninja8813
    @codeninja8813 Před 4 lety

    Very helpful video, Clement. Keep going!

  • @TashingaPemhiwa
    @TashingaPemhiwa Před 2 lety +1

    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?

  • @karpuzye
    @karpuzye Před 7 měsíci

    this is a high quality content! Thanks a lot!

  • @smanqele
    @smanqele Před 3 lety

    I love this. Very much. Thank you guys

  • @somil47
    @somil47 Před 4 lety

    This is really great. Thanks for making such videos. Really informative and helpful.

  • @kartike6704
    @kartike6704 Před 4 lety +1

    I just wanted to know, is a single question scoped so deep or are there more questions in interviews?

  • @mathewrajan8514
    @mathewrajan8514 Před 3 lety

    This really helped me in my interview . Thank you 😊

  • @gauravagarwal8592
    @gauravagarwal8592 Před 3 lety +1

    Man top class session I really enjoy it damn good u covered all the basics concept..

  • @Victor-gj5hy
    @Victor-gj5hy Před 2 lety +1

    great presentation. looks like a totally real interview. guy on left is even little bit annoyed. very real

  • @ss_lemonade
    @ss_lemonade Před 4 lety

    I'm only familiar with mysql, but when using sql as a queue, won't you still need an row lock against the row picked up by a worker (probably using something like "select for update") or else you could still run into severe concurrency issues?

  • @SamyakMehta1508
    @SamyakMehta1508 Před rokem +2

    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.

  • @Ziemecki
    @Ziemecki Před 3 lety +1

    Hi Clement! How're you? I hope well. I was wondering how different is one System Design Interview and the System Design and Scalability interview that does Google for a Software Engineer Position when you reach the on-stage part of the process where there are more or less 4 interviews (3 technical and one non-technical).
    Thank you! Love your videos!

  • @darciogmail
    @darciogmail Před 2 lety +1

    Great video! What are you using for sketching? It helped a lot to make the interview to flow nicely…

  • @achilles165
    @achilles165 Před 3 lety +23

    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.

  • @tebbythomas1809
    @tebbythomas1809 Před 4 lety

    Excellent video! Thank you

  • @bespoyasov
    @bespoyasov Před rokem

    Super useful, thanks!

  • @RamB0T
    @RamB0T Před 4 lety +9

    I love systems design, especially coming from the Hadoop + ETL world 😎

  • @superbmood
    @superbmood Před rokem +1

    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.

  • @kp8607
    @kp8607 Před 3 lety

    Thanks for the great content! May I ask what tool you used for the drawing? It'll help system design interview a lot!

  •  Před 3 lety

    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!

  • @sachinchauhan6489
    @sachinchauhan6489 Před 2 lety

    Loved it, learned something new in system designing.

  • @bryanurizar
    @bryanurizar Před 3 lety +3

    This was extremely interesting! I have no background in system design, but really thought this was cool!

  • @Nainara32
    @Nainara32 Před 4 lety +1

    Is the queue + polling approach necessary for a company with infinite compute resources like google? Couldn't you just monitor utilization of the worker pool and dynamically scale it up to meet surge demand? This way, your "queue" microservice could just log the job state and propagate the build call on to the next available worker node. Would your score get docked for answering this way?

  • @haiangho8210
    @haiangho8210 Před 4 lety +1

    sorry, but may I ask you that, what app are you using to draw ?

  • @JamesStiling1985
    @JamesStiling1985 Před rokem

    This was great. I am a little rusty on System Design and this got my brain revved up again.

  • @jewjonny5621
    @jewjonny5621 Před 2 lety

    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.

  • @venkateshTD
    @venkateshTD Před 4 lety +25

    When we got to the part where we were trying to figure out a way to find out if a worker died, I was shouting "heartbeat mechanism" sitting in front of the screen, coz that was the first concept we learnt in our software architecture class. It was so satisfying when I heard you said the same haha. Great video and it does feel like a very real interview

  • @accessory2008
    @accessory2008 Před 4 lety +1

    Thanks for the video. The p2p network part for downloading build is interesting. :)

  • @dfeprado
    @dfeprado Před 4 lety +9

    Amazing video! What's the software you're using to write (this "blackboard")?

  • @zelimkhandurdishev7225
    @zelimkhandurdishev7225 Před 4 lety +4

    Hi Clement.
    For which level programmers that kind of system design interview is considered for?
    For example:
    L3
    L4
    L5
    (as at google)

    • @elliemay1748
      @elliemay1748 Před 4 lety

      I don’t know about Google levels, but it’s common at a senior level.

  • @resilientprogrammer8466

    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.

  • @ibrahimshaikh3642
    @ibrahimshaikh3642 Před 4 lety +1

    Loved this, learnt new things

  • @uskro
    @uskro Před 3 lety +1

    I don't get why you'd set a heartbeat to write to the db that frequently. You could just set a timestamp of assignment and your health check could just check the timestamp delta. You could have a read query executed every 5 minutes, to find the running operations updated over 15 minutes ago to find the problem operations. But you could also benefit from a worker identifier in the table, and your health check could also be a queue solution to check both with your table and the workers, maybe the operation is just taking longer than expected so you also wouldn't want to reassign the operation to another worker and have the code deployed by two different workers.

  • @_rishav_mishra_7547
    @_rishav_mishra_7547 Před 4 lety

    A very helpful video. Keep up the good work.

  • @himanshuupadhyay6749
    @himanshuupadhyay6749 Před 3 lety

    Thanks for the wonderful explanation.

  • @alexfeguson1
    @alexfeguson1 Před 3 lety +11

    Great job. I would like to see a feedback at the end of the interview, but it is just my humble opinion. Thanks

  • @littlepea12
    @littlepea12 Před 4 lety +3

    What tool are you using for live handwriting on the screen? :)

  • @Shogoeu
    @Shogoeu Před 2 lety

    He looked so excited about this mock inteview!

  • @altereago1
    @altereago1 Před 4 lety +26

    Clement, I am curious why you didn't use a 'message queue' instead of the SQL table for task queueing?

    • @karimhasebou4252
      @karimhasebou4252 Před 4 lety +1

      I have the same question, why not something similar to kafka.

    • @knightwfu
      @knightwfu Před 4 lety +2

      I don't know what the answer is, but I would imagine that a message queue works for maintaining which requests are available, but by itself it's not enough. For example, what happens when the request fails or times out? How do you make sure that exactly one request is being processed by the workers? How can you represent the status of all jobs, past and present?
      My first reaction is to implement using AWS SQS; by itself, SQS FIFO might handle exactly once, some basic request error handling, but based on the read/write volume and the use cases, I think a SQL might be a great first pass.

    • @CodeCampaign
      @CodeCampaign Před 4 lety +12

      Using Database for queuing is famous anti-pattern.

    • @skiller1339
      @skiller1339 Před 4 lety +1

      @@knightwfu I think a message queue would actually be a better option. You could set the prefetch to 1 to make sure the worker only consumes one message and when a worker starts building you could dispatch an event. You would only acknowledge the message after the build is done, in that case if the worker stops and a new one would start up it will just try the message again. Whenever something happend you could dispatch an event (for example BuildStarted, BuildFailed, BuildDone and BuildCancelled). These events would be consumed by another service which builds an representation of the current status. Also when you want to cancel the current build you could make sure that all messages for a certain job would end up at the same consumer (for example with a consisten hash exchange in rabbitmq).

    • @ronquan3730
      @ronquan3730 Před 4 lety +9

      I think the thread above is great, a point I want to call out is Messaging systems like Kafka are durable message queues in the sense that messages are persisted to disk. This actually could have been expanded on rather than going with the SQL Table approach. If this system is used by the entire company for every commit of every repository this won't scale well with a SQL Table as you'd have more writes than reads due to status updates. Messaging system would be more scalable not just with durability but also performance as you can partition on the hash of the repository and preserve order of the commits.