Talk me through writing a retry decorator that repeats a function call a given number of times when certain exceptions are raised. How would it be structured, and what pitfalls would you account for?
~4 min by voice
How to approach it
The interviewer wants to see whether you understand how a decorator with parameters is built (closures, three levels of nesting) and whether you can think about reliability: which errors to retry, how not to swallow an exception, how not to overload a service, and what to do about async.
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.