All jobs / Solutions / cloud architect / Application Architecture
Solutions / cloud architect interview question · 1–3 years
The booking flow sometimes charges the card after the hotel step has already failed.
Booking a trip touches flights, hotel and payment services. How do you keep them consistent?
The strongest answer
A saga: each step commits locally and publishes; failures trigger compensating actions, and the booking has explicit intermediate states the user can see
Why it works
Exactly. Local commits, compensation, visible states. It is more work and it is the honest model.
What a good answer covers
- Saga: local commits plus compensation.
- Intermediate states are explicit.
- Avoid cross-service 2PC.
- Half-done must be visible and recoverable.
Answers that fall short
- Close, but not the strongest: A distributed transaction so all three commit together or not at all
Two-phase commit across independent services holds locks across networks and couples availability; most teams regret it. - Weak: One service that owns all three tables so a normal transaction works
Merging three domains into one owner solves the transaction by undoing the boundaries. - Red flag: Call all three and retry whatever failed until it succeeds
Retrying forever with no compensation leaves half-bookings nobody can explain.
Who gets asked this
More Application Architecture questions
- How do you replace a large legacy system without a big-bang cut-over?
- When does separating read and write models earn its complexity, and when does it not?
- A team proposes event sourcing for the whole platform. What do you check before agreeing?
- How do you decide where one service ends and another begins?
- Six services share one database and every schema change needs six approvals. What do you propose?
- For a saga across several services — choreography through events, or an orchestrator?
- The platform team wants a service mesh. How do you decide whether it is worth it?
- When is a serverless function the right choice, and when does it turn into a trap?