Katkat

Implement bank balance operations

CoinbaseSoftware Engineer · Technical Screen

Last 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.