Build Redis-Style Key Expiry
lazy plus sampled active expiry
Challenge 3 of Storage & CachingIntermediate~50 min
Expire keys proactively. Build lazy expiry on read, then a Redis-style active sweeper that randomly samples keys with a TTL, instead of a timer per key, and bound its work so it never blocks.