Bloomberg System Design Interview: Real-Time Stock Price Alerts

Based on questions reported for Bloomberg interviews

The interviewer opens

Hi, and thanks for joining. Welcome to your interview for the software engineer role at Bloomberg. We'll design a system together, and you can sketch on the whiteboard on the right of your screen as you talk. If you need to step out or take a break, the Pause button at the top right will pause the interview at any time.

The problem is a real-time stock price alerting system, which fits naturally with the Terminal's users. It's up in the Problem tab now, so please read through the requirements and ask me anything you'd like clarified before you start drawing.

The problem

Design a system that lets users set rules on stock prices, such as a stock going above a level or moving X% within Y minutes, checks every incoming price tick against those rules, and notifies the user when a rule is hit.

Must do

  • Users create, view and delete price rules on a stock
  • Threshold rules: price crosses above or below a set level
  • Percentage-move rules: price moves X% within the last Y minutes
  • Check every price tick against all rules on that stock
  • Notify the user when one of their rules is hit

Must hold

  • Alerts must reach users quickly after the triggering tick, even during busy trading
  • Percentage-move rules must not require keeping the whole tick stream