Python data engineering interview problem. Difficulty: intermediate. Pattern: Recursion. About 15 minutes. Part of the Pro drill bank.
A downstream HTTP call flakes. The job retries a few times and then gives up with a defined result, rather than hanging forever.
Retry a flaky operation with a cap and return the first success (or the fallback the tests define).
Input: retry_until_ok(['__fail__', 9]) Output: 9 This input follows the stated rules and produces this output.
Topics: lakebench, python, error-handling.
More Python interview questions · All interview problems · Learn data engineering
Interview-style drill: Write a function that retries a failing operation up to a maximum number of attempts before giving up.
Retry a flaky operation with a cap and return the first success (or the fallback the tests define).