Design a real-time stock price ticker
PremiumReal-timeEasy
- Market data feed
- Conflation
- Pub sub
Quick answer
This real-time interview question asks you to design a real-time stock price ticker. Aim for a design that delivers updates to many users with low delay, then explain connections, fan-out, ordering and trade-offs. Interviewers want to see how you keep latency low, handle reconnects and stay correct under load.
The problem
Design a real-time stock price ticker for a retail trading app like Robinhood or Zerodha Kite. Users watch up to 100 symbols and expect prices to move within a second of the market; the hard part is that the feed (200,000 updates per second at the open) is far faster than any screen or phone can take.
The app receives a consolidated market data feed with every trade and quote for 10,000 symbols. A user watches a list of symbols (a watchlist, a portfolio page or one stock's detail page), so the ticker must deliver the latest price per symbol at a rate the client can use.
What must a real-time stock price ticker do?
- Subscribe: A client subscribes to a set of symbols (1 to 100) and can change the set as the user navigates.
- Updates: For each subscribed symbol, the client receives the latest price, change, and volume, at most 4 times per second per symbol.
How well must it do it?
- Freshness: A price shown to a live user is at most 1 second behind the feed in normal conditions.
- Bounded client rate: No client receives more than 400 messages per second, whatever the market does.
What scale should you design for?
Use these numbers in your estimates.
The scale numbers unlock with this questionUnlock
Key concepts
- Market data feed
- Conflation
- Pub sub
- WebSocket
- Subscription management
- Latest value cache
How you’ll practise
- Requirements
- Estimate
- Connections
- Message flow
- Delivery guarantees
- Wrap-up
Lala, personalized to you, gives a hint when you ask and reviews your design when you are ready.
What do interviewers look for?
In any real-time design round.
- Clarifies latency, ordering and delivery guarantees
- Chooses a connection model with reasons
- Explains fan-out to many receivers
- Handles reconnects, missed messages and duplicates
- Plans for hot spots and sudden traffic spikes
- States trade-offs between consistency and speed
Questions people ask about this interview question
- Which design type is this question?
- It is a real-time question. You design a real-time stock price ticker and explain your choices the way you would in an interview.
- Is this question asked at entry level?
- It is marked Easy, so it suits engineers who are new to real-time interviews. It is also a good warm-up before harder questions.
- What should I cover first?
- Start with who sends and receives updates, how fast they must arrive and what order matters. Agree on scope with the interviewer before you design anything.
- Can I practise it for free?
- It is a premium question. Sign up and unlock it once for 10 credits; it then stays unlocked. When you finish, Lala, your personalized AI mentor, can review your design for 30 credits.
Related questions
Updated · Written by the SevyDevy team