3-6y

Browser Storage, Caching, and Networking

Browsers can remember data in different places. Each option has a purpose, a size limit, and a security or lifetime tradeoff.

Analogy

Think of browser storage like school storage spaces: a desk drawer for this class, a locker for your own items, and an office register for things that must travel with every form.

Follow-up questions

Topic practice prompts

What is the difference between localStorage, sessionStorage, and cookies?

localStorage is persistent and browser-side, sessionStorage is tab-scoped, and cookies are small values sent with matching HTTP requests.

  • Why is localStorage risky for sensitive data?
  • When would cookies be preferable?
How do browser caching and stale data affect frontend design?

Caching can make apps feel fast, but the UI must still handle old data, refresh timing, and clear signals about what is fresh or stale.

  • What is stale-while-revalidate in simple words?
  • How would you show stale state in the UI?
Cheat sheet

Last-day revision lines

  • localStorage is persistent but synchronous.
  • sessionStorage is per-tab.
  • Cookies travel with requests.
  • Cache rules shape perceived speed.
Source references
  • JS interview preparation: context/JS Interview Preparation Questions.docx
  • Web performance and security: context/Web perfomance and security.docx
Offline study support

Local resource packs for this topic

1 local packs

Use these local packs when you want broader official-source context without leaving the app.

javascriptRuntime, closures, and async behavior

JavaScript Runtime and Closures

A local offline guide to the JavaScript runtime ideas interviewers repeatedly use for JS and browser rounds.

JavaScriptBrowser and DOM

Closures, lexical scope, event loop, microtasks, timers, promise ordering, and DOM callback behavior.

Open local study pack
Next step

Related topics to study after this one

Performance and Security3-6y

Frontend Security, Auth, and Trust Boundaries

Explain XSS, CSRF, token storage, CSP, sanitization, and what frontend can and cannot guarantee.

Simple mode, interview mode, example, pitfalls, and follow-ups are all inside this topic.

securityxsscsrftokens
Study topic
Frontend System Design3-6y

Realtime Dashboards and Resilient Data Flow

Prepare for questions about polling, websockets, partial failure, stale data, and resilient UI updates.

Simple mode, interview mode, example, pitfalls, and follow-ups are all inside this topic.

system-designrealtimedashboardpolling
Study topic
Performance and Security3-6y

Loading Strategy, Caching, and Core Web Vitals

Answer LCP, CLS, INP, image strategy, caching, and bundle questions with product-level clarity.

Simple mode, interview mode, example, pitfalls, and follow-ups are all inside this topic.

performancecore-web-vitalscachingloading
Study topic