The Desi Architect
Notes / Design Interview Problems / Design Zerodha / Groww (Stock Trading Order Matching)
Track 5 · Design Interview Problems

Design Zerodha / Groww (Stock Trading Order Matching)

NSE at 09:15 AM open. How an in-memory price-time priority matching engine processes 100,000 orders per second with microsecond latency and zero database transactions in the critical path.

Interview problem25 min read1 interactive
On this page
  1. Problem framing
  2. Questions I ask before drawing anything
  3. Requirements
  4. Estimation
  5. API design
  6. Data modeling and internal structs
  7. The Order Book data structure
  8. The Single-Threaded Core architecture
  9. Interactive matching simulator
  10. The Cancel vs Fill race
  11. Failure recovery: Deterministic log replay
  12. Edge cases and failure recovery
  13. Cross-questions interviewers will ask
  14. Interview Rubric: Mid-Level vs Senior / Staff