← Coinbase Interview Insights

Coinbase·Software Engineer·Technical Phone Screen·Senior

Senior
Jul 2026

Summary

Coinbase SWE interview had me extending a basic banking system with deferred payment scheduling. Pretty meaty design problem for a single coding round, more interesting than the usual LeetCode grind.

Questions Asked (1)

Q1

You have a basic banking system with users, balances, deposits, and transfers. Extend it to support scheduled payments: implement schedulePayment(from_user, to_user, amount, execute_at) that queues a transfer for a future time and returns a unique payment ID, and cancelPayment(payment_id) that cancels a pending payment and returns whether it succeeded.

Algorithms & Data StructuresSystem DesignTechnical Trade-offs
Author's notes

The baseline system was handed to me, so the real challenge was figuring out the right data structures for the scheduling layer.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and constraints, then design a data model that stores scheduled payments with status and execution time. Discuss the execution mechanism (e.g., background worker or scheduler) and how to ensure atomicity and idempotency. Finally, analyze trade-offs and edge cases.

Pro tip: Emphasize idempotency and failure recovery: scheduled payments must not double-execute if the system crashes. Mention using a unique payment ID as an idempotency key and persisting state before execution.

1. Clarify Requirements

Ask about expected scale, precision of execute_at, whether payments can be modified, and failure handling. Confirm that cancelPayment only works for pending payments.

2. Design Data Model

Define a ScheduledPayment entity with fields: payment_id (unique), from_user, to_user, amount, execute_at, status (PENDING, EXECUTED, CANCELLED). Store in a durable database with an index on execute_at and status.

3. Implement Scheduling and Execution

Use a background worker or scheduler that polls for due payments (execute_at <= now AND status = PENDING). For each, atomically update status to EXECUTED and perform the transfer, ensuring idempotency via payment_id.

4. Implement Cancellation

cancelPayment(payment_id) should atomically check if the payment is PENDING and update status to CANCELLED. Return true if successful, false otherwise (e.g., already executed or cancelled).

5. Discuss Trade-offs and Edge Cases

Cover consistency (e.g., using transactions or two-phase commit), scalability (sharding by user or time), and failure recovery (retries, dead-letter queues). Address clock skew, time zones, and partial failures.

Key Points to Mention

  • Idempotency: Use payment_id to prevent duplicate execution if the scheduler retries.
  • Atomicity: Ensure status update and balance transfer happen in a single transaction or with compensating actions.
  • Concurrency: Handle race conditions between cancellation and execution (e.g., optimistic locking).
  • Scalability: Consider partitioning scheduled payments by time or user to handle high volume.
  • Failure recovery: Persist state before execution and use retries with exponential backoff.
  • Time handling: Store execute_at in UTC and account for clock skew across servers.

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