Q9 Redis Domain 2 · 25–30% of exam

Which Redis data structure is optimal for implementing a leaderboard sorted by score?

  1. A String
  2. B Hash
  3. C List
  4. D Sorted Set (ZSET) (correct answer)

Shortcut: Sorted Sets store members with a floating-point score, sorted by score automatically. ZADD, ZRANK, ZRANGE enable efficient leaderboard operations (add score, get rank, list top N).