Scale the cache to a distributed system
DoorDashSoftware Engineer · Technical ScreenLast updated
This question evaluates a candidate's ability to design and scale a distributed caching system, testing competencies in sharding and consistent hashing, replication and consistency models, request routing, failure detection, cache invalidation, capacity planning, and operational trade-offs for high-throughput, low-latency workloads.
Scale your LRU cache to a distributed cache. Describe how you would shard keys across nodes using consistent hashing with virtual nodes, how rebalancing works during node joins/leaves, and how you would mitigate hot keys. Specify replication strategy, failure detection, request routing, and read/write paths. Discuss cache consistency (TTL, write-through/back, invalidation), fault tolerance under partitions, and monitoring/capacity planning. Provide trade-offs and expected performance.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.