I participated in an online assessment that involved designing a bank system with increasing levels of functionality. I completed three out of four levels.
Details
The online assessment consisted of an object-oriented design problem. I had to design a bank system with time-aware transactions. The timestamp for each transaction was guaranteed to strictly increase. There were four levels, each building upon the previous one:
Level 1: Implement deposit and withdraw functionalities for users.
Level 2: Implement a function to get the top active users by "transaction" value. The transaction value is the sum of all successful operations. For example, if a user deposits $100 at time_1 and withdraws $50 at time_2, the transaction value at time_3 is $150 (different from the balance). The function should output the top K users with the highest transaction values.
Level 3: Implement transfer functionality with two functions: one for the source user to initiate a transfer and another for the target user to accept the transfer. Transfers have an expiration time. Only accepted transfers are added to the transaction value. When a transfer is created, the amount is deducted from the source user's account. If the transfer is not successful, a refund should be issued.
Level 4: I did not have time to reach this level.
I did not pass one test case in Level 3, and I submitted the solution because there was no time left. I discovered edge cases in Level 3 during debugging failed unit tests that were not mentioned in the problem description.