Angel One-Style Machine Coding Round: Format, Tips & Practice Problems
Written and reviewed by Sahil Srivastav
A retail broking backend is a permissioning and accounting system with a market attached. Before an order reaches an exchange it must pass margin and risk checks; after it is filled it changes a position, a ledger, and a day’s realised profit. Machine coding rounds in the style of Angel One take their scenarios from that pre-trade and post-trade sandwich.
The defining property is that orders are long-lived objects with partial outcomes. An order can be placed, partially filled, modified, cancelled, or rejected, and every one of those affects available margin. This page covers the commonly reported format, the evaluation lens, and Gronex repositories that drill the same state-machine and accounting discipline.
What a Angel One-style machine coding round looks like
Expect 90–120 minutes to build an order management slice: place, modify, and cancel orders with validation; block margin on placement and release it on cancellation or rejection; apply fills that update a position and realised P&L. The statement gives a margin formula and a set of risk rules, and the rules are always written so that at least one order must be rejected for a reason other than price.
Partial fills are the discriminator. A 100-quantity order filled 40 then 30 must leave 30 open, must have adjusted the blocked margin twice, and must reject a modification that would reduce quantity below what is already filled. Candidates who model an order as placed-or-filled cannot express any of that. The correct shape — quantity, filled quantity, remaining, and a status derived from them — is small, and its absence is immediately visible.
Concurrency arrives through the margin balance: two orders checked against the same available margin at the same moment, both approved, both blocking. The expected answer is a single atomic check-and-block, and the follow-up usually adds the reverse case — a cancellation racing a fill on the same order, where exactly one must win and the other must be rejected against a terminal state.
How you’re evaluated
Order state machine with fills
Open, partially filled, filled, cancelled, rejected — derived from filled and remaining quantity, with modifications validated against both.
Margin accounting
Blocked on placement, adjusted on fill, released on cancel or reject — with available margin derived, never stored separately.
Pre-trade risk rules
Risk checks as an evaluated rule set that names the failing rule, applied before any state changes.
Atomicity under contention
Check-and-block as one operation, and cancel-versus-fill resolved so exactly one succeeds with the other rejected cleanly.
Common mistakes that fail this round
- Treating an order as a boolean fill state, making partial fills and modify-after-partial-fill impossible to handle.
- Checking available margin and then blocking it in two steps, which over-commits under simultaneous placements.
- Failing to release blocked margin on rejection, so a rejected order permanently consumes buying power.
- Computing average price and realised P&L with floats and then explaining a mismatched rupee to the interviewer.
- Allowing a cancel on an already-filled order because the terminal-state guard lives in only one code path.
Quick tips for the room
- Derive order status from filled and remaining quantity, never set it directly.
- Make check-margin-and-block a single atomic method with no gap.
- Guard every mutation with a terminal-state check in one place.
- Keep prices and P&L in integer paise with a fixed lot convention.
How to prepare
Build the order object with quantity, filled, and remaining, and derive status from them — then implement apply-fill, modify, and cancel against that shape, each with an explicit guard. Once those are right, add the margin block-and-release and make the check-and-block atomic. Rehearse the cancel-racing-a-fill explanation out loud; it is the standard follow-up.
The repositories below rehearse the mechanics: the auction problem is competing orders with strict acceptance rules and a closing transition, the bank-transfer problem (free) is atomic balance movement with lock ordering, the ledger problem is the accounting trail, the rate-limiter problem covers per-client order-rate controls, and the deadlock incident is the production version of two paths locking in opposite order.
Practice problems in the Angel One-style round format
Each is a real backend repository with a failing test suite — the same working-code standard the round applies. Open the brief and read the full problem, no signup required.
Bid Placement & Closing System
Competing orders under strict rules: acceptance validation, deterministic ordering, and a clean closing transition.
Open the challenge →Bank Transfer & Deadlock Prevention
Atomic balance movement with ordered locking — the margin-and-funds core of a broking backend. Free to try.
Open the challenge →Payment Ledger Consistency
The post-trade accounting trail: append-only entries that reconcile after partial failure.
Open the challenge →Rate Limiter & Quota Enforcement
Per-client order-rate controls that stay correct when many requests check the same window at once.
Open the challenge →Incident: Ledger Transfers Freeze
The production form of the deadlock follow-up: find the inverted lock order and fix it from a thread dump.
Open the challenge →FAQ
Are these real Angel One interview questions?
No. They are Gronex originals in the style of retail broking rounds — the kind of problem asked in rounds like Angel One’s. Gronex is not affiliated with Angel One.
Do I need to know exchange or margin regulations?
No. Margin formulas and risk rules are always supplied. What is graded is exact application, a named reason on every rejection, and margin that is released on every exit path.
How important are partial fills?
They are the single most reliable discriminator in this round style, because they force the correct order model and break every shortcut version of it. Build for them from the first data structure.
Is a matching engine expected?
Rarely — the broker sits in front of the exchange, so fills usually arrive as inputs. If matching does appear, it is a simplified price-time priority book, and determinism of the tie-break is what is actually being graded.
Related
Gronex is not affiliated with, endorsed by, or sponsored by Angel One. All company names and trademarks belong to their respective owners. The problems on this page are Gronex originals written in the style of such interview rounds — not actual interview questions from Angel One.