Problem Description
Design a system that notifies users when market prices change for the symbols they track.
Context and Requirements
- Users maintain a watchlist of symbols (e.g., AAPL, TSLA).
- A 3rd-party market data vendor API is available, supporting both REST polling and WebSocket streaming.
- The system must push near-real-time price change notifications to users via channels such as mobile push, email, or in-app/WebSocket.
Design Goals
The design should address the following:
- Efficient Market Price Ingestion: Prioritize streaming when possible.
- Targeted Fan-out: Deliver updates only to users actively watching a specific symbol.
- Scalability and Reliability: Handle a large number of users and symbols, ensuring system reliability, managing backpressure, and respecting rate limits.
- Dynamic Subscription Management: Efficiently handle user additions or removals of symbols from their watchlists without excessive calls to the vendor API.
- Data Integrity: Address deduplication, ordering expectations, and define a retry strategy for notifications.
Deliverables
Provide a high-level architecture, identify key components, define the data model, and illustrate the main flows for:
- Ingesting price updates.
- Notifying users.
AI interview prep
Core dilemma
Balancing the real-time ingestion of high-volume, low-latency market data from an external vendor with the efficient, scalable, and reliable fan-out of personalized notifications to a massive, dynamic user base, all while managing external API constraints and ensuring data integrity.
3 tradeoffs and 3 stress tests locked
Interview prep
Unlock the interviewer X-Ray rubric, tradeoff matrix, stress tests, clarifying questions, and key concepts.
Problem Description
Design a system that notifies users when market prices change for the symbols they track.
Context and Requirements
- Users maintain a watchlist of symbols (e.g., AAPL, TSLA).
- A 3rd-party market data vendor API is available, supporting both REST polling and WebSocket streaming.
- The system must push near-real-time price change notifications to users via channels such as mobile push, email, or in-app/WebSocket.
Design Goals
The design should address the following:
- Efficient Market Price Ingestion: Prioritize streaming when possible.
- Targeted Fan-out: Deliver updates only to users actively watching a specific symbol.
- Scalability and Reliability: Handle a large number of users and symbols, ensuring system reliability, managing backpressure, and respecting rate limits.
- Dynamic Subscription Management: Efficiently handle user additions or removals of symbols from their watchlists without excessive calls to the vendor API.
- Data Integrity: Address deduplication, ordering expectations, and define a retry strategy for notifications.
Deliverables
Provide a high-level architecture, identify key components, define the data model, and illustrate the main flows for:
- Ingesting price updates.
- Notifying users.