Code Room
Code reviewHardcr-p002
Subject ConcurrencyLevel Mid–Senior~18 minCommon in Concurrency interviewsIndustries Software development

Question

This account-debit code runs in a multi-threaded server. What's wrong?

What a strong answer looks like

Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix — specific and kind.

Talk through your review
Code to reviewpython
def withdraw(account, amount):    if account.balance >= amount:        account.balance -= amount        return True    return False
Run or narrate your approach, then ask the coach.