PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Coinbase

Implement banking ops: transfer, top-k, cashback, merge

Last updated: Mar 29, 2026

Quick Overview

This question evaluates a candidate's ability to design a robust in-memory banking system, covering transactional correctness, idempotency, concurrency control, delayed cashback scheduling, aggregate top-k queries, and data structure and complexity trade-offs within the Coding & Algorithms domain.

  • Medium
  • Coinbase
  • Coding & Algorithms
  • Software Engineer

Implement banking ops: transfer, top-k, cashback, merge

Company: Coinbase

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Take-home Project

Design and implement an in-memory banking system that supports: ( 1) CreateAccount(id, initialBalance) and Transfer(fromId, toId, amount) with validation for nonnegative amounts, sufficient funds, account existence, idempotency via transaction IDs, and atomic balance updates; ( 2) a query to return the accounts with the top k total outgoing funds across all transfers, specifying output format, tie-breaking, and expected time/space complexity (e.g., maintain running aggregates for O(log n) updates and O(k log n) queries); ( 3) a Purchase(accountId, amount, txnId) that awards 2% cashback credited exactly 24 hours after the purchase, requiring a structure for pending rewards, a scheduler or sweep to post credits, and idempotent, crash-safe processing; ( 4) MergeAccount(primaryId, duplicateId) to combine balances and transaction histories, redirect future operations from duplicateId to primaryId, and reconcile pending cashback and duplicate transaction IDs. Discuss chosen data structures, concurrency assumptions (single-threaded vs. multi-threaded), and provide unit tests for edge cases (insufficient funds, duplicate transfers, simultaneous merges, and time-bound rewards).

Quick Answer: This question evaluates a candidate's ability to design a robust in-memory banking system, covering transactional correctness, idempotency, concurrency control, delayed cashback scheduling, aggregate top-k queries, and data structure and complexity trade-offs within the Coding & Algorithms domain.

Related Interview Questions

  • Implement a Coin-Constrained Jump Strategy - Coinbase (hard)
  • Implement an In-Memory Database - Coinbase (hard)
  • Implement Game Physics and Block Mining - Coinbase (hard)
  • Compute Total Manual Distance - Coinbase (medium)
  • Implement a Flappy Bird Jump Agent - Coinbase
Coinbase logo
Coinbase
Sep 6, 2025, 12:00 AM
Software Engineer
Take-home Project
Coding & Algorithms
14
0

Design and implement an in-memory banking system that supports: (

  1. CreateAccount(id, initialBalance) and Transfer(fromId, toId, amount) with validation for nonnegative amounts, sufficient funds, account existence, idempotency via transaction IDs, and atomic balance updates; (
  2. a query to return the accounts with the top k total outgoing funds across all transfers, specifying output format, tie-breaking, and expected time/space complexity (e.g., maintain running aggregates for O(log n) updates and O(k log n) queries); (
  3. a Purchase(accountId, amount, txnId) that awards 2% cashback credited exactly 24 hours after the purchase, requiring a structure for pending rewards, a scheduler or sweep to post credits, and idempotent, crash-safe processing; (
  4. MergeAccount(primaryId, duplicateId) to combine balances and transaction histories, redirect future operations from duplicateId to primaryId, and reconcile pending cashback and duplicate transaction IDs. Discuss chosen data structures, concurrency assumptions (single-threaded vs. multi-threaded), and provide unit tests for edge cases (insufficient funds, duplicate transfers, simultaneous merges, and time-bound rewards).

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Coinbase•More Software Engineer•Coinbase Software Engineer•Coinbase Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 8,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.