Dropbox | Online Assessment | Banking Syste,

Build a python class for a banking system
Level 1: Support creating new accounts, depositing money into accounts, and transferring money between two accounts.
Level 2: Ranking accounts (i.e top_spenders) based on outgoing transactions.
Level 3: The banking system should allow scheduling payments with cashback (2% cashback deposited to account 24 hours after transaction) and checking the status of scheduled payments .
Level 4: The banking system should support merging two accounts while retaining both accounts' balance and transaction histories.

It's important to read the whole question, since in Level 4 it says "retain transaction histories" while you can get away with doing all Level 1 and 2 and 3 without building any construct of a transaction history.

That's where they got me.

Signatures of functions are

create_account(timestamp : int, account : str) -> str
deposit(timestamp : int, account : str, amount : int) -> str
transfer(timestamp : int, account1 : str, account2 : str amount : int) -> str
top_spenders(timestamp : int, n : int) -> str
pay(timestamp : int, account : str, amount : int) -> str (returns payment_id)
check_payment_status(timestamp : int, account : str, payment_id : str) -> returns "IN_PROGRESS", "CASHBACK_COMPLETED"
merge_account(timestamp : int, account1 : str, account2 : str) -> str
get_balance(timestamp : int, account : str, time_at : str) -> str
		this should support an account that might've been merged

For Level 1 and Level 2 timestamp is not even necessary, but it becomes important for level 3 and level 4

Comments (4)