← 返回 airbnb 的题目列表Progressive Banking System OA
类型:qbank
Build a four-level banking system. The progression covers account creation, deposits and transfers; ranking the highest-spending accounts; scheduling and canceling future payments; and finally merging accounts while supporting historical-balance queries.
Requirements
Implement a banking system whose levels unlock progressively.
Level 1:
Create an account.
Deposit money into an account.
Transfer money from one account to another.
Level 2:
Return the top N accounts by total money spent.
Level 3:
Schedule a future payment.
Cancel a scheduled payment.
Due scheduled payments affect the results of operations introduced in Levels 1 and 2.
Level 4:
Merge accounts.
Query an account's historical balance at a specified time.
Notes
Time-dependent work must be settled before executing operations whose results depend on the current state. A single settlement routine invoked by earlier operations keeps this behavior consistent.
Later levels depend directly on the state and accounting decisions made in earlier levels.
The exact method signatures, ranking tie-breakers, scheduled-payment ordering rules, and account-merge semantics are not yet exposed.
Preparation
Implement account creation, deposits, and transfers behind one account-state map, then regression-test every operation after each extension.
Add spending totals and a deterministic top-N query while keeping the tie-break rule isolated so it can follow the supplied contract.
Model pending payments in time order and route all time-sensitive operations through one settle(now) transition.
Practice merging two account histories without losing the timeline needed for point-in-time balance queries.