Preparing your design workspace

Loading the problem and your latest saved attempt…

Design an Ephemeral Messaging Service

Design one-to-one messaging whose content disappears consistently after viewing or expiry, including retries and failure recovery.

Problem statement

For this exercise, assume authenticated users exchange small text messages in fixed one-to-one conversations across multiple devices. A send succeeds only after the message is durably accepted. Online delivery is at-least-once and clients deduplicate stable message and event identifiers.

The first authoritative open by any recipient device starts one server-owned ten-second visibility window for all of that recipient's devices; an unopened message expires 24 hours after acceptance.

After the window or unopened deadline, content must become unreadable across sender and recipient devices within two seconds and be purged from primary application stores within one hour. Non-content tombstones may remain for seven days to reject stale work and retries.

Assume 5 million daily active users, 500,000 concurrent connections, peaks of 50,000 sends per second, and healthy online delivery within 300 milliseconds at p95. The service should survive one zone failure, but it must fail closed when a conversation has no authoritative write quorum.

Address lost responses, duplicate or reordered events, reconnecting devices, delayed expiry work, cache failures, and authority failover. Exclude attachments, group chat, reactions, editing, search, moderation, legal holds, and backup-retention policy.

What to build

  1. A sender can idempotently create a one-to-one ephemeral message and receive a durable acceptance result.
  2. Recipient devices receive ordered message lifecycle events and can recover missed events from a durable cursor after reconnecting.
  3. The first authoritative recipient open starts one ten-second visibility window shared by all recipient devices and returns a stable outcome to retries.
  4. Viewed or unopened messages become logically unreadable at their server-owned deadline and are later purged without stale delivery or caches resurrecting content.

At scalePractice assumption

  • 5 million daily active users maintain up to 500,000 concurrent connections and exchange one-to-one text messages.
  • Traffic peaks at 50,000 accepted sends per second, and healthy online delivery completes within 300 milliseconds at p95.
  • The first recipient open creates one server-owned ten-second visibility window across devices, while unopened messages expire 24 hours after acceptance.
  • Expired content becomes unreadable from every application path within two seconds, is purged from primary stores within one hour, and leaves a non-content tombstone for seven days.
  • The write path survives one zone failure but rejects writes without one authoritative quorum for the conversation.