PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/HubSpot

Design and implement a bank account system

Last updated: Apr 28, 2026

Quick Overview

This question evaluates a candidate's skills in system design, data modeling, transactional integrity, concurrency control, idempotency, API design, and algorithmic complexity for implementing a minimal banking service.

  • Medium
  • HubSpot
  • Coding & Algorithms
  • Software Engineer

Design and implement a bank account system

Company: HubSpot

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Take-home Project

Design and implement a minimal banking service with the following capabilities: 1) Create bank accounts with unique IDs and an initial balance; support deposit and withdrawal operations while preventing overdrafts. 2) Maintain per-account transaction history. Each record should include a timestamp, operation type (deposit, withdrawal, transfer_pending, transfer_in, transfer_out), amount, and resulting balance. Provide APIs to fetch the full history and the most recent N entries. 3) Implement inter-account transfers that execute only if the recipient explicitly accepts them. A transfer starts in PENDING and does not change balances until accepted; if rejected or expired, it is canceled. Ensure idempotent accept/reject handling, validate sufficient funds at acceptance time, and make operations safe under concurrent requests. Expose clear method signatures (e.g., createAccount, deposit, withdraw, createTransfer, acceptTransfer, rejectTransfer, getHistory). Describe chosen data structures, outline time/space complexity for core operations, and discuss edge cases (duplicate requests, invalid accounts, negative amounts, and clock/timestamp considerations).

Quick Answer: This question evaluates a candidate's skills in system design, data modeling, transactional integrity, concurrency control, idempotency, API design, and algorithmic complexity for implementing a minimal banking service.

Related Interview Questions

  • Validate hiring request under role constraints - HubSpot (medium)
  • Find a special person using knows(a,b) - HubSpot (easy)
  • Find the spammer using hasMessaged - HubSpot (Medium)
  • Implement Python LRU cache with varargs - HubSpot (Medium)
  • Implement a same-host web crawler - HubSpot (Medium)
HubSpot logo
HubSpot
Sep 6, 2025, 12:00 AM
Software Engineer
Take-home Project
Coding & Algorithms
25
0

Design and implement a minimal banking service with the following capabilities:

  1. Create bank accounts with unique IDs and an initial balance; support deposit and withdrawal operations while preventing overdrafts.
  2. Maintain per-account transaction history. Each record should include a timestamp, operation type (deposit, withdrawal, transfer_pending, transfer_in, transfer_out), amount, and resulting balance. Provide APIs to fetch the full history and the most recent N entries.
  3. Implement inter-account transfers that execute only if the recipient explicitly accepts them. A transfer starts in PENDING and does not change balances until accepted; if rejected or expired, it is canceled. Ensure idempotent accept/reject handling, validate sufficient funds at acceptance time, and make operations safe under concurrent requests. Expose clear method signatures (e.g., createAccount, deposit, withdraw, createTransfer, acceptTransfer, rejectTransfer, getHistory). Describe chosen data structures, outline time/space complexity for core operations, and discuss edge cases (duplicate requests, invalid accounts, negative amounts, and clock/timestamp considerations).

Submit Your Answer

Sign in to leave a comment

Loading comments...

Browse More Questions

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

Master your tech interviews with 8,500+ 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.