Groww: Auto square-off service for intraday positions on price thresholds
Problem. Design a risk service that automatically closes a user's intraday position once the price moves a set percentage away from the previous day's close. Example: a stock closed at 100 with an upper circuit of 120, and a rule closes the position when it reaches 118.
Functional requirements. Users or admins create risk rules. Live ticks are checked against the reference price in real time. When a threshold is crossed, a sell or cover order goes to the exchange automatically. The user gets a push or email notification once the position is closed.
Non-functional requirements. Millisecond latency from tick to order, more than 10M active positions, more than 1M ticks per second, always up during market hours, exactly-once square-off (no duplicate exit orders), and instant failover if a node dies.
How it went. Two interviewers. The candidate presented a diagram but got confused on several deep-dive points and was rejected. The machine-coding round before this one was a stock broker with order matching (FIFO at equal price, best price first, a ±20% price band, partial fills).
Comments 0
No comments yet. Ask the author something, or add what happened in your own round.