Price Tracking Service
Product Price Monitoring and Alerts
Design a service that checks product prices on shopping sites on a schedule, keeps their history, and tells users when a price drops to the target they set.
Overview
A price tracker watches product pages for people. A user pastes the link to a kettle, says 'tell me when it costs $30 or less', and forgets about it. The system fetches that page every few hours, reads the price, stores it when it changes, and sends one message when the price reaches the target.
The flow is simple: schedule, fetch, extract, compare, alert. The interview goes deep on three places. Scheduling: which of ten million products to check next, when each shop allows only so many requests. Extraction: reading a price reliably from pages that all look different. Alerting: sending each alert once, at the right moment, even when prices wobble around the target.
This is a small cousin of the Web Crawler problem (fetching politely at scale), the Job Scheduler problem (running work when it is due) and the Notification System problem (delivering messages reliably). Name those links in the interview; do not redesign all three.
Questions to ask first
Before drawing anything, pin down the scope. These are the questions to ask, each with the answer this design assumes.
- How many products and shops? 10 million tracked products across about 100 retailers.
- How fresh must prices be? Hourly for popular products, daily for the rest.
- How do we get prices? The retailer's product API or feed where one exists; otherwise we fetch the public page within the site's rules.
- What alerts? Price at or below a target to start with; percent drops later.
- How fast after a drop? Within 15 minutes of our check seeing it. That is a target we chose, not one the shops give us.
- Which channels? Email and mobile push. SMS is out of scope.
The design at a glance
A user tracks a product in the user app or browser extension, and the Tracking API stores the product and the user's alert in the database. The scheduler claims the products whose next_check_at has come due and puts them on a fetch queue per retailer, and fetchers work through those queues within each site's budget, calling the retailer's site or API. The extract-and-compare step reads the price, records any change in the database and hands it to the alert matcher, which writes rows into a notifications outbox that senders deliver by email and push. The Visual Explanation below draws this path, and the sections that follow walk it one step at a time, starting with the scheduler.
What you will be able to do
- Size the fetch load from product counts and check intervals, and see why each site's limit caps freshness.
- Schedule checks by priority with a due time per product, and claim work safely with several workers.
- Read prices from structured data first, validate them, and store them as integer cents with a currency.
- Fire an alert once when a price crosses its target, and never twice for the same drop.
Key concepts
- Crawl scheduling
- Per-site politeness
- robots.txt (RFC 9309)
- Structured data extraction
- Change detection
- Alert crossing and re-arm
- Notification outbox
- Price history
Functional requirements
- Add a product by URL (or from the browser extension) and start tracking it
- Set, change and delete a target price per product
- Show the price history as a chart
- Notify the user by email or push when the price reaches the target
- Handle several currencies; never compare prices in different currencies
- Mark products unavailable or out of stock instead of recording a price of zero
Non-functional requirements
- Popular products checked about hourly, everything else at least daily (targets we chose)
- An alert goes out within 15 minutes of the check that saw the drop
- Never send the same alert twice for one drop; never alert on a price we could not read
- Stay inside every site's rules: robots.txt, its terms, and a per-site request budget
- Alert sending stays available 99.9% of the time; fetching may lag first
Interview questions
- How do you decide which products to check next?
- How do you avoid being blocked, and what are the rules?
- How do you extract prices from so many different sites?
- How do you make sure a user gets one alert per price drop?
- What if the same product is tracked by a million users?
- How would you add a percent-drop or all-time-low alert?
- How do you store and serve the price history chart?
- What do you monitor?
Sign up free to read the full topic
More System Design topics
- Payment System
- Phi Accrual Failure Detection
- Platform Provisioning on Bare Metal: From Silicon to Kubernetes
- Polling vs WebSockets vs Webhooks
- Pre-Silicon Software: Virtual Platforms and SystemC TLM in CI
- Price Comparison Engine
- Primary-Replica vs Peer-to-Peer
- Proxies
- Proximity Service
- Quorum Consensus
- Raft Consensus
- RAG System (Retrieval-Augmented Generation)
Start free on Cariara · Coding problems · System design studio