Frontend CoachResourcesSystem Design
Sign inGet started
Frontend System Design

Cheatsheet

Designing a Frontend System from A to Z

Condensed for last-minute review — every key takeaway, decision table, and recall card.

01 — FOUNDATION

What is Frontend System Design & the RADIO thinking framework?

  • Interview Tips: Think out loud and continuously confirm with the interviewer: "I'll assume X, does that sound okay to you?" They evaluate the communication process and trade-offs more than a single "correct" answer.
  • Key points to remember: FE System Design = Intentional Trade-offs. There is no perfect solution; every choice comes with a cost. Your job is to pick the right one for the right context and explain why.
StepGoalSuggested duration
R — RequirementsUnderstand the problem: functionality, users, constraints, devices.~5 minutes
A — ArchitectureDraw the major components & data flow between them~12 minutes
D — Data ModelState definition: server data vs. client/UI state~8 minutes
I — Interface/APIThe contract between client and server, and between components (props).~8 minutes
O — OptimizationsPerformance, a11y, network, UX, security — deep dive.~12 minutes
02 — FOUNDATION

Requirements Clarification

  • Common mistakes: Spending too little (or too much) time on this step. The goal is to finalize the scope within ~5 minutes to establish a clear "contract" for the remainder of the session.
04 — CORE

Rendering Patterns: CSR · SSR · SSG · ISR

  • How to answer intelligently: Don't say "always use SSR." Instead, say: "Since the page needs SEO and content varies by user, I choose SSR; but for the post-login dashboard, CSR is sufficient because it doesn't need indexing." → This demonstrates context-driven thinking.
PatternWhen is HTML created?SEOFCP speedGood for
Client-Side Rendering (CSR)In the browser, after JS runsWeak (requires workaround)First-time slowDashboard, post-login app, minimal SEO needed.
SSR (Server-Side Rendering)For each request, on the serverGood.Fast (TTFB depends on server)Personalized page, data changes continuously, requires SEO.
SSG (Static Site Generation)During build, before deploymentBest.Fastest (CDN)Blog, documentation, marketing, landing page
ISR (Incremental Static Regeneration)Pre-built + periodic regenerationGood.FastE-commerce, many pages but updates are not continuous.
Hydration is the process of converting a static HTML page into an interactive web application by attaching event handlers and state to the server-rendered markup.
— The process of attaching JS event handlers to server-rendered HTML, turning a static page into an interactive one.
TTFB stands for Time to First Byte, which is the time from when the client sends a request to when it receives the first byte from the server.
— Time To First Byte — the time from when a request is made until the first byte is received from the server. SSR heavily depends on it.
Islands Architecture is a web architecture pattern that loads the page as static HTML, then selectively hydrates only the interactive components (the "islands") on the client side. This approach reduces the amount of JavaScript sent to the browser, improving initial load performance and time to interactive.
— The page is mostly static HTML; only interactive "islands" load JS → drastically reduces JS sent to the client.
05 — CORE

Performance & Core Web Vitals

  • Don't optimize prematurely: Always measure first, optimize later. Use Lighthouse, Performance tab, and React Profiler to identify real bottlenecks instead of guessing. Optimizing the wrong place wastes time and complicates the code.
How to reduce CLS?
— Set width/height for images & videos, reserve space for ads/embeds, avoid inserting content above the content being viewed.
Debounce vs Throttle?
— Debounce: only runs AFTER activation stops (search input). Throttle: runs at most N times per second (scroll, resize).
Tree-shaking is a term used in JavaScript module bundlers (like Webpack, Rollup, or ESBuild) to eliminate dead code—code that is imported but never used. It relies on the static structure of ES modules (import/export) to determine which exports are actually referenced. During the build process, unused exports are "shaken off" from the final bundle, reducing file size and improving load performance.
— Bundlers remove unused code (dead code) based on ES module imports, resulting in smaller bundles.
06 — CORE

Networking & Client-side API Design

  • This is a commonly asked question.: "Which pagination should social media feeds use?" → Cursor-based. Because feeds continuously have new posts inserted at the top; offset would cause duplicate/missed items when scrolling.
RESTGraphQL
Fetch dataMultiple fixed endpoints1 endpoint, client declares the required fields themselves.
Over/Under-fetchingProne to (over-fetching/under-fetching)Minimize as much as possible.
CachingSimple (HTTP cache by URL)More complex (requires normalization)
VersioningCommonly /v1, /v2Schema evolution, deprecate field.
"Matches"Simple API, cache by URLComplex UI with multiple data relationships.
07 — CORE

State Management

  • Common Misunderstandings: Many people stuff server data into Redux and write their own cache/loading/error logic. In reality, server state is very different from client state: it's asynchronous, can become "stale", and requires refetching & deduplication. Let React Query/SWR handle that.
TypeDescriptionThe right tool
Server StateList of articles, user profiles (requires caching, sync, refetch)React Query, SWR, RTK Query, Apollo
Local StateInput value, open/close dropdownuseState, useReducer
Global UI StateTheme, login, cart, global modalContext, Zustand, Redux, Jotai
URL StateSelected tab, filters, search keywordsRouter (query parameters)
08 — CORE

Component Design & API Design

  • Advantages during the interview: When designing Autocomplete, proactively mention: debounce, race condition (AbortController), caching results, keyboard navigation (↑↓ Enter Esc), ARIA (role="combobox", aria-activedescendant), and virtualization for long lists. This is the checklist interviewers expect.
09 — ADVANCED

Caching & Client Storage

  • Token security: Don't store sensitive tokens in localStorage if you're concerned about XSS — it's accessible via JavaScript. Cookies with HttpOnly + Secure + SameSite flags are safer for sessions, since JavaScript cannot read them.
The mechanismCapacityCharacteristicsUsed for
**Memory (JS)**RAMLost when reloadingCache runtime, state
localStorage5–10 MBSynchronous, string only, long-lived.Theme, small token, prefs
sessionStorage~5MBLost when closing the tabSession-based temporary data
IndexedDBLarge (hundreds of MB+)Asynchronous, store objectOffline data, big data
Cookies~4KBAttach to every requestSession ID (HttpOnly), auth
Cache APILargeThrough Service WorkerCache response, PWA offline
10 — ADVANCED

Real-time Updates

  • How to quickly select: Server push only? → SSE (lightweight, auto-reconnect, over HTTP). Need high-frequency bidirectional? → WebSocket. Not urgent/simple? → Polling. Always consider reconnection, heartbeat, and fallback.
The mechanismAfternoonComplexityGood for
Short PollingThe client asked:LowNo rush to update, prototype.
Long PollingClient asks (keep connection)AverageFallback when WebSocket is unavailable
SSEServer → Client (one-way)Low–MediumNotification, feed, log stream
WebSockettwo-wayCaoChat, collaboration, gaming, trading
11 — ADVANCED

Accessibility (a11y) and Internationalization (i18n)

  • The first rule of ARIA: "No ARIA is better than bad ARIA." Prioritize semantic HTML. A real `
12 — ADVANCED

Frontend Security

  • The golden rule: Never trust data from the client. All frontend validation is only for good UX; real validation must happen on the server. The frontend can be opened via DevTools and anything can be modified.
AttackThe essencePrevention
Cross-Site Scripting (XSS)Inject malicious script into the page via unescaped input.Escape output, avoid dangerouslySetInnerHTML, use CSP, sanitize (DOMPurify).
CSRF (Cross-Site Request Forgery)Trick the browser into sending a request with cookies to another site.SameSite cookie, CSRF token, Origin check
ClickjackingEmbed a transparent iframe site to trick clicks.X-Frame-Options and frame-ancestors in CSP
Secret leakAPI key/token embedded in client bundleNever expose server-side secrets in client code; use a proxy instead.
13 — Deep Foundation

How does the browser render a page?

  • Layout Thrashing: Reading layout properties (offsetTop, getBoundingClientRect) immediately after writing to the DOM forces the browser to perform synchronous reflows repeatedly. To avoid this: batch all reads together before writing (read-then-write batching), or use requestAnimationFrame.
  • A high-scoring answer.: "For smooth 60fps animation, I only animate transform and opacity because they run on the compositor thread, do not block the main thread, and do not cause reflow." → demonstrates your understanding of the pipeline.
TypeWhen does it occur?Cost
Reflow (Layout)Resizing, repositioning, adding/removing DOM elements, reading offsetHeight...Expensive — must recalculate the geometry of the entire tree.
RepaintChange color, visibility, box-shadow (no layout change)Average — pixel repaint
Composite-onlyChange transform, opacityCheapest — GPU compositing layers, skipping Layout & Paint
14 — DEEP FOUNDATION

Event Loop & Asynchronous in JS

  • **The Unforgettable Rule**: After each macrotask, the event loop clears the ENTIRE microtask queue before rendering and fetching the next macrotask. Therefore, Promise.then always runs before setTimeout, even if setTimeout is set to 0ms.
  • Trap: infinite microtask: If a microtask continuously creates new microtasks, rendering will suffer from starvation — the page freezes because the event loop never reaches the paint step. For repeated heavy tasks, use setTimeout/requestIdleCallback to yield the thread.
15 — DEEP FOUNDATION

Network protocol: HTTP/1.1 → HTTP/3

  • Common interview questions: "With HTTP/2, should you still bundle all JS into one file?" → No. Multiplexing eliminates the penalty for multiple small files, and actually benefits caching (fixing one module won't invalidate the cache for the entire bundle).
VersionKey featuresThe remaining issue
HTTP/1.11 request/response per connection at a time; must open multiple parallel connections.Head-of-line blocking; limit of ~6 connections per domain → requires bundling, sprites.
HTTP/2Multiplexing: multiple streams over a single connection; header compression; server push.Still HOL blocking at the TCP layer (losing one packet blocks the entire connection).
HTTP/3Runs on QUIC (UDP); each stream is independent; faster handshake.New, some older networks block UDP.
16 — DEEP FOUNDATION

JavaScript Engine: How V8 Works Internally

  • Common memory leaks in frontend development: Listener not removed, setInterval not cleared, closure holding large references, or detached DOM nodes still held by JavaScript. In React: forgetting cleanup in useEffect. Use DevTools → Memory to take heap snapshots and find leaks.
  • Don't blindly micro-optimize.: The engine is extremely intelligent; writing clear code with consistent shape and avoiding deletions in hot paths is sufficient. Measure with a profiler before optimizing — "premature optimization is the root of all evil."
RegionWhat does it contain?GC (Garbage Collection)
Young generationMost new objects "die young".Scavenge — fast, frequent
Old generationObject survives multiple GC cyclesMark-Sweep-Compact — slower, less frequent
17 — DEEP FOUNDATION

Detailed HTTP Caching & CORS

  • Classic caching strategy: Files with content hashes (e.g., app.a3f9.js) are cached immutably for 1 year because changing content changes the filename. The index.html file uses no-cache (always revalidate) so users receive the latest version. This is the foundation of safe deployment.
  • CORS is a browser mechanism.: CORS does not protect the server (requests still reach the server). It protects the user: the browser blocks JavaScript from reading responses from a different origin unless the server allows it. Therefore, CORS errors must be fixed on the server (by adding headers), not on the client.
  • Trick question: "Does no-cache mean no caching?" → No! no-cache = still stores but must revalidate (ETag) before using. "Don't store anything" is no-store. Confusing these two is a very common mistake.
HeaderEffect
Cache-Control: max-age=31536000, immutableCache for 1 year, no revalidation needed — for assets with content hash.
Cache-Control: no-cacheMust revalidate with the server before using (NOT "no cache")
Cache-Control: no-storeAbsolutely do not store — for sensitive data.
ETag + If-None-MatchContent fingerprinting; server returns 304 Not Modified if unchanged → saves bandwidth.
stale-while-revalidateUse the old version immediately, update silently — fast + gradually new
18 — ADVANCED TECHNIQUES

Design System & Component Library

  • Versioning & Breaking Changes: Component libraries should use semantic versioning. Changing a required prop constitutes a major version. Provide codemods for automatic migration, and issue deprecation warnings at least one version before removal. This maintains trust with the teams using the library.
  • Notable trade-off: "Flexible" components (many props) vs. "opinionated" components (fewer choices, high consistency). Good libraries often use compound components and slots to achieve both flexibility and consistency, rather than cramming in 30 boolean props.
19 — ADVANCED TECHNIQUES

Testing Strategy for Frontend

  • The philosophy of Testing Library: "Test like how users interact" — find elements by role/label/text instead of class or internal test-id. Such tests are less brittle during refactoring and catch real bugs. Avoid testing implementation details (internal state, function names).
  • Trap: flaky tests: E2E tests become "flaky" due to timing issues (waiting for animations, network). Mitigation: wait for conditions (await expect(...).toBeVisible()) instead of sleep(2000), mock network when needed, and isolate tests (no dependency on execution order).
TypeWhat to testPopular tools
UnitPure function, util, reducer, custom hookJest, Vitest
Component / IntegrationComponent renders correctly, user interaction, callback invocationReact Testing Library
E2EComplete flow: login → purchase → paymentPlaywright, Cypress
Visual regressionDoes the UI break visually?Chromatic, Percy
20 — ADVANCED TECHNIQUES

Monitoring and Observability

  • Lab data vs Field data: Lab (Lighthouse) = simulated environment, stable, good for debugging. Field/RUM = real users, many device/network variations — these are the numbers that matter for SEO (Google uses CrUX). Must look at both.
21 — ADVANCED TECHNIQUES

Build, Bundling & Deploy

  • Feature flags = decoupling deployment from release: Deploy code to production but disable the feature behind a flag. Gradually enable it from 1% → 50% → 100%. If an error occurs, turn off the flag immediately (no need to rollback the deployment). Also used for A/B testing.
  • A valuable question: How to deploy without breaking the experience for users on an old tab? → Use versioned assets with content hashes, keep old files for a period of time, and handle "chunk load failed" errors by reloading the page when a new version is detected.
TechniqueEffect
Tree-shakingRemove dead code — requires ES modules for static analysis.
Code splittingSplit bundles by route/component, load on demand (dynamic import()).
MinificationMinify variable names, remove whitespace, dead code
Content hashingFile name with hash (app.a3f9.js) → permanent cache, content change = name change
Module FederationShare the runtime module between apps (micro-frontend platform).
22 — ADVANCED TECHNIQUES

Bundler comparison: Webpack · Vite · esbuild · Rollup

  • The core idea of Vite: Modern browsers support native ES modules. During development, Vite does not bundle but lets the browser import each module individually; Vite only transforms the modules that are requested (using esbuild for extremely fast processing). As a result, server startup and HMR are nearly instantaneous, regardless of project size. For production builds, Vite bundles using Rollup for optimization.
  • How to choose a tool: For building libraries → Rollup (clean output, good tree-shaking). For building new apps → Vite (excellent DX). For legacy/complex projects requiring specific plugins → Webpack. For raw speed in the pipeline → esbuild.
ToolStrong pointsTechnical specifications
WebpackComplex app, massive loader/plugin ecosystemBundle everything; extensive configuration; module federation
ViteExtremely fast dev experience.Dev: Native ESM + esbuild, no bundling; Prod: Rollup
esbuildRaw build speed (written in Go)10–100× faster than JS tools; fewer advanced features
RollupBuild a libraryExcellent tree-shaking, clean output (ESM/CJS/UMD).
23 — ADVANCED TECHNIQUES

Advanced Testing: Mock, Async & Contract

  • Don't over-mock.: Mocking everything makes tests only verify "the code calls the mocked function correctly" — it doesn't reflect real behavior. Prioritize mocking at system boundaries (network, time, storage), and keep the logic within the test running as real code.
  • A high-scoring answer: I test based on user behavior, mock at the network boundary using MSW, use fake timers for debounce/throttle, and apply contract tests for the FE-BE boundary. → This shows you understand testing at the correct layers.
ConceptWhat is it?Used when
StubReplace the function with a fixed return value.Need a dependency that returns predefined data (mock API returns an object).
SpyTrack how the ACTUAL function is called (number of times, parameters).To confirm whether the callback/analytics is called correctly.
MockA mock object has expectations about how it is called.Check interaction between modules, fail if called incorrectly.
FakeSimple in-memory database implementation.Replace the heavy system with a lightweight version.
24 — ADVANCED TECHNIQUES

Storybook & Component Documentation

  • Story = test + docs + dev simultaneously: A good story serves as documentation (for others to view), a playground (for developers to experiment), and input for visual regression tests. "Write once, use for three purposes" — this is why Storybook is worth investing in for teams with a design system.
  • Systems thinking: Mentioning Storybook when asked about design systems shows you're thinking about maintainability and collaboration, not just making code work. That's the mindset of someone building platform/infra for a team.
25 — ADVANCED TECHNIQUES

Module Federation — executing micro-frontends

  • The cost to pay: Module Federation adds significant complexity: managing shared dependencies, runtime versioning, difficulty debugging when remotes fail, and often worse performance than a monolith due to loading multiple runtimes. Only use it when the organizational benefits (independent teams) outweigh this cost.
  • Alternative: Not every micro-frontend requires Module Federation runtime. For lighter requirements: build-time integration (each team exports a package), iframe (strong isolation but limited UX), or web components. Choose based on the actual level of independence needed.
ChallengeHow to handle
Duplicate dependencyDeclare shared resources (React, common libraries) to load once, avoiding multiple versions being downloaded.
Version mismatchSet singleton: true for React → prevents two React instances from conflicting.
Remote errors/slow performanceError boundary + fallback UI; don't let one remote crash the entire app.
UI consistencyShare the design system via a shared package.
26 — ADVANCED TECHNIQUES

Distributed Tracing & Alert Strategy

  • The role of Frontend: The frontend initializes a trace-id and sends it as a header (e.g., traceparent per W3C Trace Context standard) with every API call. This links user-facing errors/latency to backend logs — making it feasible to debug "why user X experienced slowness."
  • Why p95 is more important than the average: "Average 200ms" sounds fine, but if p99 is 5 seconds, then 1% of users are suffering — often the most important ones (heavy data users). Seniors always look at tail latency, not just the average.
The principleMeaning
Alert on symptoms, not on root causes.Report "error rate > 2%" (affects users) instead of "high CPU" (may be harmless).
Use percentile, not average.p95/p99 reflects the worst-case experience; averages hide the long tail.
ActionableEach alert must have a clear action; if nothing can be done, do not alert.
Reasonable thresholdToo sensitive → false alarms (cry wolf); too loose → missed real incidents.
27 — EXTENSION

Optimize Images & Resources

  • Always set width & height: Declare width/height (or aspect-ratio) so the browser reserves space in advance — preventing layout shifts when images finish loading (improving CLS). Images without dimensions are the most common cause of CLS.
FormatUsed whenNotes
AVIFScreenshots, background — top priority.Best compression, increasingly broad support.
WebPFallback for AVIFSmaller than JPEG/PNG by ~30%
SVGIcon, logo, vector imageInfinite resolution, small, can be styled with CSS.
JPEG/PNGThe final fallbackPNG for images requiring transparency.
28 — EXTENSION

PWA, Service Worker & Offline-first

  • Trap: SW "stuck" on an old version: Service Workers have their own lifecycle (install → waiting → activate). If updates are not handled properly, users may get stuck on an old version. A strategy of skip-waiting combined with a "New version available, reload?" notification is needed for smooth updates.
  • Requirements of PWA: To be installable as an app, you need HTTPS, a Web App Manifest (name, icon, theme), and a Service Worker. When these are in place, the browser shows an "Add to Home Screen" prompt.
StrategyHow it works"Matches"
Cache FirstFetch from cache first, only go to network if not available.Static resources (CSS, JS, fonts, logos)
Network FirstGo to network first, use cache on error.Data needs to be fresh (feed, price)
Stale-While-RevalidateReturn cache immediately, while updating in the background.Avatar, content changes infrequently — fast + gradual updates.
29 — EXTENSION

Frontend in a large team scale.

  • Don't use it just because it "sounds cool.": Micro-frontends solve organizational problems (multiple teams deploying independently), not technical problems. The cost: complexity in shared dependencies, UI consistency, and performance (loading multiple runtimes). Only worthwhile when teams are large enough to block each other.
  • Senior mindset: "I'll start with a modular monolith with clear module boundaries. Only split into micro-frontends when there's evidence that teams are blocking each other during deployment." → shows you prioritize simpler solutions first.
CriteriaMonorepoPolyrepo
Share the code.Easy — shared repo, simultaneous updates.Difficult — via npm package, versioning
Synchronize changesA PR that fixes both the app and the library.Multiple PRs, multiple release steps
Build/CINeed smart tools (Nx, Turborepo) to only build the changed parts.Simple, independent per repository.
Team boundariesNeed clear CODEOWNERSNaturally split by repo.
30 — PRACTICE

Case Study: Chat Application (like Messenger)

  • Ensure no data loss: Each message has a client-generated ID (idempotency key). When resending due to network loss, the same ID is used, and the server handles deduplication. Combine a local queue with IndexedDB so that messages composed offline are sent when connectivity is restored.
  • O — Evaluation Criteria: The interviewer wants to hear your considerations: WebSocket vs SSE (chat requires two-way communication → WebSocket), how to handle incoming messages while scrolling through history, and resolving message order conflicts (sort by server timestamp).
31 — PRACTICE

Case Study: Autocomplete / Typeahead

  • Accessibility — don't forget.: Use the combobox pattern: `aria-expanded`, `aria-activedescendant` pointing to the currently selected item, navigation with ↑↓, Enter to select, Esc to close. This is a point many candidates overlook, but interviewers pay close attention to.
32 — PRACTICE

Case Study: Photo Gallery (like Google Photos)

  • O — Points the interviewer pays attention to: How to calculate grid layout when images have different aspect ratios (justified layout like Google Photos requires knowing dimensions in advance — server returns width/height), and how to maintain scroll position when loading more images above.
33 — PRACTICE

Case Study: Infinite Data Table

  • Why use sort/filter on the server side?: Sorting 1 million rows on the client will block the main thread. The server (with database indexing) handles this quickly and only returns the page of data the client needs. The client should only sort/filter locally when the dataset is small and fully loaded.
  • **Trap: dynamic height**: If each row has a different height (text wrap), virtualization becomes more difficult — you need to measure and cache actual heights, or use estimation with adjustment techniques. Fixed row height is much simpler.
34 — PRACTICE

Case Study: Video Player (like YouTube)

  • The core trade-off of ABR: High quality vs. rebuffering risk. ABR algorithm balances: prioritizes no interruptions (rebuffering severely harms user experience) over always delivering maximum quality. Starting low for fast playback is the standard strategy.
  • A11y for player: Controls must be keyboard accessible (Space for play/pause, ←→ for seek), include ARIA labels, support captions, and must not autoplay with sound (to avoid annoyance and a11y violations).
ConceptMeaning
HLS / DASHTwo streaming standards divide video into chunks + manifest. HLS is popular on Apple, DASH is an open standard.
Buffer aheadPreload several chunks to prevent lag when the network fluctuates.
Startup timeStart at a low level to play fast, then gradually increase as the network is measured.
MSE (Media Source Extensions)The browser API that allows JavaScript to "load" chunks into a video element — the foundation of an ABR player.
35 — PRACTICE

Case Study: Collaborative Editing (like Google Docs)

  • Why not use "last write wins"?: The simplest approach — last writer wins — will lose the other person's text. OT/CRDT ensures both concurrent operations are preserved and all clients converge to the same state. This is the difference between a "toy" and a real product.
  • O — How to make an impression: State that this is a "convergence in distributed systems" problem, compare OT vs CRDT with clear trade-offs, and mention local-first + offline. No need for transform algorithm code — understanding the principles and trade-offs is sufficient for the FE round.
CriteriaOT (Operational Transformation)CRDT
The ideaTransform operations concurrently to maintain consistency.Self-merging data structure, no transformation needed.
Do we need a central server?Often requires (coordinating the order)Optional — suitable for P2P/offline
ComplexityComplex logic transformations are difficult to get right.Simpler in theory, but requires more metadata.
Used byGoogle Docs (traditional)Figma, many new apps, Yjs/Automerge
36 — PRACTICE

Case Study: Designing a News Feed

  • How to "score points" in the O part: Don’t list everything. Pick 2–3 optimizations most relevant to the finalized requirements (e.g., because smoothness on mobile is needed → virtualization + responsive images) and dive deep into them. Depth over breadth.
37 — PRACTICE

Interview Checklist — Print and Review Quickly

RADIO stands for "Radio Detection and Ranging".
— Requirements · Architecture · Data model · Interface (API) · Optimizations.
4 types of state?
— Server state · Local state · Global UI state · URL state. Each type has its own tools.
What are the 3 Core Web Vitals?
— LCP (<2.5s) · INP (<200ms) · CLS (<0.1)
Optimistic UI is a design pattern where the user interface immediately reflects the expected outcome of an action, without waiting for confirmation from the server. This creates a faster, more responsive user experience. If the server later rejects the action, the UI rolls back to the previous state and displays an error.
— Update the UI immediately before the server responds, rollback on error → instant feel.
When to use WebSocket?
— For two-way, low-latency communication: chat, collaboration, gaming, trading.
How do you prevent XSS?
— Escape output, avoid dangerouslySetInnerHTML, sanitize (DOMPurify), CSP, HttpOnly cookies.
38 — PRACTICE

Question bank summary

  • In conclusion: FE System Design has no single correct answer. Practice the mindset of: clarify → structure → trade-offs → deep dive. Revisit the diagrams and flashcards here regularly; spaced repetition is the best way to retain knowledge. Wishing you a successful interview! 🚀