Code Room
CodingMediumcod-g1141
Subject Networking protocolsLevel Mid–Senior~20 minCommon in Networking & APIs interviewsIndustries Software development, Telecom

Question

Compute a deterministic exponential-backoff-with-jitter schedule for a retry client. For attempt k (0-indexed) the uncapped delay is base*2**k, capped at cap, giving exp = min(cap, base*2**k). Jitter is full-jitter in [0, exp] derived from a deterministic LCG: starting from the given integer seed, before each attempt update state = (1103515245*state + 12345) % 2147483648, then the jittered delay is state % (exp + 1). Return the list of jittered delays for attempts 0..attempts-1. base, cap, seed are positive ints; attempts >= 0.

Implement
backoff_schedule(base: int, cap: int, attempts: int, seed: int) → list[int]
Examples
in[100,1000,3,42]out[79,122,100]
What a strong answer looks like

State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.

Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.

Run or narrate your approach, then ask the coach.