KatInterview

Build a Wish-List Price Alert System at Scale

System DesignModel answer
MediumModel answerSystem Designsystem-designscalabilitydata-modeling

Last updated

Design a service where users set a target price on any product and receive a notification the moment the price drops to or below that target.

Build a Wish-List Price Alert System at Scale

You are designing a backend service that monitors product prices across online retailers and notifies users when a product hits their desired price.

What the service does

  • A user registers any product by pasting its URL and setting a target price. When the live price drops to or at that target, the user gets an alert (email or push).
  • The system periodically fetches the current price of every tracked product from the retailer, either through an official product API or by scraping the page. Scraping anti-bot specifics are out of scope; assume you have a library that handles it.
  • Full price history is stored and exposed as a chart (30-day, 1-year, all-time views).
  • Users can view, update, and remove their active alerts.

Scale targets

  • Tens of millions of users, with an average of 10 tracked products each.
  • Millions of unique products in total (many users track the same popular item).
  • Popular products should have their price refreshed roughly every hour; obscure ones can wait up to 24 hours.
  • Alerts should fire within a few minutes of a price drop being detected, and the same drop must never trigger duplicate notifications.

What a strong answer covers

Walk through your clarifying questions and assumptions, a back-of-envelope estimate, the API surface, data model, and high-level component diagram. Then pick two or three areas to go deep: the fetch scheduling strategy, the alert-matching logic at scale, the price history storage design, or data quality and anomaly detection. For each deep dive, discuss trade-offs and failure modes, not just the happy path.

Hints

Hint 1

Before drawing any boxes, figure out how many fetches per second the system must sustain and what your budget-per-source rate limit implies. That number drives most architectural decisions downstream.

Hint 2

Subscriptions vastly outnumber unique products. Ask yourself: which dimension should you shard on — user or product — and why does the answer differ between the write path and the read path?

Hint 3

A price alert that fires twice is almost as bad as one that never fires. Think through exactly-once semantics end-to-end: what is your deduplication key, where do you store state, and what happens when a Kafka consumer crashes mid-flight?