Design leaderboard and messenger systems
Company: Meta
Role: Software Engineer
Category: System Design
Difficulty: hard
Interview Round: Onsite
Design two systems: A) Leaderboard service for a large-scale game: compute a user’s global rank and their rank within their friendship circle; retrieve the k users immediately before and after a given user both globally and within the friend circle; handle high write rates, pagination windows, anti-cheat, seasonal resets, and multi-game modes. Detail APIs, data models (e.g., sorted sets and secondary indexes), sharding/partitioning, caching, consistency, ranking computation, friend-graph integration, and backfill/batch workflows. B) Real-time messenger application: support 1:1 and group chat, message ordering, delivery guarantees (at-least/at-most/exactly-once—choose and justify), online presence, typing/read receipts, media sharing, push notifications, end-to-end encryption, offline sync, fanout for large groups, spam/abuse controls, and disaster recovery. Provide an end-to-end architecture, storage choices, protocols, scale estimates, and operational considerations.
Quick Answer: This question evaluates system design and distributed-systems competencies—including scalability, data modeling, consistency, real-time messaging guarantees, security, and operational resilience—and is in the System Design domain.