Beginner50 min

Real-Time Leaderboard

Leaderboards appear everywhere — gaming platforms, sales dashboards, competitive coding sites — and they present a deceptively complex scaling challenge. A naive approach using SQL ORDER BY collapses under millions of concurrent score updates. In this challenge, you will design a real-time leaderboard that supports instant rank queries, score updates, and paginated browsing for millions of entries. You will implement a sorted set architecture using Amazon ElastiCache for Redis, which provides O(log N) rank lookups via ZRANGEBYSCORE and ZRANK commands. The design includes a write-behind pattern where score updates hit Redis first for speed, then asynchronously persist to DynamoDB for durability. You will handle edge cases like tie-breaking strategies, regional leaderboards using partition keys, and time-windowed leaderboards (daily, weekly, all-time) using separate sorted sets with Lambda-based rotation. The architecture also covers fan-out for real-time WebSocket notifications when players enter the top 100, using API Gateway WebSocket APIs and SNS for pub/sub distribution. This challenge teaches sorted data structures at scale, write-behind caching, and event-driven notification patterns.

AWS Services You'll Use

ElastiCacheDynamoDBLambdaAPI GatewaySNS

Challenge Details

Path
System Design Fundamentals
Difficulty
Beginner
Duration
50 min
Plan
Starter

Architecture Patterns You'll Learn

sorted setwrite-behind cachefan-outpub/subtime-windowed aggregation

Why This Challenge?

Unlike whiteboard exercises or multiple-choice quizzes, this challenge requires you to design a real architecture with actual AWS services, evaluate trade-offs, and defend your decisions. Our automated validators check your design against production-grade criteria. Complete it and it shows up in your verified portfolio with your architecture diagram and design rationale.

Ready to design this for real?

Get the full scenario, design your architecture using real AWS services, and validate against production-grade criteria. Your completed challenge shows up in your verified portfolio.

Start Challenge