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 question evaluates system design competency with emphasis on data modeling, API and identifier semantics, validation rules, return-value conventions, transaction recording, and complexity analysis for an in-memory banking service.