Last Minute Notes

Frontend System Design Interview Playbook

Frontend system design interview rehearsal: what each level is expected to know, a 60-question bank with strong-answer checklists, a mock 45 minute walkthrough, 30 design prompts with key points, diagnose-the-problem scenarios, cheat sheets, common mistakes, and a 7-day study plan.

📘 Frontend System Design Interview Playbook

The other pages teach the material. This page is for rehearsal: what interviewers expect by level, a question bank with what a strong answer contains, a full mock walkthrough, a list of design prompts with the points to hit, production scenarios, cheat sheets, and a study plan.

Table of Contents

  1. What Interviewers Look For
  2. Question Bank
  3. Mock Walkthrough: Design an Image Sharing Feed
  4. Design Prompts
  5. Diagnose the Problem
  6. Cheat Sheets
  7. Common Mistakes
  8. Study Plan

1. What Interviewers Look For

LevelExpected
Junior and early midComponent thinking, state and props, basic data fetching, loading and error states, responsive layout, basic performance (lazy loading, memoization), accessibility basics
MidRendering strategies, server vs client state, pagination, optimistic updates, caching, Core Web Vitals and fixes, keyboard accessibility, testing approach, reasonable API design
SeniorWhole system trade-offs, real-time and offline design, performance budgets and measurement, security model, observability, release safety, design system and module boundaries, driving the discussion
Staff and principalMulti team architecture (monorepo, micro-frontends, platform), migrations and governance, org level performance and quality programs, cost and risk trade-offs, mentoring through the design

Signals that raise your rating:

  • You clarify requirements and state assumptions before designing.
  • You structure the answer (RADIO) and keep time for optimizations.
  • You quantify: bytes, request counts, DOM nodes, frame budget, p75 targets.
  • You name trade-offs and alternatives, and say when you would choose the other one.
  • You cover non-happy paths: loading, empty, error, offline, race conditions.
  • You bring up accessibility, security, and observability without being asked.
  • You say how you would measure and verify the result (RUM, budgets, canary).
  • You stay pragmatic: simplest architecture that meets the requirements.

2. Question Bank

2.1 Framework and Architecture (10)

#QuestionStrong answer includesRead
1How do you approach a frontend system design problem?RADIO, requirements first, diagram, depth on the hard part, optimizationsFundamentals
2SPA vs MPA vs SSR app?SEO, interactivity, first paint, cost, complexity, mixed per routeRendering
3How do you decide where state lives?Derive, local, lift, URL, server cache, small global storeState
4How do you structure a large React codebase?Feature modules, shared layer, public APIs, enforced boundariesArchitecture
5What makes a good component API?Composition, controlled and uncontrolled, defaults, a11y, stable eventsFundamentals
6Monorepo vs polyrepo?Atomic changes, shared tooling, caching, affected builds, ownershipArchitecture
7When do you use micro-frontends?Many teams, independent deploys, costs, alternatives, composition optionsArchitecture
8How do you build and govern a design system?Tokens, headless primitives, docs, versioning, codemods, adoptionArchitecture
9How do you use feature flags safely?Decouple deploy and release, stable bucketing, cleanup, no flickerArchitecture
10How do you migrate a legacy frontend?Strangler pattern, route level, shared auth and design system, retire dateArchitecture

2.2 Rendering and Delivery (10)

#QuestionStrong answer includesRead
11CSR vs SSR vs SSG vs ISR?Where and when HTML is built, SEO, freshness, costRendering
12What is hydration and why is it costly?Re-run components, interactivity delay, reduce JS, islands, RSCRendering
13RSC vs SSR?Different problems, zero client JS for server components, used togetherRendering
14How does streaming help?Shell first, Suspense boundaries, independent slow partsRendering
15How do you cache a SPA at the CDN?Hashed assets immutable, HTML revalidated, API policies, keep old assetsRendering
16What is critical rendering path?HTML, CSS blocking, JS parser blocking, defer, preload scannerRendering
17preload vs prefetch vs preconnect?Now vs next navigation vs connection warmup, over-preloading riskRendering
18How do you make navigations instant?Prefetch on intent, speculation rules, transitions, skeletonsRendering
19How do you handle SEO in a JavaScript app?SSR or SSG, meaningful HTML, metadata, real links, status codesRendering
20What breaks when you cache HTML at the CDN?Personalization leaks, stale prices, query string fragmentation, purgeRendering

2.3 Performance (10)

#QuestionStrong answer includesRead
21What are Core Web Vitals?LCP, INP, CLS, thresholds, p75 field dataPerformance
22How do you improve LCP?Four part breakdown, discoverable and prioritized resource, format, TTFBPerformance
23How do you improve INP?Long tasks, yielding, render scope, transitions, workers, third partiesPerformance
24How do you avoid CLS?Reserved space, font metrics, no late inserts, transformsPerformance
25How do you reduce a huge bundle?Analyze, split, replace libraries, server components, budgetsPerformance
26How do you render a huge list?Pagination, virtualization, content-visibility, measured heights, a11yPerformance
27Lab vs field data?Lighthouse vs RUM and CrUX, percentiles, diagnose vs decidePerformance
28How do you handle third-party scripts?Inventory, defer, facades, isolate, monitor, removePerformance
29How do you find a memory leak?Heap snapshots, detached nodes, listeners, caches, cleanupPerformance
30How do you enforce performance over time?Budgets in CI, RUM alerts, canary compare, ownershipPerformance

2.4 State, Data, Real-Time, and Offline (15)

#QuestionStrong answer includesRead
31Server state vs client state?Cache of remote data vs owned UI state, tools, mixing problemsState
32Explain stale-while-revalidateInstant stale render, background refetch, update, staleness windowState
33Optimistic updates: how and when?Snapshot, apply, request, rollback, cancel refetch, avoid for paymentsState
34Cursor vs offset pagination?Stability, performance, random access, infinite scrollState
35When normalize a client cache?Many views per entity, instant consistency, complexity costState
36How do you fix fetch race conditions?Abort, latest id wins, query keys, cancel before optimistic writeState
37How do you design token refresh?Single flight, retry once, rotate, logout on failureState
38Polling vs SSE vs WebSocket?Direction, latency, complexity, infra, fallbacksReal-Time
39How do you make a socket client reliable?Heartbeat, backoff with jitter, resume, dedupe, snapshot plus deltasReal-Time
40How do you avoid missing events at startup?Subscribe, buffer, snapshot version, apply newer buffered eventsReal-Time
41How do you handle 500 updates per second?Server aggregation, batching, coalescing, bounded buffers, workersReal-Time
42How do you build offline support?Service worker, local DB, outbox, sync cursor, conflict policy, status UIOffline
43Service worker caching strategies?Cache first, network first, SWR, per resource choices, pitfallsOffline
44LWW vs OT vs CRDT?Simplicity vs intent preservation vs convergence, costsOffline
45How do you share one connection across tabs?SharedWorker or leader election with Web Locks, BroadcastChannelReal-Time

2.5 Security, Accessibility, i18n, and Operations (15)

#QuestionStrong answer includesRead
46How do you prevent XSS?Escaping, sanitize, avoid raw HTML, CSP nonce, Trusted TypesSecurity
47Where do you store tokens?HttpOnly SameSite cookie, memory plus refresh cookie, not localStorageSecurity
48CSRF defense?SameSite, tokens, Origin check, custom headersSecurity
49What does CORS protect?Browser reads only, not the API, credentials rulesSecurity
50OAuth for a SPA?Code flow with PKCE, state and nonce, no secrets in bundle, BFF optionSecurity
51Accessibility checklist?Semantics, keyboard, focus, names, contrast, live regions, testingAccessibility
52Make a modal or combobox accessibleNative dialog or ARIA pattern, focus trap and return, keysAccessibility
53How do you do i18n well?ICU messages, Intl, RTL logical CSS, expansion, locale loadingi18n
54What is your testing strategy?Trophy, behavior tests, MSW, few E2E, visual and a11y, budgetsTesting
55How do you reduce flaky tests?Auto wait, isolation, mocks, stable selectors, prod buildTesting
56What do you monitor in production?Vitals, errors, API client metrics, funnels, release tags, tracesObservability
57How do you release safely?Previews, flags, canary, rollback, version skew handlingRelease
58What is version skew?Old client vs new server or assets, hashed assets, additive APIsRelease
59How do you debug "the site is slow for some users"?Field data segmentation, device, geo, release, RUM tracesPerformance
60How do you handle consent and privacy?Consent gating, minimization, masking, partitioned storageSecurity

3. Mock Walkthrough: Design an Image Sharing Feed

A compact model answer for "design the web feed for an image sharing app" (45 minutes).

Requirements (5 min). I will ask: public or logged in only, SEO needed for post pages, mobile web first, how many posts per user per day, video or images only, real-time needs, accessibility and languages. Assumptions I state: mobile first, images and short videos, a public post page for sharing (SEO), a logged-in feed, likes and comments, p75 LCP under 2.5 s on 4G, WCAG 2.2 AA, 20 posts per page. Out of scope: ranking algorithm, upload pipeline, moderation tools.

Architecture (8 min).

  • Rendering: public post pages are SSR or ISR with Open Graph tags, the feed's first page is server rendered or streamed for LCP, then hydrated, with later pages fetched on the client.
  • Routing: feed to post detail opens as a modal route (intercepted) with a real URL, deep linking renders the full page.
  • Boundaries: feed, post, composer, and notifications as features owned by separate teams, sharing a design system.

Data model (6 min). Normalized store: postsById, usersById, commentsById, and feed:home holding ordered ids with nextCursor. Server state in a query cache (infinite query), UI state local, filters and open post in the URL.

Interface (8 min). GET /feed?after=<cursor>&limit=20 returns { items, nextCursor } where each item carries the media variants, aspect ratio, counts, and viewerHasLiked. POST /posts/:id/like with an idempotency key, DELETE to unlike. Error contract: { code, message, requestId }. Component API: Feed takes a data source and a renderPost slot, PostCard takes a post and callbacks, MediaView takes sources and an aspect ratio.

Optimizations (15 min).

  • Performance: the first image is the LCP (server rendered img with fetchpriority="high", AVIF, responsive srcset, reserved aspect ratio), others lazy, blur placeholders, prefetch the next page near the end, virtualization with measured heights, memoized cards, comments loaded on open, JS budget per route.
  • Media: one video plays at a time when more than half visible, muted autoplay, paused when out of view, adaptive streaming for long video.
  • Resilience: per page error row with retry, skeletons, cached feed shown offline with a banner, scroll restoration through the cache and an anchor.
  • Real-time: SSE sends a count of new posts, a "new posts" button instead of inserting above the viewport.
  • Optimistic like: snapshot, update counts and state, send with idempotency key, rollback with a toast on failure.
  • Accessibility: role="feed" and article with aria-posinset, keyboard shortcuts, alt text, focus kept stable when loading more, "load more" button option, captions for video.
  • Security: sanitize captions and comments, strict CSP, cookies for session with CSRF protection, validate media URLs.
  • Observability: RUM for LCP and INP by route and device, impression and dwell events with sampling, errors with release tags, canary rollout with automatic rollback.
  • Testing and release: component tests with MSW, Playwright for the feed journey, visual regression on PostCard, feature flags for new media player.

Close (3 min). Summarize the trade-offs: SSR for the first page costs server time, virtualization complicates accessibility and find in page, optimistic updates need rollback logic. Say what I would measure first: LCP, INP, scroll jank, and error rate per release.


4. Design Prompts

Frame each with RADIO and pick two or three hard problems to go deep on.

PromptKey points to hit
News feedCursor pagination, virtualization, media lazy loading, optimistic like, new posts banner, scroll restore, a11y feed pattern
TypeaheadDebounce, abort, prefix cache, ARIA combobox, IME, highlight safely, ranking on server
ChatClient ids, server sequence, outbox, reconnect and resume, scroll anchoring, read receipts, multi-tab
Collaborative docsEditor engine, CRDT or OT, awareness, offline, version history, permissions
E-commerceISR product pages, PPR, SEO structured data, cart, checkout idempotency, payments, peak traffic
Real-time dashboardAggregation, batching, ring buffers, canvas, worker, layout persistence, staleness
Video player and browseABR, startup time, buffering policy, captions, resume, spatial navigation, DRM
Image carouselScroll snap, neighbor loading, autoplay a11y, looping math, responsive images
Modal and toast systemTop layer or portal, stack, focus trap, queue, imperative API, reduced motion
Data tableServer vs client ops, virtualization, URL state, selection model, grid a11y, export
File uploaderChunked resumable upload, presigned URLs, concurrency, progress, previews, validation
Nested commentsFlat to tree, lazy replies, depth cap, optimistic post, real-time, flatten and virtualize
KanbanFractional indexing, drag and drop, optimistic moves, keyboard DnD, collaboration
Maps and ride trackingVector tiles, interpolation, subscriptions by region, battery, privacy
Photo galleryJustified layout, thumbnails, virtualization, selection, resumable upload, memory
Notification systemTransport choice, unread counts, grouping, push permission in context, preferences
Search results pageSSR for SEO, URL filters, facets, cancel stale queries, skeletons, analytics
Autocomplete address formProvider session tokens, validation, mobile keyboards, a11y, fallbacks
Online code editor / IDEWeb workers for language services, virtualized text, WASM, file tree, offline
SpreadsheetVirtual grid, dependency graph, incremental recalculation, formulas in a worker, copy paste, collaboration
Social login and session managementPKCE, cookies, refresh rotation, multi-tab logout, step up auth
Design systemTokens, headless primitives, versioning, codemods, docs, adoption metrics
Micro-frontend platformShell, composition, shared deps, contracts, independent deploy, observability
Frontend observability platformRUM SDK, sampling, source maps, privacy, backend traces correlation, alerts
A/B testing frameworkStable bucketing, edge evaluation, no flicker, exposure logs, guardrail metrics
Offline-first notes appLocal DB, outbox, sync cursor, conflict policy, service worker, status UI
Live streaming chat overlayHigh message rate, batching, moderation, virtualization, backpressure
Form builderSchema driven forms, validation engine, drag and drop, versioning, preview
Image editorCanvas or WebGL, worker processing, undo history, memory, export
Multi-language public sitei18n routing, hreflang, locale bundles, RTL, translated metadata, CDN keys

5. Diagnose the Problem

ScenarioStrong answer
LCP is 5 s on mobile for product pagesCheck what the LCP element is, whether it is in the initial HTML, its size and format, priority, TTFB, render blocking CSS and JS, and fix in that order. Verify with field data
INP regressed after adding a chat widgetProfile the interaction, look for long tasks from the third party, lazy load on interaction, isolate in an iframe or worker, compare RUM before and after
Users see a blank page after deployChunk load errors from deleted assets, cached HTML pointing to old chunks, service worker serving a stale shell. Keep old assets, hashed names, reload on chunk error, fix SW update flow
Feed scroll is janky on mid-range AndroidPerformance panel for long frames, too many DOM nodes, heavy images decode, scroll handlers. Virtualize, content-visibility, passive listeners, smaller images, lighter cards
Search shows results for an old queryRace condition. Abort previous requests or ignore non-latest responses, key the query cache by query string
Double charges on checkoutMissing idempotency key and double submit. Disable button while pending, send idempotency key, server dedupes, handle timeouts by checking order status
Memory grows during a long dashboard sessionUnbounded series arrays, listeners not removed, detached DOM. Ring buffers, cleanup, heap snapshot comparison
Hydration mismatch warnings in productionTime, locale, random ids, window checks, extension modified DOM, invalid HTML nesting. Render stable output first, use effects for client only values
Accessibility audit fails on a custom dropdownMissing roles and keys, focus not managed, no names. Use a headless primitive or native select, follow the ARIA pattern, test with a screen reader
Conversion dropped 8 percent after a releaseCompare funnel steps by version and device, error rate, vitals, and flags. Roll back or disable the flag first, then investigate
WebSocket disconnects every few minutes on corporate networksProxy idle timeouts or blocking. Heartbeats, fallback to SSE or long polling, reconnect with resume, secure WebSocket
Bundle size doubled this quarterBundle analyzer diff, duplicate dependencies, accidental import of a whole library, new feature without lazy loading. Add budgets and per route limits
A/B test shows flickerClient side assignment after render. Evaluate at edge or server, bootstrap variant into HTML, hide with a short anti-flicker only as a last resort
Stale data after mutationCache not invalidated or optimistic value overwritten by an old refetch. Invalidate or update the right keys, cancel in-flight queries first
Mobile Safari bug others do not seeVerify engine specific behavior (100vh, date inputs, storage limits, position: sticky), test on WebKit in CI, use feature detection

6. Cheat Sheets

6.1 Which Rendering Strategy?

SituationChoice
Marketing, docs, blogSSG
Catalog that changes sometimesISR or on-demand revalidation
Personalized and SEO importantSSR, streaming, or PPR
Behind login, highly interactiveCSR with code splitting
Content site with small widgetsIslands
React app wanting less client JSServer Components

6.2 Which Transport?

SituationChoice
Rare updatesPolling or refetch on focus
Server push onlySSE
Two-way frequentWebSocket
App closedWeb Push
Peer to peer mediaWebRTC

6.3 Which Cache or Storage?

DataWhere
Hashed assetsHTTP cache, immutable
App shell offlineService worker Cache Storage
Remote dataQuery cache (memory) plus HTTP cache
Large offline dataIndexedDB or OPFS
SessionHttpOnly cookie
Small preferenceslocalStorage
Shareable UI stateURL

6.4 Performance Quick Fixes

ProblemFirst thing to try
Slow LCPPrioritize and preload the hero image, SSR or static HTML
Poor INPBreak long tasks, reduce render scope, remove third parties
CLSDimensions on media, font metric overrides
Large bundleSplit by route, analyze, replace libraries
Long listVirtualize
Slow APICache, dedupe, prefetch, paginate, BFF

6.5 Numbers to Remember

FactValue
LCP good2.5 s or less (p75)
INP good200 ms or less (p75)
CLS good0.1 or less
Long taskOver 50 ms
Frame budget16.7 ms at 60 Hz
Initial JS budget (mobile)About 150 to 200 KB compressed
Contrast (normal text)4.5:1
Touch target24 px minimum (WCAG 2.2), 44 px recommended
Typeahead debounce100 to 300 ms
Long asset cachemax-age=31536000, immutable
Toast durationAbout 4 to 6 s

7. Common Mistakes

MistakeBetter
Jumping to libraries before requirementsClarify and write scope first
One giant global storeServer cache plus small UI store plus URL
No numbersBudgets, estimates, percentiles
Only happy pathStates for loading, empty, error, offline, race
Ignoring accessibility and i18nInclude keyboard, ARIA pattern, RTL, Intl
Over-engineeringPick the simplest architecture that fits
Treating the backend as fixedNegotiate pagination, errors, fields, real-time
Not discussing failure and rolloutFlags, canary, rollback, monitoring
Hand-waving securityName XSS, CSRF, token storage, CSP
Talking without drawingDiagram early and refer to it
Not stating trade-offsEvery choice gets a cost and a mitigation
Memorized answersTie each decision to the stated requirements

8. Study Plan

DayFocusDo
1Fundamentals and Rendering and DeliveryExplain RADIO and each rendering strategy aloud in 3 minutes, draw the decision flow from memory
2Performance EngineeringRun Lighthouse on a real site, write a fix list for LCP, INP, CLS, set a budget
3State and Data ManagementImplement an optimistic update with rollback and a request race fix, design the cache for a feed
4Real-Time, Offline, and SyncSketch the snapshot plus delta flow, a service worker strategy table, an outbox sync
5Architecture and Security, Accessibility, and i18nDefine module boundaries for a sample app, make a combobox accessible, write a CSP
6UI Component Designs and Application DesignsDo two designs on paper in 45 minutes each, record yourself and review
7This playbook and Testing, Observability, and ReleaseAnswer 20 questions aloud, do one full mock with a timer, list the weak spots

Related:

On this page