The interview problem
Design a leaderboard with tied scores, late score updates and a season-close deadline that users can audit.
Original practice, not a reported company interview. Scenarios and numbers are illustrative. Interview date: not applicable. Sources retrieved October 1, 2026.
1. Scope and worked approach
Assume authenticated score submissions and a declared scoring rule. Store each player's authoritative score plus version, then maintain an ordered index. Define competition rank, dense rank or deterministic tie-break order explicitly. At season close, freeze an accepted-event cutoff and publish a versioned snapshot; late corrections create a new audited result version rather than silently rewrite prizes. Keep score validation outside the index operation.
2. Trace the design or derivation
Validate score event → update versioned score → maintain order → freeze cutoff → publish season snapshot
Do not reuse one mutable key for every season. Include season and rules version in both score records and index keys. A correction process should state whether only display changes or rewards are reconsidered, with business ownership separate from the technical ability to reorder entries.
3. Calculate the example
Scores 100,100,90 receive competition ranks 1,1,3 but dense ranks 1,1,2. A sorted-set position alone might show 1,2,3, which implements neither tied ranking rule without additional grouping.
4. Failure cases and trade-offs
Clock-based tie breaks reward timing artifacts unless specified. Replayed increments inflate scores unless submissions are deduplicated. Live indexes provide fast reads but need reconciliation with the authoritative ledger; immutable final snapshots simplify audit at the cost of correction workflow.
5. Validation, follow-ups and self-review
Test ties, negative corrections and events crossing the cutoff. Follow-up: how are top-k pages stable during updates? Self-review: define score authority, rank semantics and finalization policy.
Sources and related practice
Technical reference: redis.io — Sorted-set ordering; competition and dense tie policies are application decisions.
Source publication/update: Not established. Retrieved October 1, 2026. The workflow, calculations and review exercises are original; this reference is not evidence that a company asked this question.
Continue with Compute trending items from distributed streams; Design a tamper-evident audit log.
Continue your preparation
Choose a connected learning path or browse more System design questions. Read our editorial method and attribution policy.