Users of your search feature complain that a query they ran twice returns slightly different result counts, and that a product they just edited took a few seconds to show up. How do you explain these behaviors and decide which ones are acceptable to leave as-is?

system-design · Staff-principal level · software-engineering

What the interviewer is really asking

Probes operational depth on a distributed search cluster — why refresh-interval lag and per-shard scoring/bouncing results produce these symptoms, and the judgment to distinguish a benign trade-off (acceptable) from a real defect (must fix), rather than treating every inconsistency as a bug.

What to say

What to avoid

Example answers

Strong: Two different mechanisms are at play. The few-seconds delay after an edit is refresh lag: a document only becomes searchable when the next refresh exposes a new segment, about a second by default plus pipeline lag, so that delay is the expected cost of indexing throughput — I'd confirm it lines up with the configured refresh interval before treating it as anything. The bouncing counts come from sharding: relevance statistics and counts are computed per shard, so which replica answers can slightly change scoring and totals, and approximate aggregations wobble. That's a known distributed-scoring artifact, not a bug in our code.

Weak: It's an eventual consistency system, so some inconsistency is just expected and there's nothing really to do about it.

Want questions matched to your role? Paste a job title, job description, or CV and get a personalized set, or go Pro to unlock the full bank.