Sobes.tech
Junior — Senior

Transferring funds between accounts in a multithreaded system

livecode

Task condition

Task: Design business logic that allows transferring funds from one account to another (method transfer), and also develop a functional test for this method. When implementing, it is necessary to consider that the code will be executed in a multithreaded environment.

class Account:
    ...

class MoneyTransfer:
    def transfer(source: Account, destination: Account, amount: float):
        ...

class TestMoneyTransfer:
    def test_transfer():
        ...

test = TestMoneyTransfer()
test.test_transfer()