Debug an Async Payment Refund Function with Retries, Then Make It Idempotent
Company: Mercor
Role: Software Engineer
Category: Software Engineering Fundamentals
Difficulty: medium
Interview Round: Technical Screen
Overview: Find the defects in a short async Python function that issues a payment refund with up to three attempts and then marks the request done, then explain idempotency and rewrite the function so it is safe to retry and to run more than once. It tests failure-path reasoning, concurrency, error handling and correctness when money moves.
Read the full Mercor Software Engineer interview experience this question came from