Design a Chat App
How the interviewer asks it
“Design one-to-one and group chat with delivery receipts, offline users and message history.”
Want the full answer? Watch lesson 8 of the free system design course: a 22-minute video walkthrough of this question.
Typed drills are free and unlimited: the AI scores your answer against the outline below.
What the interviewer is looking for
- Persistent connections (WebSocket) with a connection service that knows which server holds each user.
- A clear message flow: send, persist, acknowledge, deliver, receipt.
- Ordering per conversation, with sequence numbers rather than wall clocks.
- Offline delivery through push notifications and a sync-on-reconnect cursor.
- Storage chosen for the access pattern: messages by conversation and time.
How to structure your answer
- 01
Requirements
1:1 and groups up to a few hundred, sent/delivered/read receipts, history across devices, online presence. Low latency matters more than strict global order.
- 02
Connections
Clients hold a WebSocket to a gateway. A presence store maps user to gateway.
- 03
Send path
Gateway → chat service assigns a per-conversation sequence number → write to the message store → ack to sender → route to recipients' gateways.
- 04
Offline and multi-device
If a recipient is offline, send a push. Each device keeps the last sequence it saw and syncs the gap when it reconnects.
- 05
Groups
Fan out on write to members' gateways for small groups; for very large groups, fan out on read.
- 06
Storage
A wide-column store partitioned by conversation id and sorted by sequence; media in object storage behind a CDN.
Best answers from candidates
No candidate answers yet. Type yours, and if it scores 6 or more you can show it here without your name.
Answers are shared by candidates, without names, after a privacy check. Add yours
Common mistakes
- Polling the server every second instead of keeping a connection open.
- Ordering messages by client timestamps.
- Forgetting idempotency, so a retried send shows the message twice.
- Leaving out what happens when a gateway server dies.
Follow-up questions to expect
- Add end-to-end encryption. What can the server still do?
- A group has 100,000 members.
Now answer it out loud
Max will ask you this exact question, listen to your answer, push on the weak spots with follow-ups like the ones above, and score you when you finish.
Practice with MaxFree: a 5-minute voice round and unlimited typed drills, with scored feedback. No card, and your camera is never recorded.
More system design interview questions
Preparing for this round? Read how to practice for a system design interview.