System design interview question
Design a Real-Time Gaming Leaderboard
A real-time gaming leaderboard must update player scores as the game is played, answer "what is my rank?" and "show me the top 100" in milliseconds, support multiple time windows (daily, weekly, all-time), and handle scenarios from a casual indie game (100 K players) to a global hit (100 M players, 1 M score updates/sec). The natural implementation uses Redis sorted sets — but a single ZSET can't hold 100 M members efficiently, can't shard, and can't serve all the variations (friends-only, country-only, top-K-near-me). The design layers a sharded score storage, in-memory ranking trees, periodic reconciliation, and pre-computed slices to make each lookup O(log N) or better.
Practice this question step by step with an AI interviewer that reviews your requirements, your architecture and your trade-offs, and scores the design.