PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/HubSpot

Design a bank with scheduled payments and merges

Last updated: Mar 29, 2026

Quick Overview

This question evaluates data-structure and algorithm design competencies with emphasis on concurrency, time-based scheduling, aggregation (TopK), transactional consistency, idempotency, and merge semantics for an in-memory banking service, falling under the Coding & Algorithms and system-design domain.

  • Medium
  • HubSpot
  • Coding & Algorithms
  • Software Engineer

Design a bank with scheduled payments and merges

Company: HubSpot

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Take-home Project

Design an in-memory banking service that supports the following operations: ( 1) CreateAccount(accountId), ( 2) Deposit(accountId, amount), ( 3) Transfer(srcId, dstId, amount), ( 4) TopKByTotalOut(k) to return the k accounts with the largest cumulative outgoing amounts, ( 5) SchedulePayment(srcId, dstId, amount, executeAtEpochMillis) where a scheduled payment executes when its due time arrives and is skipped (not retried) if the source balance is insufficient, and ( 6) MergeAccounts(aId, bId) to combine two accounts into one (define the resulting accountId, combined balance, combined outgoing totals, and how to handle any scheduled-but-not-yet-executed payments for both accounts). Specify the data structures you would use to support efficient real-time updates and time-based execution (e.g., for scheduling), and describe how you would maintain the TopK view as deposits, transfers, merges, and scheduled payment executions occur. Provide clear method signatures, expected time and space complexities for each operation, and the rules for consistency and idempotency (e.g., handling duplicate requests or retries). Explain how you would process due payments continuously (or on a timer) and ensure correctness when multiple operations happen near the execution time. Discuss edge cases such as merging accounts that have pending scheduled payments, transferring to the same account, zero/negative amounts, and ties in TopK ordering.

Quick Answer: This question evaluates data-structure and algorithm design competencies with emphasis on concurrency, time-based scheduling, aggregation (TopK), transactional consistency, idempotency, and merge semantics for an in-memory banking service, falling under the Coding & Algorithms and system-design domain.

Related Interview Questions

  • Validate hiring request under role constraints - HubSpot (medium)
  • Find a special person using knows(a,b) - HubSpot (easy)
  • Design and implement a bank account system - HubSpot (Medium)
  • Design file deduplication at scale - HubSpot (Medium)
  • Implement Python LRU cache with varargs - HubSpot (Medium)
HubSpot logo
HubSpot
Sep 6, 2025, 12:00 AM
Software Engineer
Take-home Project
Coding & Algorithms
20
0

Design an in-memory banking service that supports the following operations: (

  1. CreateAccount(accountId), (
  2. Deposit(accountId, amount), (
  3. Transfer(srcId, dstId, amount), (
  4. TopKByTotalOut(k) to return the k accounts with the largest cumulative outgoing amounts, (
  5. SchedulePayment(srcId, dstId, amount, executeAtEpochMillis) where a scheduled payment executes when its due time arrives and is skipped (not retried) if the source balance is insufficient, and (
  6. MergeAccounts(aId, bId) to combine two accounts into one (define the resulting accountId, combined balance, combined outgoing totals, and how to handle any scheduled-but-not-yet-executed payments for both accounts). Specify the data structures you would use to support efficient real-time updates and time-based execution (e.g., for scheduling), and describe how you would maintain the TopK view as deposits, transfers, merges, and scheduled payment executions occur. Provide clear method signatures, expected time and space complexities for each operation, and the rules for consistency and idempotency (e.g., handling duplicate requests or retries). Explain how you would process due payments continuously (or on a timer) and ensure correctness when multiple operations happen near the execution time. Discuss edge cases such as merging accounts that have pending scheduled payments, transferring to the same account, zero/negative amounts, and ties in TopK ordering.

Submit Your Answer to Earn 20XP

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,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.