Code RoomFee reversal balance mismatch
HardPrep Room Coding #1967

Fee reversal balance mismatch

Code reviewCode quality & reviewSenior–Staff~22 min

Review this Python that verifies a posted-then-reversed fee leaves a large account balance unchanged, as an end-of-day integrity check.

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.

0:00 of about 22 min
Mark a line and say what kind of problem it is.0 findings
1def apply_fee(balance, fee):
2 return balance + fee
3 
4def reverse_fee(balance, fee):
5 return balance - fee
6 
7def net_zero(balance, fee):
8 # balance like 1e16, fee like 0.07
9 after = apply_fee(balance, fee)
10 restored = reverse_fee(after, fee)
11 return restored == balance
12 
13# net_zero(1e16, 0.07) -> expected True
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.