← Coinbase Interview Insights

Coinbase·Software Engineer·Onsite - System Design / Architecture·Senior

SeniorPrefer not to say
Apr 2026

Summary

System design round at Coinbase for a software engineering role. The whole thing was one big question about designing a crypto order placement system, and it went deep fast. Walked out unsure if I'd covered enough of the failure handling side.

Questions Asked (7)

Q1

Design an order placement system for a crypto trading platform that routes buy and sell orders to multiple third-party exchanges, each with different protocols and reliability profiles.

System DesignTechnical Trade-offsAPI & Integrations
Author's notes

Big open-ended one.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying functional and non-functional requirements, such as supported order types, expected throughput, latency, and consistency needs. Then propose a high-level architecture with an order router, adapters for each exchange, and a state manager, emphasizing idempotency, fault tolerance, and reconciliation. Finally, dive into trade-offs around consistency, reliability, and scalability, and discuss how to handle exchange-specific protocols and failures.

Pro tip: Demonstrate awareness of real-world crypto exchange quirks like rate limits, partial fills, and API versioning by proposing a normalized internal order model and a circuit breaker pattern per exchange. This shows you understand both system design and practical integration challenges.

1. Clarify Requirements and Constraints

Ask questions to understand order types (market, limit), expected volume, latency requirements, consistency guarantees, and supported exchanges. Identify non-functional needs like fault tolerance, auditability, and regulatory compliance.

2. High-Level Architecture

Outline core components: API gateway, order service, router, exchange adapters, state store, and monitoring. Explain how orders flow from client to exchange and how responses are processed.

3. Design Exchange Integration Layer

Propose an adapter pattern to abstract different exchange protocols (REST, WebSocket, FIX). Discuss normalization of order formats, handling authentication, rate limits, and error codes.

4. Ensure Reliability and Consistency

Describe mechanisms for idempotency, retries with exponential backoff, circuit breakers, and reconciliation to handle partial failures and ensure eventual consistency between internal state and exchange state.

5. Discuss Trade-offs and Scalability

Analyze trade-offs between consistency and availability, synchronous vs asynchronous processing, and how to scale horizontally. Mention monitoring, alerting, and testing strategies.

Key Points to Mention

  • Idempotency keys to prevent duplicate orders during retries
  • Circuit breaker pattern per exchange to isolate failures
  • Normalized internal order model to abstract exchange differences
  • Reconciliation process to sync internal state with exchange state
  • Rate limiting and backpressure handling for exchange APIs
  • Event-driven architecture with message queues for decoupling and scalability

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

Your request to a venue times out after you've already sent the order. What state do you record, and how do you safely retry without duplicating the order?

System DesignTechnical Trade-offs
Author's notes

This is where I felt the most pressure.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the ambiguity: the request timed out, but the order may or may not have been placed. Explain that you would record the order in a 'pending' or 'unknown' state, then use idempotency keys and reconciliation to safely retry without duplication. Emphasize that the client should never assume failure or success without verification.

Pro tip: Mention that you would design the system to be idempotent from the start, using a client-generated idempotency key, so that retries are inherently safe. This shows you think about failure modes proactively, not just reactively.

1. Clarify the ambiguity

Acknowledge that a timeout does not mean the request failed; the order may have been processed. State that you cannot assume either outcome.

2. Record a pending state

Persist the order with a 'pending' or 'unknown' status, along with a unique idempotency key. This allows later reconciliation and prevents duplicate processing.

3. Retry with idempotency

Retry the request using the same idempotency key. The server should detect the duplicate key and return the original result if the order was already placed, or process it if not.

4. Reconcile and update state

If the retry fails or is inconclusive, query the order status using the idempotency key or a separate status endpoint. Update the local state based on the authoritative response.

5. Handle edge cases

Discuss timeouts on retries, exponential backoff, and dead-letter queues for manual intervention. Ensure the system is resilient and observable.

Key Points to Mention

  • Idempotency keys to uniquely identify the order and prevent duplicates
  • Two-phase commit or saga pattern for distributed transactions
  • Client-side retry logic with exponential backoff and jitter
  • Server-side deduplication and idempotent endpoints
  • Reconciliation via a status check or querying the order by idempotency key
  • Observability: logging, metrics, and alerts for timeouts and retries

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q3

Walk through how a user's funds should be represented and reserved when an order is placed, so you can reconstruct the full history of every balance change for an audit.

Data ModelingSystem Design
Author's notes

Didn't love my answer here.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by framing the problem as an event-sourced ledger where every balance change is an immutable entry, then explain how orders create reservations (holds) that are later settled or released. Walk through the lifecycle of a single order to show how the ledger and reservation system together enable full auditability.

Pro tip: Emphasize that the ledger is append-only and that balances are derived from entries, not stored as mutable fields—this is how you guarantee auditability and avoid race conditions. Also mention idempotency keys to handle duplicate order submissions safely.

1. Model the ledger as an append-only event log

Represent every balance change as an immutable entry with a unique ID, timestamp, account, amount, and type (credit/debit). Balances are computed by summing entries, ensuring a complete audit trail.

2. Introduce reservations (holds) for pending orders

When an order is placed, create a reservation entry that earmarks funds without moving them. This prevents double-spending while keeping the funds in the user's account until settlement.

3. Define the order lifecycle and state transitions

Outline states: placed → reserved → settled (or cancelled/expired). Each transition generates corresponding ledger entries (e.g., release reservation, debit/credit actual funds) to reflect the change.

4. Ensure atomicity and consistency across services

Use database transactions or a saga pattern to atomically update the ledger and reservation state. This guarantees that funds are never double-reserved or lost during failures.

5. Enable audit and reconstruction

Store all entries with sufficient metadata (order ID, user ID, reason) so you can replay the log to reconstruct any historical balance. Provide query APIs to fetch entries by account and time range.

Key Points to Mention

  • Double-entry bookkeeping: every debit has a corresponding credit to ensure consistency.
  • Reservations as separate ledger entries or a dedicated holds table with status (active, released, settled).
  • Idempotency keys to prevent duplicate order processing and duplicate ledger entries.
  • Event sourcing: the ledger is the source of truth; balances are projections.
  • Atomic transactions or distributed sagas to maintain consistency across order and ledger services.
  • Audit requirements: immutable entries, timestamps, and correlation IDs for tracing.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q4

A venue ACK is lost but the order actually filled. Reserved funds are stuck and the user tries to resubmit. How does reconciliation detect and fix this without double-charging or double-filling?

System DesignTechnical Trade-offs
Author's notes

Follow-up that came right at the end.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the system components and the failure scenario, then walk through the reconciliation process step by step, emphasizing idempotency and state consistency. Highlight how reconciliation uses the order's unique ID and exchange data to detect the filled order, release reserved funds, and prevent duplicate submissions.

Pro tip: Mention that reconciliation should be event-driven and idempotent, and that the user's resubmission should be blocked or deduplicated using a client-generated idempotency key. This shows you think about both correctness and user experience.

1. Clarify the scenario and components

Restate the problem: an ACK is lost, the order filled, reserved funds are stuck, and the user resubmits. Identify the key components: order management system, exchange, reconciliation service, and user interface.

2. Explain reconciliation detection

Describe how reconciliation periodically queries the exchange for order status using the order's unique ID. When it finds the order is filled, it marks it as such in the internal system, even if the original ACK was lost.

3. Fix stuck funds and prevent double-charging

Upon detecting the fill, reconciliation releases the reserved funds and updates the user's balance to reflect the actual trade. It ensures idempotency by checking if the order was already processed before applying changes.

4. Handle user resubmission

When the user resubmits, the system should detect the existing order via idempotency key or order ID and reject the duplicate, informing the user that the original order was filled. This prevents double-filling.

5. Summarize trade-offs and safeguards

Discuss trade-offs: reconciliation frequency vs. latency, and the importance of idempotent operations. Mention safeguards like audit logs, alerts for discrepancies, and manual intervention for edge cases.

Key Points to Mention

  • Idempotency keys for order submission to prevent duplicates
  • Reconciliation service that polls exchange for order status
  • Unique order IDs to correlate internal and external states
  • State machine for order lifecycle (pending, filled, cancelled)
  • Atomic updates to user balances and reserved funds
  • Event-driven architecture with retries and dead-letter queues

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q5

How do you cancel an order that was split across two venues when one leg has partially filled and the other is still open? What does the user see during that window?

System DesignAPI & Integrations
Author's notes

Genuinely hadn't thought through the multi-leg cancel case before.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the system's order model: a parent order with child legs per venue, each with independent state machines. Then walk through the cancellation flow: attempt to cancel the open leg, handle the partially filled leg by either canceling the remainder or letting it fill, and ensure atomicity via a saga or two-phase commit. Finally, describe the user-facing state: a 'canceling' status with real-time updates showing filled and canceled quantities per leg.

Pro tip: Emphasize idempotency and reconciliation: cancellation requests must be idempotent to handle retries, and a background reconciler should sync venue states to avoid stuck orders. This shows you think about failure modes and eventual consistency, which is critical in trading systems.

1. Clarify the order model and states

Explain that a split order is a parent order with child legs on each venue, each leg having states like PENDING, OPEN, PARTIALLY_FILLED, FILLED, CANCELED. This sets the foundation for handling cancellation.

2. Initiate cancellation with idempotency

When the user requests cancellation, generate a unique cancellation ID and send cancel requests to both venues. Ensure the operation is idempotent so retries don't cause duplicate cancels.

3. Handle the partially filled leg

For the partially filled leg, attempt to cancel the remaining open quantity. If the venue supports cancel-replace, you might cancel and replace with a smaller order, but typically you just cancel the remainder. The filled portion is irreversible.

4. Handle the open leg

For the still-open leg, send a cancel request. If it fills before cancellation, treat it as a fill and update the order state accordingly. Use a timeout and retry mechanism if the venue doesn't respond.

5. Update user-facing state and reconcile

Show the user a 'canceling' status with real-time updates: filled quantity, canceled quantity, and remaining quantity per leg. Once both legs are resolved (canceled or filled), mark the parent order as CANCELED or PARTIALLY_FILLED/CANCELED. Run a reconciliation job to sync with venue states.

Key Points to Mention

  • Idempotency of cancellation requests to handle retries and network failures.
  • Atomicity across venues: use a saga pattern or two-phase commit to avoid partial cancellations.
  • User interface: display a 'canceling' state with per-leg details (filled, canceled, remaining) and real-time updates via WebSocket.
  • Handling race conditions: what if the open leg fills while cancellation is in progress? Define the order state transitions.
  • Reconciliation: background process to compare internal state with venue states and resolve discrepancies.
  • Error handling: if one venue fails to cancel, retry with backoff and alert if persistent.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q6

How do you guarantee an execution report is applied exactly once to the ledger when the venue might redeliver messages and your consumer could crash mid-update?

System DesignData Modeling
Author's notes

Classic exactly-once processing question dressed up in trading clothes.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by framing the problem as achieving exactly-once semantics in a distributed system, which typically requires idempotency and atomicity. Then describe a concrete design: using a unique message ID for deduplication, storing it in the same transaction as the ledger update, and ensuring the consumer acknowledges only after commit. Finally, discuss how to handle crashes and redeliveries with at-least-once delivery and idempotent processing.

Pro tip: Emphasize that exactly-once is achieved through idempotent writes and transactional boundaries, not by trying to prevent redelivery. Mention that you'd also monitor for duplicate attempts and alert on anomalies to catch edge cases.

1. Clarify requirements and constraints

Confirm the delivery semantics (at-least-once), the need for exactly-once application, and the ledger's consistency requirements. Ask about the message broker and database capabilities.

2. Design idempotent processing

Use a unique execution report ID to deduplicate. Before applying, check if the ID has been processed; if not, apply the update and record the ID in the same atomic transaction.

3. Ensure atomicity with transactions

Wrap the ledger update and the deduplication record insertion in a single database transaction. This guarantees that either both succeed or both fail, preventing partial updates.

4. Handle consumer crashes and acknowledgments

Acknowledge the message only after the transaction commits. If the consumer crashes before commit, the message will be redelivered, but the deduplication check will prevent double application.

5. Address edge cases and monitoring

Discuss handling of duplicate IDs with different payloads, transaction isolation levels, and monitoring for duplicate processing attempts. Consider using a unique constraint on the deduplication table to enforce idempotency.

Key Points to Mention

  • Idempotency key (execution report ID) to uniquely identify each message
  • Atomic transaction combining ledger update and deduplication record
  • At-least-once delivery and consumer acknowledgment after commit
  • Unique constraint or conditional insert to prevent duplicate processing
  • Crash recovery: redelivery will be safely ignored due to deduplication
  • Monitoring and alerting for duplicate attempts or inconsistencies

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q7

How would you extend the design to handle stop-loss or conditional orders, where the trigger depends on live market data rather than being submitted immediately?

System DesignTechnical Trade-offs
Author's notes

Last follow-up, felt almost like a bonus question.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements: what types of conditional orders (stop-loss, take-profit, trailing stop), latency expectations, and consistency guarantees. Then propose a design that separates order submission from trigger evaluation, using a dedicated service that monitors live market data and triggers order placement when conditions are met. Discuss trade-offs around consistency, fault tolerance, and scalability.

Pro tip: Emphasize idempotency and exactly-once triggering to avoid duplicate orders, and consider using a distributed lock or leader election to ensure only one trigger evaluator acts on a condition.

1. Clarify Requirements

Ask about order types, latency requirements, consistency needs, and failure handling expectations to scope the design appropriately.

2. High-Level Architecture

Propose a separate trigger service that subscribes to market data, evaluates conditions, and submits orders to the matching engine when triggered.

3. Data Flow and State Management

Describe how conditional orders are stored, how market data flows to the evaluator, and how state is maintained to detect trigger conditions reliably.

4. Consistency and Fault Tolerance

Discuss mechanisms to ensure exactly-once triggering, handle failures (e.g., evaluator crashes), and avoid duplicate orders.

5. Scalability and Trade-offs

Address scaling to many conditional orders and high market data throughput, and discuss trade-offs between latency, consistency, and cost.

Key Points to Mention

  • Separation of concerns: order management vs. trigger evaluation
  • Use of a pub/sub system for market data distribution
  • Idempotency and exactly-once semantics for order triggering
  • Distributed locking or leader election for trigger evaluators
  • Persistence of conditional orders and trigger state
  • Latency considerations and real-time processing

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.