Design the messaging backend for a WhatsApp-style app: 1:1 chat, group chat, delivery and read receipts, offline delivery, and end-to-end encryption.
Functional:
- Text and media messages in 1:1 threads and groups of up to 1024 members.
- Per-recipient delivery and read receipts, aggregated per message for the sender.
- An offline recipient receives every message exactly once on reconnect, in a stable order.
- A user may link up to 4 devices, and every device receives every message.
- End-to-end encrypted: the server never holds plaintext or content keys, so it cannot inspect, dedupe by content, or re-encrypt a message.
Non-functional:
- p50 send to delivered under 150 ms in-region, p99 under 500 ms.
- No visible duplicates and no silent loss.
- Losing an entire connection gateway node must not drop or reorder messages.
- 300M DAU, about 2 linked devices each, 60M concurrent connections at peak.
- 40B messages sent per day: roughly 460k/s average, 1.4M/s peak.
- Average text envelope 1 KB (ciphertext plus routing metadata). 5% of messages carry media averaging 200 KB.
- Average fanout is 3.5 recipient devices per message, so about 1.6M delivery events/s and roughly twice that again in receipt events.
- Media retained 14 days; undelivered messages retained 30 days, then dropped.
Voice and video calling, status and stories, payments, spam classification, encrypted cloud backup, and client UI.
Loading editor...
Submit your design to grade it.
- The components and connections this prompt needs
- Structure: an entry point, data stores, async work, and failure handling
- The concepts you explain on the board or in Notes, in your own words
To pass, score 65 or more with every required component but one, and name at least half the concepts, or all of them if a component is missing.