Compute the Retry Schedule for a Failing Webhook Endpoint

Last updated: November 29, 2026

Quick Overview

Given the time of the first delivery attempt and the HTTP results of successive attempts to a developer's webhook endpoint, return the attempt times, the final outcome (delivered, failed permanently, gave up, or pending) and the next scheduled attempt using capped exponential backoff within a 24 hour window.

Bridge
Coding & Algorithms
Software Engineer
Bridge
November 29, 2026
Software Engineer
Phone Screen
Coding & Algorithms
Easy

0

0

0 solved


Given the time of the first delivery attempt and the HTTP results of successive attempts to a developer's webhook endpoint, return the attempt times, the final outcome (delivered, failed permanently, gave up, or pending) and the next scheduled attempt using capped exponential backoff within a 24 hour window.

Bridge notifies developers about transfer, customer and KYC status changes through webhooks, and partner endpoints fail often. A short phone-screen problem like this checks careful loop logic, sensible classification of HTTP responses, and attention to off-by-one boundaries on the retry window.

What the Interviewer Expects
  • Implement capped exponential backoff correctly (30s, 60s, 120s, up to 1h)
  • Classify responses: 2xx success, most 4xx permanent, 5xx and timeouts retryable
  • Keep 408 and 429 retryable
  • Stop when the next attempt would fall outside the 24 hour window
  • Return a pending next attempt when results run out
Key Topics to Cover
exponential backoff
HTTP semantics
webhooks
boundary conditions
retry policy
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • Why add jitter, and how would you add it without breaking tests?
  • Should a 410 Gone disable the endpoint entirely?
  • How would you let developers replay events that gave up?
  • How do you keep one slow endpoint from delaying deliveries to every other customer?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice DSA Problems
Sample Answer
Requirements

Attempt n (0-based) that fails schedules the next attempt after min(3600, 30 * 2^n) seconds. A None status means a timeout. Give up once the next attempt would land more than 24 hours after the fi...

High-Level Design

Walk the status list, recording each attempt time. Success ends the loop. A client error other than 408 (timeout), 409, 425 or 429 (rate limited) means the endpoint rejected the payload on purpose, so...


Submit Your Answer
Markdown supported

Related Questions