System Design Simulator
Chat App
Design 1:1 and group chat with online presence and fan-out.
Al Beltran Engineering Lab
Loading simulator…
How the challenge works
- Live delivery and durable history are different jobs. Split them.
- Presence is ephemeral. Do not treat it like an orders table.
Key concepts
Fan-out on write vs read
Huge groups should not clone a message into millions of inboxes on send.
Backpressure
A queue plus workers keep typing indicators and push from blocking the write API.
Common mistakes
- Using a CDN as the realtime plane.
- Storing last-seen timestamps in a heavily locked SQL table.
Recommended architecture
- Websocket or long-poll API, cache for presence, database for messages, queue/workers for push and search indexing.
Interview tips
- Ask about group size. 8-person rooms and 200k-person rooms are different products.
Related challenges
Built by Al Beltran