← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
Design a banking system that supports the following operations:
deposit(account, money) – add money to the specified account.withdraw(account, money) – withdraw money from the specified account if sufficient funds exist.transfer(account1, account2, money) – transfer money from account1 to account2 if both accounts exist and account1 has sufficient funds.All accounts are 1-indexed. Each operation must validate account indices and sufficient funds (for withdraw/transfer), returning true on success (with balance updates) or false on failure. The system should handle up to 10^5 accounts and 10^4 operations efficiently.