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: Explain Redis design, persistence, and scaling evaluates requirements, scale assumptions, API/data design, architecture, trade-offs, failure modes, and rollout in a realistic interview setting. A strong answer states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.