Explain Redis design, persistence, and scaling
Company: TikTok
Role: Software Engineer
Category: System Design
Difficulty: hard
Interview Round: Technical Screen
Explain Redis core data structures (strings, lists, sets, sorted sets, hashes, streams) and typical time/space characteristics. Compare RDB and AOF persistence, including durability, performance, and recovery trade-offs. Describe eviction policies and TTL behavior under memory pressure. Explain replication, Sentinel failover, and Cluster sharding. Discuss transactions, Lua scripting, and pitfalls of distributed locks (e.g., clock skew, fencing tokens). Outline strategies to prevent cache stampede and handle hotspot keys.
Quick Answer: This question evaluates understanding of Redis internals and operational trade-offs across core data structures, persistence options, memory eviction, high availability and sharding, transactions and scripting, distributed locking, and large-scale cache reliability.