PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/System Design/HubSpot

Implement account CRUD and transfer

Last updated: Mar 29, 2026

Quick Overview

This question evaluates skills in transactional system design, concurrency control, idempotency, API specification, data modeling, and robust error handling for money-movement and account operations.

  • medium
  • HubSpot
  • System Design
  • Software Engineer

Implement account CRUD and transfer

Company: HubSpot

Role: Software Engineer

Category: System Design

Difficulty: medium

Interview Round: Take-home Project

##### Question Design and implement APIs to create an account, deposit money into an existing account, and transfer funds between two accounts while maintaining atomic balance updates and proper error handling.

Quick Answer: This question evaluates skills in transactional system design, concurrency control, idempotency, API specification, data modeling, and robust error handling for money-movement and account operations.

Related Interview Questions

  • Design a video streaming platform like Netflix/YouTube - HubSpot (medium)
  • Design an hourly weather crawling service - HubSpot (easy)
  • Design a Netflix-like video platform - HubSpot (easy)
  • Design a near-real-time weather API - HubSpot (hard)
  • Design a streaming video platform MVP (Netflix-like) - HubSpot (hard)
HubSpot logo
HubSpot
Aug 4, 2025, 10:55 AM
Software Engineer
Take-home Project
System Design
6
0

Design and Implement Money Movement APIs

Context

You are building a small money-movement service for a single currency. The system must support creating accounts, depositing money, and transferring funds between accounts. Operations must be atomic and resilient to concurrency issues, and should provide clear, consistent error handling.

Assume a service with a relational database. You may choose any language/framework; document your choices and trade-offs.

Requirements

  1. APIs
    • Create account
    • Deposit into an existing account
    • Transfer funds between two existing accounts
  2. Correctness and Atomicity
    • Balance updates must be atomic and consistent under concurrent requests.
    • Prevent overdrafts; a transfer should fail if the source account lacks funds.
    • Ensure no partial updates (transfer must either fully succeed or have no effect).
  3. Concurrency Control
    • Handle concurrent deposits/transfers safely (no lost updates, no race conditions).
    • Avoid deadlocks.
  4. Idempotency and Error Handling
    • Make deposit and transfer endpoints idempotent (e.g., via an Idempotency-Key header).
    • Define clear error codes/messages (validation, not found, insufficient funds, conflicts).
  5. Data Modeling
    • Use an integer-based amount (e.g., cents) to avoid floating-point errors.
    • Persist a minimal audit trail (e.g., ledger entries) for deposits/transfers.
  6. Documentation & Tests
    • Document API contracts (requests/responses), validation rules, and error schema.
    • Provide a basic test plan covering core and edge cases (including concurrency and idempotency).

Deliverables

  • Data model (DDL or schema definition).
  • API specification (routes, payloads, responses, error schema).
  • Implementation outline with transaction logic ensuring atomicity.
  • Notes on concurrency control, idempotency, and validation.
  • Test plan (and tests if you implement code).

Solution

Show

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More System Design•More HubSpot•More Software Engineer•HubSpot Software Engineer•HubSpot System Design•Software Engineer System Design
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.