Design an e-commerce price tracking service
Company: Meta
Role: Software Engineer
Category: System Design
Difficulty: hard
Interview Round: Onsite
Design a backend system similar to popular price-tracking sites that monitor product prices on large e-commerce platforms (for example, a site that tracks prices on a major online retailer and notifies users when prices drop).
### Functional requirements
- Users can search for a product (by URL or product ID) and start tracking its price.
- The system periodically fetches the latest prices for tracked products from the e-commerce site (via API or web scraping, depending on assumptions).
- For each product, the system stores a **price history** (timestamped prices) that users can view as a chart or table.
- Users can create **alerts** with conditions like: "notify me when the price goes below X" or "notify me when there is at least a Y% drop from the highest price."
- When an alert condition is met, the system sends notifications (email, push, etc.).
### Non-functional requirements
- Support tracking **tens of millions of products** and **millions of users**.
- Prices should be reasonably fresh (e.g., updated every 15–60 minutes for popular products, less frequently for long-tail items).
- The system should be **highly available**; temporary delay in price updates is acceptable, but losing data or sending duplicate alerts should be minimized.
- The system should be **cost-efficient**, given the large volume of historical price data.
### Key points to cover
- Clarify any assumptions you need (data source: API vs scraping, exact freshness targets, regions, etc.).
- Propose:
- Overall **high-level architecture and major components**.
- **Data model** for products, price history, user subscriptions, and alerts.
- Approach to **fetching and updating prices** at scale.
- How you will implement and scale **alert evaluation and notification**.
- Discuss trade-offs around **storage**, **crawling frequency**, **consistency**, **fault tolerance**, and **cost**.
- Be prepared to go into deeper design details on one or two critical parts (for example, the price ingestion pipeline or the alerting system).
Quick Answer: This question evaluates competency in large-scale backend system design, including distributed architecture, time-series data modeling for price history, ingestion pipelines for API or scraping, alerting and notification systems, and trade-off analysis around storage, consistency, availability, and cost.