I went straight to the data storage layer and spent way too long debating SQL vs NoSQL before even nailing down the core requirements.
Start by clarifying requirements: scale (number of products, price updates per day), latency needs, and whether tracking is for display or analytics. Then design a high-level architecture covering data ingestion, storage, and querying, and dive into data modeling and API design for price history and current price.
Pro tip: Emphasize the trade-offs between consistency and availability for price updates, and discuss how to handle out-of-order events and late data in a distributed system.
Ask about scale (e.g., millions of products, updates per second), latency requirements (real-time vs batch), and retention period for price history.
Outline components: data ingestion (crawlers, seller APIs), message queue (Kafka), processing (stream/batch), storage (time-series DB, cache), and serving layer (APIs).
Design schemas for current price (key-value store) and historical prices (time-series or wide-column store), considering partitioning and indexing for efficient queries.
Define endpoints for getting current price, price history, and price changes, with pagination and filtering. Discuss caching strategies for hot products.
Address partitioning, replication, handling failures, and ensuring data consistency. Discuss monitoring and alerting for price anomalies.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.