KatInterview

Design a Content Aggregator and Disposable Inbox Service

System DesignModel answer
HardModel answerSystem Designapi-designcachingdistributed-systems

Last updated

Design two systems: a multi-publisher article feed with ranking and client-adaptive APIs, and a temporary email service that generates human-looking addresses with guaranteed uniqueness at scale.

Design a Content Aggregator and Disposable Inbox Service

You have 45–50 minutes. Split your time roughly in half. The interviewer cares more about your reasoning and trade-offs than an exhaustive diagram.


Part 1: Multi-Publisher Article Feed

Build a backend that continuously pulls articles from thousands of independent publishers, consolidates and ranks them, and exposes feeds to a variety of client types.

Your design should cover:

  • How articles flow from publishers into your system (polling, webhooks, push)
  • How you detect and collapse duplicate or near-duplicate stories (for example, the same wire report picked up by hundreds of outlets)
  • How you rank and precompute feeds at scale
  • API design: when would you choose REST over RPC for different parts of the system? Justify your choice.
  • Pagination: what strategy keeps the feed stable as new articles arrive? Why does a common alternative break?
  • Caching: identify the layers where caching helps most, and explain what gets cached at each layer
  • Client diversity: how does your API surface accommodate a low-bandwidth mobile client differently from a desktop web client?

Assume roughly 5 million new articles per day across 50,000 publishers, and 500 million feed loads per day across 50 million daily active users.


Part 2: Disposable Email Service

Design a platform that lets users instantly create a throwaway inbox, receive email at that address, and read messages through an API. Addresses expire but are never reused — even after expiry.

Two requirements make this non-trivial:

  1. Human-looking usernames. Generated addresses must resemble real email addresses (e.g., james.rivera92@…) rather than obvious random strings (e.g., xk7q2mnt@…), because many websites reject addresses that look machine-generated.

  2. Uniqueness at scale. The system creates tens of millions of new addresses per day. Explain how you would generate addresses efficiently without ever issuing a duplicate. If you consider a probabilistic data structure like a Bloom filter for the uniqueness check, discuss its trade-offs honestly.

Your design should also cover: how inbound SMTP mail is received and stored, how a user reads their inbox securely, and how domain rotation factors into plausibility.

Hints

Hint 1

For the feed, think about who owns a story at write time vs. read time. Because articles come from publishers rather than people a user follows, fan-out-on-write (the Twitter model) is a poor fit — precomputed per-topic candidate pools are more natural here.

Hint 2

Cursor-based pagination encodes a stable position in the ranked list, while offset-based pagination shifts when new items are inserted at the top. Ask yourself: if a breaking story jumps to position 1 while a user is on page 2, what happens to each approach?

Hint 3

For address uniqueness, there is a spectrum from 'try and retry on collision' to 'guaranteed unique by construction with zero lookups.' Think about a bijective mapping from a counter to a human-readable name — a permutation over the name space. A Feistel network or format-preserving encryption can do this.