Code Room
Code reviewHard
Question
Review this Java order pipeline. `tryReserve` performs a network call and returns whether an inventory hold succeeded; `tryCharge` actually moves money.
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.
Learn the concepts
boolean process(Order o) { // Reserve stock first, then charge the customer. boolean ok = inventory.tryReserve(o) & payments.tryCharge(o); if (ok) { fulfillment.enqueue(o); log.info("order {} placed", o.id()); } else { log.warn("order {} failed", o.id()); } return ok;}Run or narrate your approach, then ask the coach.