Retry Webhook Deliveries With Exponential Backoff and Jitter
Last updated: November 29, 2026
Quick Overview
Asana sends webhook events to third-party endpoints that are sometimes slow or down. Implement a delivery function that retries the right failures with capped exponential backoff and jitter and gives up cleanly.
Asana
November 29, 20260
0
0 solved
Asana sends webhook events to third-party endpoints that are sometimes slow or down. Implement a delivery function that retries the right failures with capped exponential backoff and jitter and gives up cleanly.
Integrations are a big part of Asana's ecosystem (Slack, Salesforce, custom apps on the API), and webhooks are how those apps learn about task changes. The interviewer checks networking basics: which HTTP failures are transient, why synchronized retries cause thundering herds, and how to respect a receiver's Retry-After.
What the Interviewer Expects
- Distinguishes retryable statuses (429, 5xx, timeouts, connection resets) from permanent ones (400, 401, 404, 410)
- Implements exponential backoff with a cap and full jitter
- Honors Retry-After when present
- Injects sleep and randomness so the function is testable
- Explains at-least-once delivery and why receivers need to dedupe
Key Topics to Cover
How to Approach This
- Apply SOLID principles. Single Responsibility makes code testable, Open/Closed makes it extensible.
- Choose data structures based on access patterns, not familiarity.
- Prefer immutable data and message passing over shared mutable state for concurrency.
- Design APIs with RESTful conventions, versioning, meaningful errors, and pagination from day one.
Possible Follow-up Questions
- Where does this retry loop run so a deploy does not lose pending retries?
- When should Asana stop delivering to an endpoint altogether?
- How do you keep event order for one resource when retries are in flight?
- What timeouts would you set on the HTTP call itself?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
Deliver one event to one endpoint. Success is any 2xx. Retry transient failures up to a maximum number of attempts with growing delays, never retry permanent client errors, and report the final outcom...
High-Level Design
Delay for attempt k is a uniform random value in [0, min(cap, base * 2^k)] (full jitter), so thousands of failing deliveries to a recovering receiver spread out instead of arriving in waves. If the ...