Preparing your design workspace

Loading the problem and your latest saved attempt…

Design a Real-Time Stock Alert System

Let users start and stop stock rules and notify them when trusted market prices cross configured bounds.

Problem statement

For this exercise, assume you are designing a real-time stock alert system. Let users start and stop stock rules and notify them when trusted market prices cross configured bounds.

Define a coherent first production version that satisfies the listed requirements and scale while making failures and degraded behavior visible.

What to build

  1. Create, update, pause, and stop per-user stock alert rules.
  2. Consume and validate market prices, then evaluate lower, upper, and percentage/window rules.
  3. Commit one alert per boundary crossing, use hysteresis before re-arming, and deliver through retryable notification channels.

At scale

  • For this exercise, assume 10 million active rules and 200,000 accepted price updates per second.
  • Evaluate relevant rules within five seconds p95.
  • Market updates may be duplicated or out of order; users must not receive duplicate crossing events.