Lesson 10 of 30
Service Workers are the mechanism that makes offline support technically possible. This lesson is the decision layer above that: what to cache, what to queue, and how to be honest with the user about the connection they actually have.
12 min read
Every option explains itself — why the right one is right, and why each wrong one is wrong. Miss one and it comes back later on a spaced-repetition schedule.
Question 1 of 3
What does this lesson say should be the first move when designing offline support for a feature?
Hints without spoilers, and a plain explanation of why a wrong answer was wrong — answered only from this lesson. Free account, no card.
Sign up freeWhat interviewers actually ask about this, and what a strong answer has to cover.
A strong answer covers
Likely follow-ups
The mechanism for offline support — a Service Worker intercepting requests and serving cached responses — is covered elsewhere in this platform, and this lesson assumes it as a given tool, not something to re-derive. The system design question is different: given that the mechanism exists, what do you actually design with it? Three decisions do most of the work:
Say a user types a message while their connection drops. A shallow design either blocks sending entirely (a hard failure that loses the user's intent) or silently pretends it sent (which breaks the moment the message never actually arrives and the user has no idea why). The stronger design: the message appears immediately in the thread with a visible "sending…" state, gets added to a local outbox, and the outbox replays it as soon as connectivity returns — at which point the state updates to "sent" or, if it genuinely fails, to a clear "failed to send, tap to retry."
"How would you make this feature work on a flaky connection?" tests whether a candidate reaches for scoping, an outbox pattern, and honest connectivity signaling as deliberate design decisions, rather than treating "add a Service Worker" as a complete answer on its own.