call(back)

Design a Global Multi-Game Leaderboard

Design a leaderboard platform used by many games and modes. Each game keeps its own rankings, players see their standing update immediately after a match, and views are global, per region, per mode, per season, or restricted to friends.

Define the APIs for submitting match results (single or batch), fetching a leaderboard view, and fetching one player's rank. Propose the data model for players, games, matches, ratings and leaderboards. Choose a rating algorithm and justify it. Detail the write path from result ingestion to rank update and the read path for low-latency queries, with caching, sharding by game and region, consistency versus latency for worldwide users, idempotent result submission, anti-cheat, backfill and recalculation (season resets, algorithm changes, bans) and disaster recovery.

Hints

Hint 1

Separate the rating (a per-player number produced by Elo, Glicko-2 or TrueSkill from match results) from the ranking (the position of that number among others); the first is the write path, the second the read path.

Hint 2

A sorted set per (game, mode, season, region) keyed by rating answers top-N, rank-of-player and neighbours in logarithmic time; friends views are a small sort over the viewer's friend list.

Hint 3

Match ids make ingestion idempotent; a replayable log of results makes recalculation a batch job that rebuilds the sorted sets from scratch.

Asked at

Similar Problems5