Design a wallet system. The requirements are: A can give B some virtual currency at a certain time. This uses a virtual currency. So imagine virtual currency in a video game, and users are making transactions using this virtual currency.
Example inputs: [{user1, pay_amount: 200, time: 16:00}, {user2, pay_amount: 45, time: 17:00}...]
The user key indicates who gets the virtual currency (we don’t need to worry about the sender). Further, the reason for the delay is that there’s a fraud system that takes time to perform its analysis, and so we delay the payments by a certain amount, hence the use of the time key in the request.
The payment should occur within a few minutes of the specified time. If something goes wrong, it should be handled gracefully.
Follow ups include scalability and error handling problems.
To recover from an error, I mentioned using a WAL (write-head log). For simplicity, I saved the log to the DB.
I was rejected due to this round. How would you solve this?