Skip to content
SD-2 · System design

Design a Chat App

Asked at Senior level45 minutes
Our answers stay hidden until you reveal them.

Design a chat app like WhatsApp or Messenger. People send text, photos and videos in one-to-one chats and in groups, see them arrive on their phones in real time, and see the same chats on every device they own.

The app has 50 million daily users and 10 million phones connected at peak. Messages must arrive in the same order for everyone in a chat, nothing the server accepted may be lost, a message to a phone that is offline must arrive once it comes back, and the server must not be able to read what people write.

Good questions to ask first

Decide what you would assume for each before you look at ours.

  1. 1One-to-one only, or groups too?
  2. 2Which receipts?
  3. 3Is history kept on the server?
  4. 4Online status and typing?
  5. 5Photos and video?
  6. 6Several devices per user?
  7. 7End-to-end encrypted?
  8. 8One country or global?

How to spend the 45 minutes

  1. 5minPart 1: Requirements and scope
  2. 5minPart 2: Estimates
  3. 5minPart 3: API
  4. 12minPart 4: Architecture, stage by stage
  5. 13minPart 5: Deep dives and trade-offs
  6. 5minPart 6: Failures and follow-ups
Sketch your own design: boxes, arrows and the numbers that matter. Then compare it with ours.Break it in the labVisual walkthrough