System Design Mock Interview: Design WhatsApp

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 พ.ย. 2024

ความคิดเห็น • 105

  • @tryexponent
    @tryexponent  2 ปีที่แล้ว

    Don't leave your system design career to chance. Sign up for Exponent's system design interview course today: bit.ly/4acJ5BN

  • @ChandraShekhar-by3cd
    @ChandraShekhar-by3cd 2 ปีที่แล้ว +93

    I guess there were many missing point in the video :
    1 . Whether you should choose CA or CP system
    2 . DB schema , He was not clear with why to choose No-sql db. Whatsapp still uses SQL DB for the storage of messate.
    3. Cache and CDN
    4. Load balancer role
    5. How to get the online presence, he just keep putting all the responsibility in the Session Management Service only!
    6. What if users are from different time zone.
    7. How to handle the concurrency and idempotency of the system.
    8. Tradeoffs
    Please do consider these points for the next upcoming System design or LLD videos!! Thanks!

    • @saurabhtanwar7299
      @saurabhtanwar7299 2 ปีที่แล้ว +3

      Yes, Other interviews were good of exponent covering all points but This one misses out all these points, This one looks more of bookish to me. CodeKarle -(th-cam.com/video/RjQjbJ2UJDg/w-d-xo.html) is close to correctness covering all aspects.

    • @IdoKleinman
      @IdoKleinman 2 ปีที่แล้ว +17

      On point. Exponent's mock behavioral interviews are good however all of their system design mock interviews are really superficial, don't cover the hard issues or tradeoffs and just won't fly as a full correct answer in a real world interview.

    • @ChandraShekhar-by3cd
      @ChandraShekhar-by3cd 2 ปีที่แล้ว

      @@IdoKleinman Yes, Agree with your point, they should provide in-depth knowledge on the topics and also the interviewee should come prepare before in hand so that he can convey the message quite precisely and clearly.

    • @ChandraShekhar-by3cd
      @ChandraShekhar-by3cd 2 ปีที่แล้ว

      @@saurabhtanwar7299 Yes , I agree with the point. They should give quality content at least in their initial phase, they can charge later on, but they are trying to increase the userbase compromising the in-depth content.

    • @tryexponent
      @tryexponent  2 ปีที่แล้ว +3

      Hey Chandra! Thank you for sharing those points with us. Just sent them over to the team Slack channel to take a look at as we develop more System Design content. Thanks for taking the time to share your honest feedback. Promise it's helpful!

  • @praveen3123
    @praveen3123 2 ปีที่แล้ว +85

    I hope his manager will not PIP him after watching this :p

    • @nammi895
      @nammi895 8 หลายเดือนก่อน

      😂😂😂😂😂😂😂

  • @rjkal
    @rjkal 2 ปีที่แล้ว +41

    It was a decent effort, but I felt some things could be improved.
    I am not sure why he jumped to the API gateway and microservice part that quick. Also, it felt like he was defining the requirements rather than letting the interviewer suggest or nudge him.
    - The group messaging logic wasn't satisfactory at all. I got confused when he started with all the maps & lists, that are more oriented towards coding the backend logic rather than how the different pieces in the system interact.
    - Why can't we scale SQL databases? Of course, we can, just that it is going to be more of vertical scaling. There are significant other differences between SQL & NoSQL that weren't mentioned.
    - the database table schema could've been explained with more details like the various attributes, data type, the linking between a user table & content table, or contacts table
    - Also, as someone else commented, there are no location/timezone issues handled here
    - And what about using an object data store to store images to serve later or download later?
    - A cache for sending messages when the user is offline, cache store policy
    - API gateway distribution can be done with a load balancer and could use logic similar to the database sharding mechanism such as based on geography or based on a list of UUIDs

    • @raghavddps2
      @raghavddps2 2 ปีที่แล้ว +1

      Isn't consistent hashing a better approach than to assign randomly keeping limit and all?

  • @MosonMo
    @MosonMo 2 ปีที่แล้ว +30

    sorry bro, like a lot of other people already commented, you do miss a lot of points here. In particular, for message delivering and group chat, it should use something similar to Azure Service Bus (queue for peer to peer communication) (topic and subscribers for group chat). If privacy is a concern, one could encrypt the message with a key belong to the receiver. This will handle wether receiver is online or not... Socket connection requires both parties to be online.

    • @gowris442
      @gowris442 ปีที่แล้ว

      S we can try to use something like consumer group கான்செப்ட் for group messages

    • @serhiiDev
      @serhiiDev ปีที่แล้ว

      agree. there are a lot of white spaces.

  • @infimode
    @infimode 14 วันที่ผ่านมา

    First thanks for putting this for free!, but just a suggestion to make it more realistic
    - interviewer should ask hell lot of cross questions

  • @anveshicharuvaka2823
    @anveshicharuvaka2823 2 ปีที่แล้ว +8

    This is just a bad example of an interview. I wouldn’t be harsh if it was a random attempt. But this is not just an attempt by a random interviewer. This is here to teach others how to interview.
    Websockets are not for P2P. The interviewer asked justification for NoSQL and they said scalability and it was just accepted. There are trade offs in every decision and it has to be properly justified in this particular situation. Not just give random textbook benefits of a technology. What does schema evolution mean? If NoSQL was applicable in every scenario why not use it everywhere.

  • @varunvats32
    @varunvats32 2 ปีที่แล้ว +36

    WebSockets are not P2P.

    • @SaurabhKumar-uo6ms
      @SaurabhKumar-uo6ms 2 ปีที่แล้ว

      I am new to system design. please provide link (any article) that shows webSockets can not be used for P2P. please also suggest some common Peer to Peer protocols that will be useful to read for interview.

    • @NM-jq3sv
      @NM-jq3sv 2 ปีที่แล้ว +2

      @@SaurabhKumar-uo6ms Websockets are more like longlive connections but peer 2 peer is different protocol. it is used for large file delivery over multiple clients from a file server where each of the worker in peer copies a packet and transfer to another and so on reducing latency. Please watch clement code deployment system sys design interview it uses this protocol.

    • @vetiarvind
      @vetiarvind 2 ปีที่แล้ว +3

      He means duplex, but it's obvious what his intention is.

  • @jasper5016
    @jasper5016 2 ปีที่แล้ว +14

    After watching all these Amazon candidate's interviews, Amazon hires below avg people.

    • @xardiannon5038
      @xardiannon5038 8 หลายเดือนก่อน

      No kidding. This was pretty bad.

  • @esafzay
    @esafzay ปีที่แล้ว +10

    If this is acceptable to Amazon now I wonder why they failed me :)

    • @harshitkhandelwal8515
      @harshitkhandelwal8515 11 หลายเดือนก่อน

      In India, It is easy to get into Amazon. Interviewers are like here, you can yap anything and get away with it because even Interviewer lacks knowledge. Dont know the scenario about your place tho.

    • @vroomerlifts
      @vroomerlifts 5 หลายเดือนก่อน

      @@harshitkhandelwal8515 That is not true.

  • @topg3067
    @topg3067 ปีที่แล้ว +8

    Dont waste your time. This man has no idea what he is saying or doing. Move on to some other video.

  • @cranos666
    @cranos666 2 ปีที่แล้ว +17

    Doing this on an actual system design interview will get you rejected.
    How does the client know to connect to which api server ?
    Storing the messages is essential when answering this question
    How does the session microservice know to send message to user B through gateway 2
    etc etc

  • @adityasrivastava5795
    @adityasrivastava5795 2 ปีที่แล้ว +10

    I think you need to store data at server end. How will it work otherwise if the second user or receiver is offline?

    • @arvindnarayan8410
      @arvindnarayan8410 2 ปีที่แล้ว

      WhatsApp doesn’t store messages by design

    • @blasttrash
      @blasttrash 2 ปีที่แล้ว +2

      ​@@arvindnarayan8410 So until my message is sent, is that message stored on my phone and when my friend comes online, only then message is sent? What happens if my android app storage grows large? Does whatsapp clear old messages on the phone which I have already received?

    • @GiorGoS07031992
      @GiorGoS07031992 ปีที่แล้ว +1

      I believe Whatsapp stores temporary the messages on their servers and deletes them after the message is delivered

    • @tarekradi3596
      @tarekradi3596 2 หลายเดือนก่อน

      @@arvindnarayan8410 Wrong. If you load up WhatsApp in your browser, it will load all conversations. how? It stored the messages!!!!!!! Why is that such a hard concept for many here to grasp?

    • @tarekradi3596
      @tarekradi3596 2 หลายเดือนก่อน

      @@GiorGoS07031992 No. It stores it for longer (there is a TTL - Time To Live) and then it may be archived. This video is pretty bad. No Caching. No CDNs. No scaling. No sharding. No schema design. PRETTY BAD!!!!

  • @mickeyp1291
    @mickeyp1291 2 ปีที่แล้ว +5

    wheres the kafka? what kinda monolithic scalable monstrosity was that thing? its not scalable to the next version of whatsapp. its not even scalable to millions of users connected at realtime. sorry, thats my opinion

  • @piyushjaiswal8993
    @piyushjaiswal8993 ปีที่แล้ว +2

    Please someone tell me why we can't use Relational DB here, the schema looks pretty clear for whatsapp and don't see much changes to go for NoSql DB

  • @vetiarvind
    @vetiarvind 2 ปีที่แล้ว +6

    Personally i'd give him a 2/5 or a 3/5 at max. I think he listed all the requirements, but he didn't mention the DB records - how to store media, i don't really like him using NoSql here tbh, structured data makes a lot more sense. In a way i guess it makes sense to store chat messages in a group for example in nosql but in this case since we're doing per message read acks, it makes more sense to be able to join users with messages..
    also i think he should describe a write fan-out service - so if i write to a group, it should be published to the members of the group.
    So i'd have maybe a session service like he says to connect websocket handlers with users, then i'd use different microservices to manage publishing of messages internally and to notify those "chats" with the handlers. I'd also need a separate service to handle media and CDN's to deliver the media.

    • @gowris442
      @gowris442 ปีที่แล้ว

      100% true u mentioned all are correct fanout in kafka for sending message in whoever in groups I.e consumer group and media files he can use cdn with amazon s3.

  • @ajitpatil91
    @ajitpatil91 หลายเดือนก่อน

    A video who answered from listening to others content, many technical points missed, why do we need to call Gateway 1, 2, in real word there is one API gateway, rest are Services, how websocket works, can we achieve with long polling no tradeoff discussed?

  • @tacowilco7515
    @tacowilco7515 2 ปีที่แล้ว +2

    He had to explain each step. Like why API gateway, why micro service architecture, why specifically noSQL (why can't we use SQL) and etc. This is very oversimplified example which will not work in real world 100%.

  • @kizhanz
    @kizhanz 2 ปีที่แล้ว +7

    What happens if the recipient is offline?

    • @saathvikam
      @saathvikam ปีที่แล้ว

      message will be sent and will be received once recipient is online, message till then will be in Queue

    • @pauljason4072
      @pauljason4072 10 วันที่ผ่านมา

      We need to have a microservice called notification service which would take care of messages when user is offline and would send the notification to receiver.

  • @vikrantchaudhary7245
    @vikrantchaudhary7245 2 ปีที่แล้ว +3

    which text editor he is using 🤔

  • @reydavid7300
    @reydavid7300 2 ปีที่แล้ว +10

    What happens if one of the devices goes offline? Particularly, what if the receiver device is offline?

    • @farhazulislam6101
      @farhazulislam6101 2 ปีที่แล้ว

      Oh Really? Try putting your mobile offline for a day or two, you will your ans.

  • @JardaniJovonovich192
    @JardaniJovonovich192 2 ปีที่แล้ว +7

    What do we mean by"connecting to API Gateway" ?
    Does it have an IP address ? I don't think so, right?

    • @prash11leo
      @prash11leo 2 ปีที่แล้ว

      Yes, IP and port It’s over TCP

    • @JardaniJovonovich192
      @JardaniJovonovich192 2 ปีที่แล้ว

      @@prash11leo How come ?
      Isn't load balancer the one supposed to have an IP ?

    • @prash11leo
      @prash11leo 2 ปีที่แล้ว

      @@JardaniJovonovich192 I believe the client will be connected to the gateway directly and not to a load balancer. If it is connected to load balancer, we need another mapping on the user to load balancer IP-port. I believe load balancing happens with consistent hashing, and client would directly connect to a gateway based on some ID. What do you think?

    • @JardaniJovonovich192
      @JardaniJovonovich192 2 ปีที่แล้ว

      @@prash11leo Can you just give some examples of API Gateways which have an IP address ?
      Atleast as far as I remember I did not see an IP address for AWS API Gateway, correct me if I am wrong

  • @channuangadi7504
    @channuangadi7504 ปีที่แล้ว

    we are using the same methodology for "message delivered" and "message read" how can we distinguish between them

  • @ozurumbaobinna623
    @ozurumbaobinna623 2 ปีที่แล้ว +1

    Please what software did he use for the design he was doing?

  • @deathbombs
    @deathbombs 2 ปีที่แล้ว +1

    12:15 how is this P2P communication? The clients go to api gateway then the session managing service before reaching other clients

  • @keyurdgp
    @keyurdgp 2 ปีที่แล้ว +2

    What drawing tool are you guys using it? It seems it is very simple to use.

    • @tryexponent
      @tryexponent  2 ปีที่แล้ว +3

      Yes, it is. It's Whimsical.

  • @ritikjain697
    @ritikjain697 2 ปีที่แล้ว +1

    which application they guys are using for design ?

  • @rockeyram857
    @rockeyram857 4 หลายเดือนก่อน

    what is the software he is using for drawing the components?

    • @tryexponent
      @tryexponent  4 หลายเดือนก่อน

      Hey rockeyram857, the whiteboard tool is called "Whimsical"!

    • @rockeyram857
      @rockeyram857 4 หลายเดือนก่อน

      @@tryexponent thanks

  • @hazemabdelalim5432
    @hazemabdelalim5432 ปีที่แล้ว +1

    websocket are not P2P , i think you meant webrtc ?

  • @hanyhabib3859
    @hanyhabib3859 หลายเดือนก่อน +1

    what's this design! even based on what presented, regarding the question how the user/UserID connected to which API GW, how come you didnt even mention the two letters called "LB". you cant leave ur API GW or chat servers naked like that!

  • @fartzy
    @fartzy 2 ปีที่แล้ว +1

    Did he just say WebSocket is designed to be a Peer 2 Peer? How are you just gonna come out of the gate incorrect bruh

  • @probhakarsarkar2430
    @probhakarsarkar2430 2 ปีที่แล้ว

    Is api gateway bidirectional?

  • @DevinMonyThomas
    @DevinMonyThomas ปีที่แล้ว

    which tool is used for scribing?

    • @tryexponent
      @tryexponent  ปีที่แล้ว

      Hi Devin! The whiteboard tool being used here is “Whimsical”. They have a free and paid version so do check them out if you are interested!

  • @ovidiusbr
    @ovidiusbr 2 ปีที่แล้ว

    Good poker face 😁

  • @dakshsharma7518
    @dakshsharma7518 3 วันที่ผ่านมา

    web socket not peer to peer

  • @mickeygarg
    @mickeygarg 2 ปีที่แล้ว +2

    Whats the tool you use for this diagramming and designing. Can you help

    • @life_ofcoder
      @life_ofcoder 2 ปีที่แล้ว +1

      miro

    • @AmanGarg95
      @AmanGarg95 2 ปีที่แล้ว +2

      Nope, not miro. It is Whimsical.

    • @blasttrash
      @blasttrash 2 ปีที่แล้ว +3

      yeah its whimsical not miro

  • @ziggyzhang4156
    @ziggyzhang4156 2 ปีที่แล้ว +1

    lol these exponent mock interview videos are hilariously low quality, folks who think these are representative of good system design interviews are gonna be hugely mislead 😂

    • @tryexponent
      @tryexponent  2 ปีที่แล้ว

      System design interviews have changed a lot in the last 12 months, with interviewers now asking more direct questions about the system rather than high-level theory. We're currently filming updates to large amounts of system design content to reflect that.
      Are there other things you'd want to see in system design content?

  • @gunaborah4659
    @gunaborah4659 2 ปีที่แล้ว

    Bro spotify?

  • @jeankhechfe1594
    @jeankhechfe1594 2 ปีที่แล้ว +1

    This interview is a total failure, rejection is garanteed if it was real.

  • @tarekradi3596
    @tarekradi3596 2 หลายเดือนก่อน

    why not store the text? Of course you need to store the text! "Don't store the text for privacy"... WHAT?! Solve the privacy issue using security measures. Also, you didn't do any sort of calculations. API Gateway assignment should be based on location and then also there should be a load balancer. Overall, This is NOT a good video for preparing for system design interviews.

  • @jpc501
    @jpc501 2 ปีที่แล้ว +1

    Not good

  • @someguyO2W
    @someguyO2W 2 ปีที่แล้ว +1

    This is all wrong

  • @armenarz4062
    @armenarz4062 2 ปีที่แล้ว +2

    Dislike

  • @super-ulitka
    @super-ulitka 2 ปีที่แล้ว

    Don't waste your time, such "WhatsApp" won't fly 🐘

  • @rpiitkgpian
    @rpiitkgpian 2 ปีที่แล้ว

    Seriously ??????????????????????????

  • @farhazulislam6101
    @farhazulislam6101 2 ปีที่แล้ว

    Exponent, in your videos background music should be added. Like a dilogue in a movie scene becomes me engaging because of proper bg music. Listening to a man's harsh voice for almost an hr is quite a difficult job.

  • @fozailahmad5208
    @fozailahmad5208 ปีที่แล้ว

    What is the software they are using

    • @tryexponent
      @tryexponent  ปีที่แล้ว +1

      Hey Fozail! The whiteboard being used here is “Whimsical” (if that's your question)!

    • @tarekradi3596
      @tarekradi3596 2 หลายเดือนก่อน

      does it matter at this point? Pretty bad video