Code RoomBooking succeeds after payment fails
HardPrep Room Coding #1738

Booking succeeds after payment fails

Code reviewReliability & on-callSenior–Staff~35 min

Review this Go multi-service booking orchestration.

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 35 min
Mark a line and say what kind of problem it is.0 findings
1func BookTrip(t Trip) error {
2 if err := hotels.Reserve(t.Hotel); err != nil {
3 return err
4 }
5 if err := flights.Book(t.Flight); err != nil {
6 return err
7 }
8 if err := payments.Charge(t.Card, t.Total); err != nil {
9 return err
10 }
11 return nil
12}
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.