How would you write a decorator with parameters, for example a retry with a configurable number of attempts? What are the pitfalls of decorators in production code?
~4 min by voice
How to approach it
They're checking whether you understand how closures and decorators work in Python. It's not enough to write a three-level factory; you need to know the production pitfalls: execution at import time, async functions, typing, and the danger of retry for non-idempotent operations.
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.