Code RoomStored-value wallet with promo expiry
MediumPrep Room Coding #3510

Stored-value wallet with promo expiry

System designDistributed systemsMid–Senior~35 min

Design a stored-value wallet that mixes real money and promo/credit balances with different spend rules: promo credits expire, can only be used on certain order types, and must be consumed before real balance; meanwhile concurrent operations (a checkout placing a hold, a refund adding credit, a nightly expiry job) all race on the same wallet. ~60M wallets, peak ~8,000 spends/sec. How do you keep the balance correct, apply the consume-promo-first rule, and ensure an expiry job never voids credit that's already reserved by an in-flight checkout?

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:00 left
Estimate4:00 planned
Design11:30 planned
Deep dive9:30 planned
Failure6:00 planned
0:00
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.