Ctrl K
Backend · Mid-level · Coding

Write a retry function that takes an async operation, a maximum number of attempts, and a base delay. It calls the operation, and on failure retries it with an exponentially growing pause and random jitter; if all attempts are exhausted, it returns the last error.

~15 min by voice

How to approach it

The interviewer wants to see whether you can carefully write a retry loop with exact boundaries: exactly N attempts, an immediate return on success, exponential backoff with jitter and a cap, no pause after the last failure, and returning specifically the last error. They also look at whether you clarify the requirements and understand why jitter is needed.

Have you seen this question in a real interview?
Answers0
Avg. score—
Strong—
Practiced0
Topics

Answer by voice

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.

Sign in to answer

Best with headphones · ~15 min