DevPrep

All topics › Real interview tasks

One-shot token refresh under concurrent requests

Senior PRO

Task

Ten requests get a 401 at the same time. The token must be refreshed once, not ten times, and all ten must wait for the new token and retry.

The rest of this answer, with code and interview follow-ups, is in the DevPrep app.

Read the full answer in DevPrep

Practice this before your interview

DevPrep turns these answers into one-minute challenges: what does this code print, find the bug, mock interviews. One challenge a day.

Get DevPrep on the App Store