Implement bank balance operations
CoinbaseSoftware Engineer · Technical ScreenLast updated
This question evaluates object-oriented programming, state management, input validation, and arithmetic correctness when implementing account operations and maintaining transactional invariants.
Question
Design and implement a Bank account class that supports the operations Deposit(amount), Withdraw(amount), and CashBack(percent). Ensure balance updates correctly, prevent overdrafts, and return the updated balance after each operation.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.