The interview problem

Practice prompt

A customer integration intermittently loses access after concurrent jobs refresh the same credential. Diagnose and redesign the workflow.

Original practice, not a reported company interview. Scenarios and numbers are illustrative. Interview date: not applicable. Sources retrieved October 1, 2026.

1. Scope and worked approach

Assume the provider rotates refresh tokens and documents its reuse behavior. Reconstruct refresh attempts using redacted credential-version IDs, never token values. Assign one refresh owner per customer credential and persist the new token pair atomically with a version check. Jobs obtain a current access token through this owner; a failed stale refresher must not overwrite newer credentials. Agree with the customer on an explicit reauthorization path when state becomes irrecoverable.

2. Trace the design or derivation

Trace credential versions
  → serialize refresh
  → persist rotated pair
  → reconcile ambiguity
  → reauthorize if needed

The reviewable customer artifact is a refresh-state timeline with operation IDs, versions and outcomes, not token contents. Identify whether a provider offers token-reuse grace or a recovery endpoint before choosing a retry policy. Acceptance requires a controlled concurrent-job test that survives one intentionally lost refresh response.

3. Calculate the example

Two jobs read credential version 7. Job A rotates and saves version 8; job B then tries the old refresh token. If B overwrites storage with its stale state, a successful refresh is lost. A compare-and-set against version 7 prevents that overwrite.

4. Failure cases and trade-offs

Provider grace periods and rotation semantics vary. A lock alone is insufficient if the process dies between provider rotation and local persistence. Retrying blindly can invalidate a token family. Serialization reduces concurrency but only for the refresh operation, not all customer work.

5. Validation, follow-ups and self-review

Use a provider sandbox to test concurrent refresh, timeout-after-success and reauthorization. Follow-up: how would you recover from an ambiguous refresh response? Self-review: explain ownership, atomic persistence and customer-visible recovery without logging secrets.

Sources and related practice

Technical reference: www.rfc-editor.org — Refresh-token rotation and replay protection; local persistence protocol is original.

Source publication/update: January 2025. Retrieved October 1, 2026. The workflow, calculations and review exercises are original; this reference is not evidence that a company asked this question.

Continue with Rotate a customer integration credential without downtime; Integrate an AI workflow with an unreliable legacy API.

Continue your preparation

Choose a connected learning path or browse more FDE interviews questions. Read our editorial method and attribution policy.