KatInterview

Design a Personalized Article Feed Backed by Publisher APIs

System DesignModel answer
MediumModel answerSystem Designsystem-designfeedpolling

Last updated

Design a system that continuously pulls article metadata from third-party publisher APIs and serves each user a ranked, paginated feed based on the publishers and categories they follow.

The Problem

You are designing a content aggregation platform. The service fetches article metadata — title, summary, category, and source URL — from dozens of third-party publisher APIs and assembles a personalized feed for each user. The platform never hosts article text; clicking an article sends the reader to the publisher's site.

Users express relevance by explicitly following publishers and categories. The feed shows the most recent articles from those subscriptions, paginated for infinite scroll.

Constraints to Keep in Mind

  • Traffic numbers are yours to estimate. Derive ingestion volume and read QPS, then use each number to justify a specific decision or to explain why an optimization is not yet warranted.
  • Publisher APIs are outside your control. They may rate-limit you, go silent, respond slowly, or use different pagination styles (cursor-based, timestamp-filtered, or plain page numbers).
  • Storage holds only metadata, not article bodies.

Useful Clarifying Questions

  • How current must the feed be? Is a five-minute lag acceptable, or do users expect near-real-time delivery?
  • How far back can a user scroll — 24 hours of articles, 30 days, unlimited?
  • Can one article carry multiple categories, and how does that affect deduplication in a feed?
  • What happens to a user's feed while a publisher they follow is down?

Part 1 — Fetching and Storing Articles

Design the ingestion layer that keeps article metadata fresh.

Cover:

  • A scheduler and worker architecture, with per-publisher state so each publisher's progress is tracked independently.
  • How frequently each publisher is polled, and how a single polling run decides it has seen everything new and can stop.
  • Idempotent writes so that fetching the same article twice does not create a duplicate record.
  • Behavior under rate limiting, timeouts, and extended outages — including how you detect a publisher that has gone silent without returning errors.

Part 2 — Assembling and Serving the Feed

Design the read path that produces a user's paginated feed.

Cover:

  • The data model for articles, categories, and user subscriptions.
  • How newly ingested articles reach a user's feed — push (fan-out on write) versus pull (merge on read) — and your reasoning for whichever you choose.
  • Deduplication when an article appears in multiple followed categories or publishers.
  • Stable pagination: a user who closes and reopens the app sees a consistent feed, not a shifted one.
  • How you bound storage for lists that could otherwise grow without limit, backed by the capacity estimate you computed.

Hints

Hint 1

Start with a back-of-envelope estimate before touching the design. Assume ~500 publishers each publishing ~50 articles per day. That is ~25,000 articles/day globally, which is modest — let that number guide how aggressively you need to optimize.

Hint 2

For ingestion, think about what state each polling worker needs to persist. A last-fetched cursor or high-water timestamp stored per publisher lets you resume after a crash without re-scanning everything. That same state is what makes writes idempotent.

Hint 3

For the feed read path, decide early whether to fan out articles to follower feeds on write or to merge lists on read. Fan-out is fast to read but expensive to write at scale; merge-on-read is cheap to write but requires a heap-merge at read time. The right answer depends on subscriber count and read/write ratio — reason through it explicitly rather than picking one by default.