Skip to the page

Mobile system design · Design

Design a chat app (WhatsApp-like)

The interviewer asks

Design a messaging app like WhatsApp: the client architecture, and enough backend to make it work.

Then

Follow-ups the interviewer asks next

  1. scale and failure probes, in order:
  2. "If User A and User B are on different servers, how does the message get from one to the other?"
  3. "The app is backgrounded on iOS and the socket dies. How does the user get messages?"
  4. "Ordering and dedupe across reconnects?"
  5. "A 1,000-member group: fan-out and read receipts?"
  6. "10k messages in a thread: list performance and pagination upward?"
  7. "Reconnect storm after an outage?"

The answer

What a strong answer covers

  • Requirements (1:1, groups, media, receipts, presence, offline send).
  • Client: WebSocket manager with heartbeat and backoff. Local DB (SQLite) as the source of truth. Optimistic send with client ids and a pending, sent, delivered, read state machine.
  • Server sequence ids for ordering and gap fill. Push (FCM/APNs) to wake offline devices. Media upload separately with progress.
  • Inverted list or FlashList v2 startRenderingFromBottom + maintainVisibleContentPosition.
  • Backend sketch: user→server routing via Redis, Kafka between servers. E2E encryption keys in Keychain/Keystore.

The red pen

Common traps

Avoid:drawing boxes before asking questions (the post calls this the biggest mistake). Polling.

Practise this out loud

Say your answer out loud to an AI interviewer that follows up, and get a score for it.

Practise by voice

Practise questions like this out loud

Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.

Start your free interview