System Design Masterclass
E-Commercealertsprice-trackingnotificationstriggersreal-timeintermediate

Design Price Alert System

Design a system to handle millions of price alerts for e-commerce and stocks

10M+ active alerts, 100K+ price updates/sec|Similar to Amazon, CamelCamelCamel, Robinhood, Yahoo Finance, Honey|45 min read

Summary

Design a price alert system that notifies users when product prices or stock prices hit their target thresholds. The core challenges are efficiently matching millions of alerts against continuous price updates, handling bursty notification delivery, and ensuring users receive timely alerts without overwhelming the system.

Key Takeaways

Core Problem

This is fundamentally an inverted index matching problem - instead of querying alerts for each price, we index alerts by price ranges for O(log n) matching.

The Hard Part

Efficiently finding which alerts to trigger when a price changes. Naive approach (check all alerts) is O(n) per update - unacceptable at scale.

Scaling Axis

Partition by product/stock ID. Each partition handles alerts for a subset of items independently.

The Question: Design a price alert system that handles millions of user-defined alerts and notifies users when prices hit their targets.

Use Cases: - E-commerce: "Alert me when iPhone drops below $800" - Stock trading: "Alert me when AAPL goes above $200" - Travel: "Alert me when flight to NYC drops below $300" - Crypto: "Alert me when BTC drops 10% in 24 hours"

This is a common interview question because it combines: - Stream processing (continuous price updates) - Efficient data structures (alert matching) - Notification systems (delivery at scale) - Database design (alert storage and indexing)

What to say first

Before I design, let me clarify the requirements. I want to understand the scale of alerts, frequency of price updates, and latency expectations for notifications.

Hidden requirements interviewers test: - Can you design efficient matching algorithms? - Do you understand notification delivery challenges? - Can you handle the asymmetry (many alerts, frequent updates)? - Do you consider edge cases (price gaps, duplicate alerts)?

Premium Content

Sign in to access this content or upgrade for full access.