intermediate

Web APIs

Fetch, storage, IndexedDB, service workers, workers, observers, BroadcastChannel, and Web Crypto.

Web API interviews explore how the browser exposes networking, persistence, background work, observation, and cryptography beyond the language core.

Subtopics: Fetch, Web Storage, IndexedDB, service workers, web workers, IntersectionObserver, ResizeObserver, BroadcastChannel, and Web Crypto.

On interviews: compare storage options by sensitivity, when workers help versus hurt, and how observers replace polling.

Common pitfalls: fetch without checking response.ok, tokens in localStorage, and service workers that serve stale deployments.

The trade-off is convenience versus control — pick the mechanism that matches your coupling and performance budget.

Checklist:

  • Match API to lifetime, size, and security needs.
  • Know async boundaries and cancellation.
  • Plan worker and SW lifecycle explicitly.
  • Use observers instead of scroll polling where possible.