ScaleCrafts

Design a real-time chat app

HardWebSocketsOrderingPresence

Build one-to-one and group messaging with delivery receipts and online status, like WhatsApp.

Functional requirements

  • Send and receive messages in real time
  • Group chats up to 500 members
  • Sent, delivered and read receipts
  • Show whether contacts are online

Non-functional requirements

  • Messages arrive in under 300 ms
  • Messages are never lost
  • Order is preserved within a chat

Scale

  • 500M daily active users
  • 50B messages per day
  • Up to 10M concurrent connections per region

How you’ll be scored

9 checks covering your diagram and your notes, and any valid approach counts. Hints appear for anything you miss. Common mistakes, such as single points of failure or components you never explain, cost points. How grading works

What interviewers look for

  • Clarify before you draw. State what is in and out of scope. For “Design a real-time chat app”, that starts with: Send and receive messages in real time; Group chats up to 500 members; Sent, delivered and read receipts. Interviewers notice candidates who pin the requirements down first.
  • Turn the scale into numbers. The scale (500M daily active users; 50B messages per day; Up to 10M concurrent connections per region) should become requests per second, storage and bandwidth, and those figures should drive your choices. Estimates with units carry more weight than adjectives.
  • Show how each quality is met. Your design should visibly deliver: Messages arrive in under 300 ms; Messages are never lost; Order is preserved within a chat. Saying that it does isn’t enough; point to the part of the design that makes it true.
  • Expect follow-ups on the hard parts. Interviewers usually probe websockets, ordering and presence here. This is a hard problem, so interviewers expect depth: what breaks first at this scale, how each failure is contained, and which trade-offs you accepted on purpose.
  • Explain failure and trade-offs. Say what happens when a component fails, where a single point of failure would hurt, and what you chose not to build. Naming a trade-off is a stronger answer than claiming there isn’t one.

Related problems

Loading your workspace…