Code RoomRefund engine with lifecycle awareness
MediumPrep Room Coding #3503

Refund engine with lifecycle awareness

System designDistributed systemsMid–Senior~40 min

Design a refund engine that does the right thing depending on where the original payment is in its lifecycle: if the payment is authorized-but-not-captured, you must VOID (release the hold), not refund; if captured-but-not-yet-settled, you may be able to reverse before settlement; if settled, you issue a true refund that moves money back days later. ~1M refunds/day. Each path has different timing, fees, and reversibility, and the user just clicks 'refund'. How do you model this so the system always picks the correct, cheapest, fastest reversal and never refunds more than was captured?

What a strong answer looks like

Clarify scale and constraints first. Propose a clean component breakdown, then go deep on the hard parts (data model, bottlenecks, consistency, failure modes) and name the trade-offs you are making.

Clarify4:30 left
Estimate4:30 planned
Design13:30 planned
Deep dive10:30 planned
Failure7:00 planned
0:00
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.