A retailer sells the same stock through stores, its website and marketplaces. Stock counts disagree. What is the architecture problem?
Show the full answer Hide the answer
What the interviewer is testing
Whether you recognise a distributed ownership problem rather than a synchronisation bug.
The problem
There is no single owner of the inventory number. Each channel holds its own view, updated by its own process on its own schedule, and reconciliation happens after the fact — so the counts disagree continuously and correctness is a matter of degree.
Physical reality makes this worse than a normal distributed data problem: stock is consumed by in-store customers with no digital transaction at the moment of picking up an item, so the true count is unknown even in principle between stock counts.
The design
One authoritative inventory service owning the count, with all channels reading from and reserving against it. This is the necessary structural change and it is usually the hard organisational work, because each channel currently owns its own.
Availability is a derived, channel-specific view, not the raw count. Each channel applies its own buffer and rules — a marketplace might not be offered the last two units, a store reserves for walk-ins. This decouples "how much exists" from "how much may this channel sell", which is the distinction that resolves most of the disagreement.
Reservations rather than decrements during checkout, with expiry, so an abandoned basket returns stock automatically.
Event-driven propagation of changes to channel-local caches for browsing, with the authoritative check at commit. Browsing tolerates staleness; committing does not.
Reconciliation against physical counts, since the digital record drifts from reality through shrinkage, damage and mis-picks regardless of how good the software is.
What a strong answer adds
The safety buffer as a business decision. Perfect consistency across channels is unachievable in a world with physical stock, so the question is how much stock to hold back to make overselling rare — and that trades revenue against the cost of cancelling orders. It belongs to commerce, not to engineering, and stating it that way is what gets it decided rather than defaulted.
And the observation that the hardest part is organisational: channels that currently own their inventory number will resist giving it up.
Common weak answers
More frequent synchronisation between channel systems, which reduces the window and not the problem. Strong consistency across all channels, which is unachievable given physical stock.