← 返回 ramp 的题目列表OA — In-Memory Banking System (4 Levels)
类型:qbank
The most common Ramp CodeSignal OA domain: a four-level in-memory banking system — core accounts and payments, ranking accounts by outgoing volume, scheduled payments with cashback, and merging two accounts while preserving balances and history.
Requirements
A four-level progressive build of an in-memory banking system. Each level unlocks after the previous one passes all unit tests; efficiency is not graded.
Level 1 — Core banking. Create accounts and support deposits / transfers / payments and balance queries between accounts.
Level 2 — Ranking. Rank accounts by total outgoing transaction volume.
Level 3 — Scheduled payments + cashback. Schedule payments that pay out cashback, and let callers check the status of scheduled payments.
Level 4 — Merge accounts. Merge two accounts while retaining both accounts' balances and full transaction histories.
Variants of the same domain also surface as: computing per-account balance and cashback from a stream of requests, and a "create account / transfer / pay / merge" sequence.
Notes
This is the canonical Ramp OA domain and the one worth practicing first. The Level-1 data model decides how painful Levels 3–4 are: store per-account, timestamp-ordered transaction history from the start so ranking, scheduled-payment status, and merge all read off existing structure instead of forcing a rewrite.
Cashback and scheduled-payment status imply time matters — keep timestamps on every operation even when early levels seem not to need them.
Merge must be lossless: combined balance plus the union of both histories, with later queries (ranking, status) still correct against the merged entity.
Preparation
Implement Levels 1–2 end-to-end (accounts, transfers, outgoing-volume ranking) and unit-test ties in the ranking order.
Extend to scheduled payments with cashback and a status query, then to a lossless account merge, reusing the same history structure rather than special-casing each level.