Reported November 2025
Benchlingsimulation

Bounded HTTP Retry Flow

Reported by candidates from Benchling's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live Benchling OA. Under 2s to a working solution.
Founder's read

Benchling reportedly served this one in November 2025, and it looks harmless until you realize there's no clever data structure hiding in it. The solution hinges on two plain arrays and an index pointer, each consumed in order like a queue. It's a retry simulation: one POST phase, then one GET phase, each with its own attempt budget. If you've got an OA invite and 48 hours, this is a read-carefully problem, not a think-hard problem. StealthCoder sits invisibly on your screen as a safety net if you blank mid-assessment, but the logic below is short enough to carry in your head.

The problem

For this exercise, assume a client must complete one POST request followed by one GET request over an unreliable connection. Two arrays, postResponses and getResponses, contain the responses that successive attempts would receive for their respective method. Consume each array in order, starting at index zero.
For this exercise, assume a response from 200 through 299 means success. A response of 0 means a transport failure. Retry a transport failure, HTTP 429, or an HTTP response from 500 through 599. Every other response means permanent failure for this exercise.
Each method may make at most maxAttempts attempts, including its initial attempt. Stop that method immediately on success or permanent failure. Running out of recorded responses or attempts before success is failure. Start GET only if POST succeeds, with its own fresh attempt budget. Return true exactly when both methods succeed.
This is a finite response simulation: no network calls, delays, request payloads, or server side effects are modeled. Replaying POST is permitted by this exercise model; the result makes no claim about real POST idempotency.

Function
httpRetryFlow(postResponses: int[], getResponses: int[], maxAttempts: int) → boolean

Examples
Example 1
postResponses = [0,201]
getResponses = [503,200]
maxAttempts = 2
return = true
POST succeeds on its second attempt; GET also succeeds on its second attempt with a fresh budget.
Example 2
postResponses = [400,201]
getResponses = [200]
maxAttempts = 2
return = false
HTTP 400 permanently stops POST. A later recorded success is never consumed, and GET does not start.

Constraints
For this exercise, assume 0 <= postResponses.length, getResponses.length <= 1000.
Each recorded response is 0 or an integer from 100 through 599.
For this exercise, assume 1 <= maxAttempts <= 100.

Reported by candidates. Source: FastPrep

Pattern and pitfall

The trick is to write one helper that runs a single method and call it twice. The helper walks its array from index zero, up to maxAttempts times or until the array runs out. For each response: 200-299 returns true. Codes 0, 429, and 500-599 mean retry, so continue the loop. Anything else returns false right away. If the loop ends without success, return false. Then the main function is just: if the POST helper fails, return false, else return the GET helper result. The common pitfalls are sharing one attempt counter across both methods, consuming a response after a permanent failure (Example 2 tests exactly this), and forgetting that an empty array means failure. Off-by-one on the attempt cap is the other classic miss. The loop bound is min(maxAttempts, length). If the live OA rattles you, StealthCoder can hand you the helper as a hedge, but you should be able to write it cold.

Memorize the pattern. If you can't, run StealthCoder. The proctor sees the IDE. They don't see what's behind it.

If this hits your live OA

You can drill Bounded HTTP Retry Flow cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Made by an engineer who treats the OA as theater. If yours is tonight, you don't have time to grind. You have time to hedge.

Get StealthCoder

Related leaked OAs

⏵ The honest play

You've seen the question. Make sure you actually pass Benchling's OA.

Benchling reuses patterns across OAs. Made by an engineer who treats the OA as theater. If yours is tonight, you don't have time to grind. You have time to hedge. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Bounded HTTP Retry Flow FAQ

How hard is the Benchling Bounded HTTP Retry Flow problem really?+

Easy. There's no advanced algorithm. It's a simulation with a few branching rules. Most failures come from misreading the spec, not from the code. Read the retry and permanent-failure rules twice and you're most of the way there.

What's the trick to this problem?+

Write one helper that processes a single response array with the attempt cap, returning true or false. Call it for POST, and only call it for GET if POST succeeded. Each call gets a fresh budget, so no shared counter.

Which response codes should be retried?+

Retry 0 (transport failure), 429, and anything from 500 through 599. Success is 200 through 299. Everything else, like 400 or 404 or 3xx, is a permanent failure and stops that method immediately without reading further responses.

What edge cases should I test before submitting?+

Empty arrays, since running out of responses counts as failure. Also maxAttempts of 1, a permanent failure before a later success, success exactly on the last allowed attempt, and a POST failure meaning GET never starts even if its array looks fine.

How do I prepare for this in 48 hours?+

Practice simulation problems where you follow rules literally. Write the helper-function version of this once, then test it against both examples by hand. Focus on loop bounds and early returns, since that's where the bugs live.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with Benchling.

OA at Benchling?
Invisible during screen share
Get it