Reported interview periodNov 2025–Apr 2026
Make a Bank Account Thread-Safe
You are given a BankAccount whose deposit method performs a read-modify-write operation and may pause between reading and writing. You cannot modify that class. Implement a subclass that makes deposits safe whe…
Practice focusCall the inherited implementation rather than copying it. Two deposits of 500 and 700 into an account starting at 0 must finish with 1200 . Ensure the lock is released if the inherited method raises. The supplied constructor creates the account and its lock. Complete deposit only. The provided run case adapter owns the concurrent fixture execution; it is not candidate work. Opening balances and deposit amounts are integers, and deposit amounts are nonnegative. Empty deposit lists leave the opening balance unchanged. Each successful call returns None .…