Learn Labs
Data Structures

Self-test

Check your understanding

Self-test11 questions

—/11
  1. What does a plain SET do to an existing TTL, and why does that matter under volatile-* eviction?

  2. Why is INCR safe with 100 concurrent clients when read-then-write in the app isn't?

  3. When would you store an object as a hash, a JSON string, or a native JSON document?

  4. Why does a small hash use less memory than the same fields stored as separate keys? What's the catch with raising the listpack threshold?

  5. Why is plain BRPOP an unreliable job queue? What fixes it?

  6. How does a sorted set make ZRANK O(log N)? Name its two internal structures.

  7. How are ties in a sorted-set leaderboard ordered, and how would you make earlier scores win?

  8. A HyperLogLog counts 1 billion unique visitors. How much memory, and what can't it do?

  9. What does a Bloom filter guarantee, and what doesn't it? Give a good and a bad use.

  10. Why does MEMORY USAGE report far more bytes than the value you stored?

  11. Design question

    Model an e-commerce product catalog in Redis: products, categories, price filters, best-sellers, and "recently viewed" per user. Name the type and key for each.