Design core bank operations
Company: Meta
Role: Software Engineer
Category: System Design
Difficulty: medium
Interview Round: Take-home Project
Design a BankSystem class that supports: createAccount(timestamp, customerId) -> bool, deposit(timestamp, customerId, amount) -> int, and pay(timestamp, sourceAccountId, targetAccountId, amount) -> int. Define data models, validation rules (duplicate/nonexistent accounts, nonpositive amounts, insufficient funds), id semantics, and return values. Describe how balances and transaction records are updated, what data structures you use (e.g., hash maps keyed by accountId), and the time/space complexity of each operation.
Quick Answer: This interview question evaluates requirements, scale assumptions, API/data design, architecture, trade-offs, failure modes, and rollout in a realistic interview setting. A strong answer for Design core bank operations states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.