Code Room
Code reviewHard
Question
Review this Java memoizing cache built on ConcurrentHashMap.
What a strong answer looks like
Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix — specific and kind.
Learn the concepts
private final ConcurrentHashMap<Key, Value> cache = new ConcurrentHashMap<>(); public Value get(Key k) { if (cache.containsKey(k)) { return cache.get(k); } Value v = expensiveCompute(k); cache.put(k, v); return v;}Run or narrate your approach, then ask the coach.