I recently gave telephonic screening for Google and I was asked to design APIs for wiretransfer functionality. Question gave below information:
Class Money{
}
Class BankAccount{
Money money;
Void Lock()
Void Unlock()
money getBalance()
setBalance(money)
AccountNumber
RoutingNumber
}
Question was to design and implement wiretransfer API. Question focus was on how to deal with concurrent transactions and how will you test concurrent transactions in scaled and non scaled scenarios.