This question evaluates a candidate's ability to design a trading gateway that reconciles synchronous client APIs with asynchronous downstream exchange behavior, emphasizing distributed systems concepts such as state machines, correctness under failure, idempotency, and scalable traffic handling.

You are designing a trading gateway that brokers client orders to multiple third-party crypto exchanges. The external exchanges expose synchronous HTTP endpoints for order submission/cancel (request–response), but trade execution and order updates are delivered asynchronously (e.g., via WebSocket streams or polling). The system must present a clean client-facing API, ensure correctness under failures, and scale through volatile, spiky market conditions.
Design the system and cover:
Login required