Leaderboard: your exact rank, live
One strong interview answer to a live game leaderboard: 5 GB that fits one node, why rank is a count that SQL can't afford and a skip-list sorted set can, packing time into scores for ties, match_id dedupe in a Lua script, sharding by player hash, exact ranks at the top and a histogram for the tail, and rebuilding derived data from Kafka and PostgreSQL.
01 · Rank 48,213
IP-14 · Design a Real-Time Leaderboard
Rank 48,213 of 50 million.
Instantly, your new rank
You finish a match, and the game tells you, instantly, that you've climbed to rank 48,213 of 50 million.
0:00 / 13:25