KatInterview

Build a Self-Destructing Inbox Platform for Throwaway Addresses

System DesignModel answer
HardModel answerSystem Designsystem-designsmtpttl

Last updated

Design a service that hands out short-lived, unguessable receive-only email addresses, ingests mail at scale, and exposes it through a web UI and API before wiping it.

Problem

Design a throwaway inbox platform. A user requests a random email address that works for a short time (default around 10 minutes), receives messages sent to it, reads them in a browser or via an API, and then everything disappears automatically.

The service is receive-only: it never sends mail. Users typically sign up for something elsewhere and need a verification code quickly.

What to cover

  1. Requirements and scale assumptions. State functional and non-functional goals, and estimate traffic, message volume, and live data size for millions of inboxes per day.
  2. API design. Create, extend, list, read, delete, and a real-time push channel. Explain how reads are authorized.
  3. Address generation and lifetime rules. How addresses are produced, whether they can be reused, how extensions work, and what the mail server does after expiry.
  4. Inbound mail path. DNS/MX setup, the inbound SMTP tier, early recipient validation, and how mail moves into durable storage without being lost.
  5. Data model. Inbox registry, message storage, per-message expiry, and indexing for the access patterns you identify.
  6. Abuse and spam controls. Both on the SMTP side and on the inbox-creation API side.
  7. Privacy and security. Isolation between inboxes, safe rendering of HTML and links, and attachment handling.
  8. Deletion and compliance. Background cleanup and guarantees that expired data is truly gone.
  9. Observability, availability vs. consistency trade-offs, and cost controls.

Provide a high-level architecture diagram (in text) and justify your main choices.

Hints

Hint 1

Do the capacity math first: live data is arrival rate x lifetime x average size. You will find storage is small, so the real costs lie elsewhere (bandwidth, spam, domain reputation).

Hint 2

Reject unknown or expired recipients at the RCPT stage, before the message body is transferred, and acknowledge accepted mail only after it is durably written to a log or queue.

Hint 3

Separate the public address from the secret used to read it, never recycle addresses, and make reads check the inbox's current expiry rather than relying only on storage-level TTL.