All jobs / Mobile developer / Networking
Mobile developer interview question · 5+ years
The API was down for ten minutes. It fell over again the moment it returned, and the traffic was the app retrying.
What do you change in the client?
The strongest answer
Back off exponentially with jitter so phones do not return in step, cap the attempts, honour a Retry-After when the server sends one, and do not retry what cannot succeed, such as a 400 or a 403
Why it works
Right — jitter is the part people forget, and it is what breaks the synchronised wave the outage created.
What a good answer covers
- Never come back in step.
- Exponential backoff with jitter.
- Cap attempts; honour Retry-After.
- Do not retry what cannot succeed.
Answers that fall short
- Close, but not the strongest: Add exponential backoff to the retry loop so the gaps grow
Backoff without jitter still leaves every device aligned to the same clock; they come back together just later. - Weak: Retry less often — every thirty seconds instead of every five
A slower fixed interval is still a fixed interval: the whole install base is in lockstep either way. - Red flag: Keep retrying until it works; the request matters, and the backend should be able to take the load
A client that never gives up turns a ten-minute outage into an hour-long one and takes recovery out of the backend’s hands.
Who gets asked this
More Networking questions
- The backend adds a field to a response and the shipped app starts failing to parse it. What should the client…
- A feed can be tens of thousands of items. How do you load it?
- A notes app edits offline and later meets a server that also changed. What do you do?
- How do you avoid re-downloading a list that rarely changes, without showing stale data for ever?
- You are choosing how a field-sales app syncs. What do you put in the design doc?
- On launch the app fires six requests at once. The access token has expired, and some users end up logged out…
- Three apps will all work offline. What do you standardise?