Which data structure best fits a leaderboard requiring ranked retrieval by score?
- A Hash
- B Sorted Set (ZSET) (correct answer)
- C List
- D Set
Shortcut: Sorted sets maintain members ordered by score, supporting ZRANGE, ZREVRANK, and range queries in logarithmic time, which is exactly the leaderboard access pattern.