← Coinbase Interview Insights

Coinbase·Software Engineer·Technical Phone Screen·Senior

SeniorPrefer not to say
Jun 2026Remote

Summary

Coinbase software engineering interview that went pretty deep into a system design coding problem. It was one of those sessions where the question keeps growing the longer you talk, which I was not fully prepared for.

Questions Asked (2)

Q1

Given an in-memory banking system with accounts, deposits, transfers, spending tracking, and scheduled transfers, implement a mergeAccounts function that folds one account into another. Specifically: combine balances, carry over pending scheduled outflows and historical spending totals, close the source account so future operations on it fail, and return the resulting balance.

System DesignAlgorithms & Data StructuresData Modeling
Author's notes

The basic merge felt doable at first.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and edge cases, then outline a step-by-step algorithm that handles balance merging, scheduled transfer reassignment, spending history aggregation, and source account closure. Emphasize data consistency and atomicity, and discuss how you would test the implementation.

Pro tip: Mention the importance of atomicity and idempotency: if mergeAccounts is called twice or fails midway, the system should not be left in an inconsistent state. Also, consider how to handle scheduled transfers that reference the source account—they should be updated to point to the destination account.

1. Clarify Requirements and Edge Cases

Ask questions to understand constraints: Can accounts have negative balances? What happens to scheduled transfers if the source account is closed? Should historical spending be summed or kept separate? Are there any concurrency concerns?

2. Design Data Model and Operations

Define the account structure (balance, scheduled transfers, spending history) and the merge operation. Consider using a transaction or lock to ensure atomicity. Outline how to update references from source to destination.

3. Implement Merge Logic

Write pseudocode: add source balance to destination, reassign scheduled transfers, combine spending totals, mark source as closed, and return new balance. Handle edge cases like merging into itself or merging closed accounts.

4. Ensure Consistency and Error Handling

Discuss how to handle failures (e.g., rollback on error), prevent operations on closed accounts, and ensure that future operations on the source fail. Consider idempotency if the operation is retried.

5. Test and Validate

Propose test cases: normal merge, merge with pending transfers, merge with spending history, merge into self, merge closed account, and concurrent merges. Verify that source account operations fail post-merge.

Key Points to Mention

  • Atomicity: ensure the merge is all-or-nothing to avoid partial updates.
  • Reassignment of scheduled transfers: update all pending outflows to reference the destination account.
  • Spending history aggregation: sum the historical spending totals from both accounts.
  • Account closure: mark the source account as closed and reject any future operations on it.
  • Return value: return the new balance of the destination account after merge.
  • Concurrency: consider locking or transactional semantics to handle simultaneous merges or operations.

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

Q2

What should happen to in-flight scheduled transfers that referenced the account being closed during a merge? Should they be rewired to the surviving account or cancelled outright, and how do you keep all the underlying indexes consistent?

Technical Trade-offsSystem DesignData Modeling
Author's notes

This follow-up is where things got a bit uncomfortable.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the business and regulatory constraints, then propose a hybrid policy: rewire transfers when the surviving account is valid and the transfer's intent is preserved, otherwise cancel with notification. Emphasize idempotent, transactional updates to all affected indexes and a reconciliation process to handle in-flight edge cases.

Pro tip: Mention that you would add a 'merge_id' to transfer records and use a two-phase commit or saga pattern to ensure atomicity across services, showing you understand distributed systems trade-offs.

1. Clarify requirements and constraints

Ask about business rules, regulatory requirements, and user expectations for transfers during account closure. Determine if transfers are user-initiated or system-scheduled and if they have external dependencies.

2. Define policy for rewiring vs. cancellation

Propose criteria: rewire if the surviving account can fulfill the transfer and the user consents; cancel if the transfer is invalid or risky. Consider partial rewiring based on transfer type.

3. Design transactional update mechanism

Use a distributed transaction or saga to update the transfer records and all related indexes (e.g., account balance, transfer status, audit logs) atomically. Ensure idempotency to handle retries.

4. Handle in-flight transfers and consistency

For transfers already in progress, pause or queue them during merge, then apply the policy. Use a reconciliation job to detect and fix inconsistencies across indexes.

5. Monitor, audit, and communicate

Log all decisions, notify affected users, and set up monitoring for failed rewires or cancellations. Provide an audit trail for compliance.

Key Points to Mention

  • Idempotency and exactly-once processing for transfer updates
  • Transactional consistency across multiple indexes (e.g., using 2PC or saga)
  • User notification and consent for rewired transfers
  • Regulatory and compliance considerations (e.g., KYC, AML)
  • Reconciliation and dead-letter queues for failed operations
  • Merge ID or correlation ID to track transfers across systems

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