All questions
Hard2026-08-27

Design a Stock Price Change Alert System

Company
Uber
Role

SDE-II (L4)

Round

Round 5 (System Design)

System DesignPush vs PullStreamingNotifications

Problem Statement

Design a system that lets users set alerts on stock prices (e.g., "notify me when AAPL crosses $200") and delivers notifications in near real-time when conditions are met.

The system must handle high-volume price updates and millions of user-defined alerts.

Requirements

Functional:

  • Users create alerts: (stock symbol, condition, threshold)
  • System ingests real-time price updates for thousands of stocks
  • When a price crosses a user's threshold, send a notification
  • Support multiple conditions (above, below, % change)

Non-Functional:

  • Near real-time alerting (sub-second)
  • Handle high-frequency price updates (thousands/sec per stock)
  • Millions of active alerts
  • Reliable delivery (no missed alerts)
  • Scalable

What the Interviewer Expects

  1. Push vs Pull mechanism — the core discussion:
    • Pull: clients poll for price → doesn't scale, high latency
    • Push: price updates flow to a matching engine that pushes notifications → preferred
  2. Alert storage & indexing — index alerts by stock symbol. When a price update arrives for AAPL, quickly find all alerts watching AAPL.
  3. Matching engine — for each price tick, check triggered alerts. Use sorted structures (by threshold) to efficiently find crossed thresholds.
  4. DB design: alerts table (indexed by symbol), users table, notification log
  5. Streaming architecture: price feed → Kafka → matching workers (partitioned by symbol) → notification service
  6. Deep dive on trade-offs — accuracy vs latency, at-least-once vs exactly-once delivery, handling duplicate alerts.
  7. High-volume data — Uber cares about this. Discuss Spark/Flink for stream processing, windowing, and aggregation.

Follow-ups

  1. How do you avoid sending duplicate notifications when a price oscillates around the threshold?
  2. How do you handle a user with 10,000 alerts on the same stock?
  3. How would you support "% change over last hour" conditions (needs windowed state)?
  4. How do you scale the matching engine when one stock (e.g., during a crash) gets millions of updates?
  5. Push vs Pull for delivering the final notification to the user's device — which and why?
🧠

No solution provided

Think through it. That's how you build real interview muscle.

Share: