Add Safe Retries With Backoff to Bank Feed HTTP Calls

Last updated: November 29, 2026

Quick Overview

Ramp polls partner banks for balances and posts payment instructions over HTTP. Write the retry wrapper: which failures to retry, how long to wait, how to honor Retry-After, and when a retry is unsafe.

Ramp
Software Engineering Fundamentals
Software Engineer
Ramp
November 29, 2026
Software Engineer
Phone Screen
Software Engineering Fundamentals
Easy

0

0

0 solved


Ramp polls partner banks for balances and posts payment instructions over HTTP. Write the retry wrapper: which failures to retry, how long to wait, how to honor Retry-After, and when a retry is unsafe.

Bill pay and cash management at Ramp depend on bank and payment-rail APIs that time out, rate limit and return 503s under load. The interviewer is checking networking basics: what a timeout does and does not tell you, which status codes are transient, why jitter matters, and why a POST without an idempotency key must not be blindly retried.

What the Interviewer Expects
  • Distinguishes retryable failures (timeouts, connection resets, 429, 5xx gateway errors) from permanent 4xx errors
  • Uses exponential backoff with full jitter and a cap
  • Honors a numeric `Retry-After` header
  • Only retries GETs or writes protected by an idempotency key
  • Makes sleep and randomness injectable so tests run instantly
Key Topics to Cover
Exponential backoff
Jitter
HTTP status codes
Timeouts
Idempotent requests
How to Approach This
  1. Apply SOLID principles. Single Responsibility makes code testable, Open/Closed makes it extensible.
  2. Choose data structures based on access patterns, not familiarity.
  3. Prefer immutable data and message passing over shared mutable state for concurrency.
  4. Design APIs with RESTful conventions, versioning, meaningful errors, and pagination from day one.
Possible Follow-up Questions
  • A payment POST timed out with no response. Did the payment happen, and how do you find out?
  • How would you add a total deadline across all attempts?
  • What is a circuit breaker and when would you add one here?
  • How does `Retry-After` in HTTP-date format change the parser?
Sharpen Your Skills on Codemia

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

Practice System Design Problems
Sample Answer
Requirements

send(request) returns (status, headers, body) or raises a connection or timeout error. Retry transient failures up to max_attempts, wait with capped exponential backoff, and respect `Retry-After...

High-Level Design

A timeout means 'unknown', not 'failed': the bank may have executed the transfer. That is why the wrapper refuses to retry a POST unless it carries an Idempotency-Key the bank deduplicates on. For s...


Submit Your Answer
Markdown supported