HLDArena
HLD-401·Transactions & Locking
Expert · 2,000 pts

Low-Latency Equity Order Gateway & Risk Pre-Check

Design a brokerage order-entry and buying-power pre-check engine handling market-open volatility bursts with strict per-account margin locking and symbol sequencing.

Max p99
≤ 90 ms
Availability
≥ 99.5%
Budget
≤ $8,400

Functional Requirements

  • FR-1POST /orders/{symbol} — Atomically validates/reserves account buying power and sequences limit order.
  • FR-2GET /quotes/{symbol} — Serves top-of-book quote snapshot and open order status.
  • FR-3DELETE /orders/{symbol} — Releases canceled or expired leases/holds atomically and immediately refreshes cached availability.
  • FR-4Zero margin overdrafts or lost accepted orders when a primary database/state node crashes.

Workload Profile

Pre-Market Load60,000 Quote Read RPS / 12,000 Order Write RPS
Opening Bell Surge160,000 Read RPS / 40,000 Concurrent Order Write RPS
Active Working Set30 GB hot symbol books & active margin balances
Contention ProfileExtreme skew on volatile flagship ticker symbols

Consistency Model

Strict serializable buying-power reservation + sequenced partition log + RPO = 0 synchronous/quorum replication.

Design Write-up
0 boxes · 0 edges
0 words
Hidden Cases #4–#7 run automatically on Submit
Case 1: Smoke & API ContractInput Workload
Read RPS
2,000 rps
Write RPS
400 rps
Key Distribution
Uniform (Low Skew)
Chaos Fault
None (Healthy Cluster)
Expected Pass CriteriaASSERTIONS
• Tail Latency: p99 ≤ 180 ms
• Availability: ≥ 99.5%
Valid end-to-end Client → Compute → Storage topology