When do you use functools.lru_cache, and what problems can you run into with it?
~4 min by voice
How to approach it
They're checking whether you understand how memoization in lru_cache works (a key built from the arguments, LRU eviction) and whether you see the real pitfalls: hashability, leaks on methods, a shared mutable result, and the limits of an in-process cache.
The interviewer will ask this question and listen. Think out loud and ask for a hint if you need one. When you're done, pause or tap “That's my answer”. In about a minute, your score and the points you covered show up here.