Quick revision
The short answer
We hold the prize payouts, announce a short review, and rebuild the final standings by replaying the durable match results or score events up to the official end time into a fresh ranking structure, then compare with what was published and publish corrected results with an explanation. For the future, every score is written to a durable log or database and acknowledged before the in-memory board changes, final standings are computed as a separate step after a grace period and fraud checks, the live board is labelled provisional, and rebuild time and failover are measured regularly.
What to remember
In this answer, we saw that the tournament standings were wrong because the in-memory board, with an asynchronous replica, was the only source of the final result. We settled it by holding payouts, replaying the durable match results up to the official end into a fresh structure with the same rule code, comparing and publishing corrected results with an explanation. For the future, scores are durable before the board changes, final standings are computed after a grace period and fraud checks while the live board is labelled provisional, and rebuild time and failover are measured and drilled.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
We hold the prize payouts, announce a short review, and rebuild the final standings by replaying the durable match results or score events up to the official end time into a fresh ranking structure, then compare with what was published and publish corrected results with an explanation. For the future, every score is written to a durable log or database and acknowledged before the in-memory board changes, final standings are computed as a separate step after a grace period and fraud checks, the live board is labelled provisional, and rebuild time and failover are measured regularly.
Why this question is asked
When a leaderboard only shows bragging rights, losing 40 seconds of updates is a shrug. When it decides cash prizes, the same loss becomes a fairness problem with legal and reputational weight, and 3,000 players now have a reason to distrust the tournament. Interviewers ask this to see whether we can settle the incident fairly and whether we recognise the design mistake underneath: the in-memory board was treated as the truth. In this answer, we will explain what failed, settle the tournament step by step, replay the durable record, change the write order so the board is always rebuildable, separate final standings from the live board, and make rebuild time a measured property.
1What Actually Failed
The board lived in an in-memory store with an asynchronous replica. Asynchronous means the primary applied each score update, answered, and sent it to the replica a little later. When the primary failed two minutes before the end, the replica had not received the last 40 seconds of updates, and when it was promoted those updates simply did not exist. The tournament then closed and the standings were read from the promoted replica.
The deeper mistake was not the failover; failovers happen. It was that the in-memory board was the only place the final standings came from. If the scores had also been recorded durably, the loss would have been a short delay in the live view, not wrong prize results.
2Settling the Tournament Fairly
The first step is to stop money from moving. We hold the prize payouts and announce, within the hour, that the final standings are under review because of a technical failure, with a time by which corrected results will be published. Saying nothing while players compare screenshots is the worst option.
- Hold all payoutsannounce a review and a deadline
- Find the durable recordmatch results or score events
- Replay up to the official end timeinto a fresh ranking structure
- Compare with the published boardlist every changed rank and prize
- Fraud checks on the new top finisherssame checks as a normal close
- Publish corrected resultswith an explanation and contact for disputes
6 steps in order. Play them, or step through them one at a time.
Some players will have been told they won a prize they now lose. Whether the company honours those prizes as goodwill is a business decision, often worth making, but it must not change the corrected standings themselves, which have to reflect what really happened in the matches.
3Replaying the Durable Record
Where do the true scores come from? The game servers' match results, which are stored durably by the match service, or a score event log if we have one. We replay every event with an event time before the official end, in order, into a fresh ranking structure, not into the damaged one.
Notice that the query does not compute ranks itself. It streams the valid results in time order into the ranking code we already trust, which applies the best-score and tie-break rules exactly as the live board did. Using the same rule code avoids a second implementation that disagrees in some corner case, and the cut-off on achieved_at makes sure that nothing after the official end counts.
4Design Rule: Durable First, Board Second
The structural fix is to change the write order. Each score event is written to a durable log or database and acknowledged by it before the in-memory board is updated. The board becomes a cache with a shape: fast to read, and always rebuildable from the durable record.
6 messages in order. Play them, or step through them one at a time.
A lost board update is recovered by replaying the log, never lost.
5Final Standings Are a Separate Step
The live board answers 'how am I doing right now'. The prize result answers 'who won', and those are different questions. After the official close, we wait a grace period, for example 15 minutes, for results from matches that were still finishing and for delayed submissions. Then we run fraud checks on top finishers, such as replay verification and anomaly checks, and only then freeze the final standings, computed from the durable record.
The live board is labelled provisional in the interface throughout. Players then expect that the final result may differ slightly, and a correction is a normal part of the process instead of a scandal.
6Measuring Rebuild Time and Running Drills
A rebuildable board is only useful if the rebuild is fast enough. We measure it regularly for the largest board: for example, 30 million entries, read from the log or database and loaded with pipelined ZADD commands at several hundred thousand per second, rebuild in one to two minutes. That number goes on a dashboard, and an alert fires if it grows past a target such as 10 minutes.
We also run failover drills: kill the primary during a test tournament under realistic load and confirm that the board rebuilds, that no score is lost, and that the close procedure still produces correct standings. The first drill usually finds something, which is exactly why we run it before a real prize is at stake.
7Follow-up questions
Could we just use synchronous replication for the in-memory store?
It reduces loss, but most in-memory stores do not offer strongly consistent failover, and waiting for replicas on every update adds latency. Making the durable log the record and the board a cache is simpler to reason about: we can lose the whole board and still be correct.
What if the durable record itself is missing some results?
Then those matches are genuinely unknown, and we treat them like any disputed match: query the game servers' own logs, and if a result cannot be established, apply the published rule for incomplete matches, for example voiding them. That rule should exist before the tournament, not be invented during the review.
How do we communicate with players who lose a prize after the correction?
Directly and individually, before the public announcement, with their original and corrected placement and the reason. Many companies honour the original prize in such cases, which costs far less than the trust it preserves.
8Conclusion
In this answer, we saw that the tournament standings were wrong because the in-memory board, with an asynchronous replica, was the only source of the final result. We settled it by holding payouts, replaying the durable match results up to the official end into a fresh structure with the same rule code, comparing and publishing corrected results with an explanation. For the future, scores are durable before the board changes, final standings are computed after a grace period and fraud checks while the live board is labelled provisional, and rebuild time and failover are measured and drilled.
Open with
First I would hold all prize payouts and announce a short review with a deadline, because paying out wrong results is much harder to undo than a delay.
Then, if they want more
Then I rebuild the final standings from the durable record, the match results the game servers stored, not from the in-memory board.
I replay every valid result up to the official end time, in order, into a fresh ranking structure using the same ranking code as the live board, compare it with what we published, run the normal fraud checks on the new top finishers, and publish the corrected results with a clear explanation, contacting affected players individually first.
The design lesson is that the in-memory board was treated as the truth. The rule should be that every score event is written to a durable log or database and acknowledged before the board changes, so the board is just a cache we can always rebuild.
Final standings should be a separate step after close: wait a grace period for late results, run fraud checks, then freeze, and label the live board as provisional the whole time.
Finally, I would measure rebuild time for our largest board, so we know thirty million entries take a minute or two and not hours, and run failover drills during test tournaments before money depends on it.
About this answer
- Last updated
- 13 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the official documentation for the version you use. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "How do you settle this tournament fairly, and how should a leaderboard that decides...": https://scrivio-interview-library.netlify.app/architecture/system-design-problems/0aed2d534d/