Implement a Thread-Safe Singleton / Bounded Cache
Problem
Implement a thread-safe lazily-initialized singleton, then a thread-safe bounded LRU cache.
Example
Double-checked locking or static init; LRU with a lock
Constraints
- Correct under concurrency
What evaluators look for
Correct synchronization and reasoning about memory visibility.
added …