PracHub
QuestionsCoachesLearningGuidesInterview Prep
|Home/System Design/Meta

Design a bank system with scheduling and rankings

Last updated: Mar 29, 2026

Quick Overview

Design a bank system with scheduling and rankings evaluates requirements, scale assumptions, API/data design, architecture, trade-offs, failure modes, and rollout in a realistic interview setting. A strong answer states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.

  • hard
  • Meta
  • System Design
  • Software Engineer

Design a bank system with scheduling and rankings

Company: Meta

Role: Software Engineer

Category: System Design

Difficulty: hard

Interview Round: Technical Screen

Design an in-memory bank system with the following APIs and guarantees: 1) createAccount(accountId, initialBalance= 0) -> void: Create a new account. 2) deposit(accountId, amount) -> bool: Increase balance; return false if accountId does not exist or amount <= 0. 3) withdraw(accountId, amount) -> bool: Transfer out funds; reject if insufficient balance or invalid input. Maintain each account’s cumulativeTransferredOut. 4) getTopSpenders(n) -> List<accountId>: Return the n accounts with the highest cumulativeTransferredOut. Break ties by smaller accountId. Results must reflect all successful withdraws and executed scheduled payments at the time of the call. 5) schedulePayment(accountId, amount, timestamp, delay) -> paymentId: Schedule a withdraw to execute at executeAt = timestamp + delay (timestamps are integers; delay >= 0). The payment counts toward cumulativeTransferredOut only upon successful execution. 6) cancel(paymentId) -> bool: Cancel a not-yet-executed payment. 7) process(nowTimestamp) -> string: Execute all due scheduled payments with executeAt <= nowTimestamp in ascending executeAt order; when executeAt ties, order by increasing paymentId. For each successfully executed payment, update balances and cumulativeTransferredOut. Return a single string that concatenates executed accounts’ IDs in that exact order, separated by commas (return an empty string if none executed). Edge cases and rules: - Amounts are positive integers; balances cannot go negative; failed executions (e.g., insufficient funds) do not affect cumulativeTransferredOut and are not included in the process() return string. - Repeated operations may interleave arbitrarily. Assume single-threaded execution unless you choose to discuss concurrency controls. - Complexity targets: O( 1) average-time for create/deposit/withdraw lookups and updates; O(log M) for scheduling/canceling/executing due payments using an appropriate priority structure where M is the number of pending payments; getTopSpenders(n) should be efficient for variable n queries (propose and justify a data structure choice and its trade-offs). - Specify data structures, method signatures, and invariants. Describe how you would test correctness, handle idempotency (e.g., duplicate payment scheduling), and recover from partial failures (optional).

Quick Answer: Design a bank system with scheduling and rankings evaluates requirements, scale assumptions, API/data design, architecture, trade-offs, failure modes, and rollout in a realistic interview setting. A strong answer states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.

Related Interview Questions

  • Design Top-K, Crawler, and Chess Systems - Meta (hard)
  • Design Search And Web Crawling Systems - Meta (medium)
  • Design an Instagram-Style Social Feed - Meta (medium)
  • Design an Online Game Leaderboard - Meta (hard)
  • Design an On-Demand Delivery Platform - Meta (medium)
|Home/System Design/Meta

Design a bank system with scheduling and rankings

Meta logo
Meta
Jul 27, 2025, 12:00 AM
hardSoftware EngineerTechnical ScreenSystem Design
4
0

Design a bank system with scheduling and rankings

Design an In‑Memory Bank System (Technical Screen)

You are designing an in‑memory bank ledger that supports real‑time withdrawals and scheduled payments. The system runs in a single process (single‑threaded by default) and does not persist to disk. All balances and amounts are integers.

APIs

  1. createAccount(accountId, initialBalance = 0) -> void
    • Create a new account with the given initialBalance.
  2. deposit(accountId, amount) -> bool
    • Increase balance by amount. Return false if accountId does not exist or amount <= 0.
  3. withdraw(accountId, amount) -> bool
    • Decrease balance by amount. Reject if insufficient funds or invalid input. On success, increase the account’s cumulativeTransferredOut.
  4. getTopSpenders(n) -> List <accountId>
    • Return the n accounts with the highest cumulativeTransferredOut. Break ties by smaller accountId. Results must reflect all successful withdraws and executed scheduled payments at the time of the call.
  5. schedulePayment(accountId, amount, timestamp, delay) -> paymentId
    • Schedule a withdrawal to execute at executeAt = timestamp + delay (timestamps are integers; delay >= 0). The payment counts toward cumulativeTransferredOut only upon successful execution.
  6. cancel(paymentId) -> bool
    • Cancel a not‑yet‑executed payment.
  7. process(nowTimestamp) -> string
    • Execute all due scheduled payments with executeAt <= nowTimestamp in ascending executeAt order; when executeAt ties, order by increasing paymentId. For each successfully executed payment, update balances and cumulativeTransferredOut. Return a single string that concatenates executed accounts’ IDs in that exact order, separated by commas (return an empty string if none executed).

Edge Cases and Rules

  • Amounts are positive integers; balances cannot go negative.
  • Failed executions (e.g., insufficient funds) do not affect cumulativeTransferredOut and are not included in process()’s return string.
  • Repeated operations may interleave arbitrarily. Assume single‑threaded execution unless you choose to discuss concurrency controls.

Complexity Targets

  • create/deposit/withdraw: O(1) average time for lookups and updates.
  • schedule/cancel/execute due payments: O(log M), where M is the number of pending payments.
  • getTopSpenders(n) should be efficient for variable n queries; propose and justify a data structure and trade‑offs.

Deliverables

  • Specify data structures, method signatures, and invariants.
  • Explain algorithms and their complexities.
  • Describe how you would test correctness, handle idempotency (e.g., duplicate payment scheduling), and recover from partial failures (optional).

Constraints & Assumptions

  • Preserve the scope, facts, inputs, and requested outputs from the prompt above.
  • If the prompt leaves a detail unspecified, state a reasonable assumption before relying on it.
  • Keep the answer interview-ready: concise enough to present, but concrete enough to implement or evaluate.

Clarifying Questions to Ask

  • Clarify users, core use cases, read/write patterns, scale, latency, availability, and data retention.
  • State explicit assumptions before making sizing or architecture decisions.
  • Prioritize the functional path first, then address reliability, security, observability, and rollout.

What a Strong Answer Covers

  • A scoped requirements summary with concrete non-goals and success metrics.
  • API, data model, architecture, consistency, capacity, and operations.
  • Reasoned trade-offs among simple and scalable designs, including bottlenecks and failure modes.
  • A validation, monitoring, migration, and launch plan appropriate for the risk level.

Follow-up Questions

  • What breaks first at 10x traffic or data volume?
  • How would you degrade gracefully during dependency failures?
  • What metrics and alerts would prove the design is healthy after launch?

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More System Design•More Meta•More Software Engineer•Meta Software Engineer•Meta System Design•Software Engineer System Design

Your design canvas — auto-saved

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
  • AI Coding 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.