📝 Problem Description
Design a price alert system that notifies users when product prices drop to their target. Users set alerts for products, and the system monitors prices and sends notifications when thresholds are met.
👤 Use Cases
1.
User wants to sets price alert so that alert stored for monitoring
2.
System wants to detects price drop so that sends notification to user
3.
User wants to clicks notification so that redirected to product page
✅ Functional Requirements
- •Create price alert for product with target price
- •Monitor product prices periodically
- •Notify via email/push when price drops
- •Track price history for products
- •Allow multiple alerts per user
⚡ Non-Functional Requirements
- •Price check frequency: every 15 minutes
- •Notification delivery < 5 minutes of price drop
- •Support 10M active alerts
- •99.9% alert delivery rate
⚠️ Constraints & Assumptions
- •Prices must be scraped from external sites
- •Sites may block frequent scraping
- •Alert volume can spike during sales
📊 Capacity Estimation
👥 Users
1M users, 10M active alerts
💾 Storage
10GB (alerts, price history)
⚡ QPS
Price checks: 10K/min, Notifications: 1K/min during sale
📐 Assumptions
- • 1M users with 10 alerts each
- • Price check every 15 minutes
- • 1M products tracked
- • 5% of alerts trigger per day
💡 Key Concepts
CRITICAL
Price Scraping
Fetch prices via API or web scraping with rate limiting.
CRITICAL
Threshold Matching
Efficiently match price updates against millions of alerts.
HIGH
Batch Processing
Process alerts in batches for efficiency.
💡 Interview Tips
- 💡Start with the scraping architecture
- 💡Discuss the alert matching algorithm
- 💡Emphasize the notification delivery
- 💡Be prepared to discuss anti-scraping measures
- 💡Know the tradeoffs between freshness and cost
- 💡Understand the user experience requirements