All Questions
Redis medium

Which data structure is most appropriate for approximating the unique visitor count of 100 million users while consuming only 12KB of RAM?

  1. A Set: Storing explicit user IDs to ensure 100% accuracy for membership and intersection queries.
  2. B HyperLogLog: An probabilistic structure that estimates cardinality with a standard error of 0.81%.
  3. C Hash: Mapping unique user handles to their respective visit counts for detailed analytical tracking.
  4. D List: Appending every raw visit event as a unique string element to preserve chronological history.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions