SSnowflake·DSASDE-2Onsite – Coding 1
Design a Thread-Safe Concurrent LRU Cache
Problem
Implement an LRU cache that is correct under concurrent get/put from many threads (Snowflake's concurrency round).
Example
Multiple threads; O(1) ops; no races
Constraints
- High contention
Discussion
Lock striping/sharding vs a single lock; trade-offs vs a lock-free design. Snowflake prefers correct-and-reasoned over clever-but-fragile.
added 6 days ago