Design a Cross-Site Stock Trading Application
Deliver fresh market state and correct order outcomes across a bandwidth-constrained inter-site link.
Problem statement
For this exercise, assume one market-facing site owns exchange connectivity and authoritative order lifecycle state, while a remote site serves trader and client applications. The remote site needs fresh stock-market state and can place or cancel orders and observe acknowledgements, fills, cancellations, and rejects.
The uncompressed market stream exceeds the bandwidth reserved on the inter-site link, so the design must reduce transferred volume while keeping every received frame decodable and detecting stale or missing state.
Market views may be conflated within the stated freshness target, but each accepted order command has one durable identity and must not create a duplicate venue-side action after retries.
Matching-engine internals, strategy logic, funding, clearing, settlement, historical analytics, and whole-site disaster recovery are out of scope.
Explain hardware resource sizing and configuration at each site, bandwidth-versus-compute operating costs, and what users see or can do when prices or order outcomes are stale or uncertain. Vendor-specific hardware and current price quotations are not required.
What to build
- Deliver a fresh latest market state for the instruments used by remote trader and client applications.
- Accept idempotent place and cancel commands at the remote site and return authoritative order and execution outcomes.
- Keep the remote market view trustworthy and within its freshness target even when the reserved inter-site bandwidth is lower than the raw stream.
- Detect stale or missing cross-site data and recover to a trustworthy current view after a link interruption.
At scale
- Assume bursts of 200,000 normalized market updates per second across 10,000 instruments.
- Assume the uncompressed market stream can exceed 1 Gbps while only 250 Mbps is reserved on the inter-site link.
- Assume a 250 ms p99 freshness target for the remote latest-price view and up to 5,000 order or cancel commands per second.
- Assume the link can disconnect for 30 seconds; the UI must mark stale state promptly and recover to a current snapshot within 60 seconds of reconnection.