Redis easy
What is the defining characteristic of a Redis 'Set' data type compared to a standard Redis 'List'?
- A Sets preserve the precise chronological order of elements as they were originally inserted.
- B Sets store only unique, unordered strings and prevent the addition of duplicate items.
- C Sets are fixed-length arrays that cannot grow beyond a predefined number of allocated keys.
- D Sets automatically sort every member by its associated floating-point priority score value.
Answer: B. Sets store only unique, unordered strings and prevent the addition of duplicate items.
Sets are perfect for 'Unique Count' or 'Tagging' systems. If you add 'tag:blue' twice, the second operation does nothing. Redis also provides highly efficient set operations like Intersections (common tags).
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- If the Redis memory limit is reached, what specific behavior is exhibited by the `allkeys-lru` eviction policy?
- In the context of Redis messaging, what is the functional definition of the 'Pub/Sub' feature?
- How does the Redis background snapshotting process (`BGSAVE`) leverage the operating system's `fork()` mechanism to minimize memory overhead?
- Why does Redis proactively disconnect a Pub/Sub client that exhibits high 'output buffer' usage relative to its ingestion rate?
- How does a 'Sorted Set' (ZSET) manage its internal membership and ordering differently from a plain Set?
- Which basic Redis command is used to store or update a simple String value associated with a specific key?