Design cryptocurrency trading with third-party exchanges
Company: Coinbase
Role: Software Engineer
Category: System Design
Difficulty: hard
Interview Round: Onsite
You are building a cryptocurrency trading platform that routes client orders to multiple third-party exchanges. Design the system end to end: APIs for order placement and status retrieval; an internal order state machine (e.g., NEW, PENDING_SUBMISSION, PARTIALLY_FILLED, FILLED, CANCELED, REJECTED) with clearly defined transitions and idempotency. The partner advertises a synchronous API, but fills and cancellations are effectively asynchronous—explain how you model this (e.g., events, callbacks, polling) while avoiding double execution. How do you handle third-party timeouts, partial failures, retries, and exactly-once semantics, including de-duplication and reconciliation? Propose strategies for spiky traffic (rate limits, queues, backpressure, autoscaling, circuit breakers) and discuss data consistency, durability, and observability across services.
Quick Answer: This question evaluates a candidate's competency in designing resilient, consistent multi-exchange trading systems, testing skills in API design, state-machine modeling, asynchronous integration with third-party exchanges, fault tolerance, idempotency, and observability within the System Design domain.