Networking·Intermediate·Conceptual·1 min read
How should a data layer handle retries?
Short interview answer
Retry transient failures (network errors, 5xx) with backoff and a cap, don't retry client errors (4xx) that will fail again, and make retries cancelable so navigating away stops them. Centralizing this beats each call site inventing its own retry logic.
Key takeaway
Explain the underlying mental model clearly, then support it with a concrete example and its trade-offs.