Real-time game leaderboard
Your task
Design a real-time global leaderboard for a competitive game with 80M monthly players: scores update constantly during matches, players want their exact rank and the top-100 to refresh within ~1s, and you also need 'players near my rank' and weekly/seasonal resets. Walk through the data structures and how you keep rank queries fast at this scale.
It covers
- Leaderboard
- Sorted set
- Approximation