System Design Problem

Design a Distributed Cache (Redis / Memcached)

Commonly Asked By:TwitterMetaRedisLabsAmazon

  • PUT(key, value, TTL): Store a key-value pair with optional time-to-live
  • GET(key) → value: Retrieve value by key; return null if not found or expired
  • DELETE(key): Remove a key-value pair
  • Support eviction policies: LRU, LFU, FIFO, Random
  • Support data structures beyond strings: hashes, lists, sets, sorted sets (Redis-like)
  • Support TTL/expiry on keys
  • Support atomic operations: increment, compare-and-swap
  • Distributed across multiple nodes for scalability and availability
Loading...