Which Redis data structure is optimal for implementing a leaderboard sorted by score?
- A String
- B Hash
- C List
- 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).