Frontend System Design
86 deep dives across 22 topics, from HTTP and rendering to micro-frontends and A/B testing, for senior frontend system design rounds.
HTTP/1.1 vs HTTP/2 vs HTTP/3 (QUIC)
How HTTP/1.1, HTTP/2 and HTTP/3 (QUIC) differ, and what multiplexing, header compression and QUIC change for frontend performance.
TCP and TLS Handshakes: Connection Setup Costs
What happens during the TCP and TLS handshakes, why connection setup adds latency, and how to reduce it.
Browser Network Stack and Connection Pooling
How the browser's network stack works, what connection pooling and keep-alive do, and why they shape page load times.
GET vs POST and Idempotency in HTTP
When to use GET vs POST, what idempotency means for retries and caching, and how it affects API and UI design.
The Critical Rendering Path (CRP)
How the browser turns HTML, CSS and JavaScript into pixels, and how to shorten the critical rendering path.
DOM, CSSOM and the Render Tree
How the browser builds the DOM and CSSOM, combines them into the render tree, and what blocks that process.
Layout, Paint and Compositing
How layout, paint and compositing work, and which CSS changes trigger each step of the rendering pipeline.
Reflows and Repaints Explained
What triggers reflows and repaints, why they hurt performance, and how to avoid layout thrashing.
Event Loop: Call Stack, Task and Microtask Queues
How the call stack, task queue and microtask queue interact in the JavaScript event loop, with execution-order examples.
Async JavaScript: Promises and async/await
From callbacks to promises to async/await: how asynchronous JavaScript works and how to handle errors and concurrency.
Web Workers: Multi-threading in the Browser
How Web Workers move heavy work off the main thread, how to communicate with them, and their limits.
Browser Storage: Cookies, Web Storage, IndexedDB
Compare cookies, localStorage, sessionStorage and IndexedDB: how each works, when to use it, and code examples.
Client-Side Storage: Limits and Security Risks
The practical limits of browser storage and the security risks of keeping sensitive data on the client.
Choosing the Right Client-Side Storage
A decision guide for choosing between cookies, Web Storage and IndexedDB by size, persistence and security needs.
HTTP Caching: Cache-Control, ETag, Last-Modified
How HTTP caching works: Cache-Control directives, ETag and Last-Modified validation, and sensible defaults.
Browser-Level Caching Mechanisms
How browser caching works across the HTTP cache, service workers, Web Storage and IndexedDB, and when to use each.
Cache Invalidation for Frontend Apps
Why cache invalidation matters for frontend apps, and strategies such as TTL, event-driven and manual invalidation.
Structuring a Large Single-Page App
How to structure a large single-page app: type-based vs feature-based folder structures, with common mistakes to avoid.
Component-Based Architecture Principles
The principles behind component-based UIs in React, Vue and Angular: composition, encapsulation and reuse.
Props, State and Component Lifecycle
How props, state and the component lifecycle (or hooks) fit together, and how data flows through a component tree.
Module Bundling Basics
What module bundlers do, from dependency graphs to bundling, and why they matter for load performance.
Core Web Vitals: LCP, INP and CLS
What LCP, INP and CLS measure, what counts as good, and the most effective ways to improve each Core Web Vital.
FCP and Time to Interactive (TTI) Explained
How FCP and Time to Interactive describe page loading, what delays them, and how they relate to Core Web Vitals.
Measuring Performance: Lighthouse and WebPageTest
How to measure performance with Lighthouse and WebPageTest, how they complement each other, and how to read a report.
Asset Compression and Minification Basics
How asset compression and minification shrink payloads, the common compression algorithms, and when to use each.
What Is a CDN and How Does It Work?
What a CDN is, how edge servers and caching work, and how a request reaches the nearest location.
CDN Benefits: Latency, Availability, Offload
Why frontend teams use CDNs: lower latency, higher availability and less load on the origin server.
CDN Cache Behavior and Invalidation
How CDN cache behavior is configured, what cache keys and TTLs do, and how to invalidate content safely.
Global State vs Local Component State
When state should live in a component and when it should be global, and the trade-offs of each choice.
State Patterns: Redux, Zustand and Context
Compare Redux, Zustand and the Context API for complex apps: boilerplate, performance and when each fits.
Data Fetching: React Query and SWR
How React Query and SWR handle fetching, caching, revalidation and error states so you don't hand-roll them.
Immutable Data in Frontend State
Why immutable updates matter for change detection and rendering, and how to apply them to frontend state.
SSR vs CSR: Rendering Trade-offs
Compare server-side and client-side rendering: time to first paint, SEO, server cost and interactivity trade-offs.
Hydration and Time to First Byte (TTFB)
How hydration makes server-rendered HTML interactive, what Time to First Byte measures, and how both affect performance.
Static Site Generation (SSG) for Speed and SEO
How static site generation delivers fast, SEO-friendly pages, and when it is the right rendering strategy.
Incremental Static Regeneration (ISR)
How incremental static regeneration updates static pages without a full rebuild, using stale-while-revalidate.
Micro-Frontends: Core Principles
What micro-frontends are, their core principles of independent deployment and technology agnosticism, and when they make sense.
Micro-Frontend Integration Strategies
How to integrate micro-frontends with Module Federation, iframes or Web Components, and the trade-offs of each.
Communication Between Micro-Frontends
Patterns for micro-frontends to communicate, such as events and shared state, without tight coupling.
Micro-Frontends: Pros and Cons for Large Teams
The advantages and disadvantages of micro-frontends for large teams, and how to decide if they fit your product.
Real-Time: Polling, SSE and WebSockets
Compare polling, long polling, Server-Sent Events and WebSockets for real-time updates, and how to choose between them.
Real-Time Use Cases: Chat, Alerts, Live Data
Real-time use cases such as chat, notifications and live data, and which transport suits each.
Designing a Real-Time Data Flow
How to design a real-time data flow end to end: connection handling, state updates and reconnection.
Scaling WebSocket Connections
How to scale WebSocket connections: load balancing, connection limits and keeping servers and clients in sync.
Responsive Images: srcset, sizes and picture
How srcset, sizes and the picture element deliver the right image for each screen size and resolution.
Modern Image Formats: WebP, AVIF, JPEG XL
Compare WebP, AVIF and JPEG XL on compression, browser support and fallbacks for modern image delivery.
Lazy Loading Images and Videos
How to lazy load images and videos with native attributes and Intersection Observer without hurting layout.
Video Streaming: HLS, DASH, Adaptive Bitrate
How HLS and DASH deliver video over HTTP, and how adaptive bitrate streaming adjusts quality to the network.
REST and GraphQL for Frontend Engineers
REST principles and GraphQL's flexibility compared from the frontend's perspective: over-fetching, caching and tooling.
Batching, Throttling and Debouncing API Calls
How to batch, throttle and debounce API calls to cut network chatter and protect your backend.
Handling API Errors in the Frontend
How to handle API errors in the UI: status codes, retries, user messaging and fallbacks.
Authentication Flows: OAuth and JWT
How OAuth and JWT authentication flows work, where the frontend fits, and common pitfalls to avoid.
Global Error Boundaries in React
How React error boundaries catch rendering errors, where to place them, and how to show useful fallback UIs.
Error Reporting: Sentry and LogRocket
How to log and report frontend errors centrally with tools like Sentry and LogRocket, and what to capture.
Graceful Degradation and Fallback UIs
How to design graceful degradation and fallback UIs so features fail partially instead of breaking the whole page.
Real User Monitoring (RUM)
What Real User Monitoring is, which metrics it tracks and how it works, with examples of collecting Core Web Vitals.
CORS: Cross-Origin Resource Sharing
How CORS works, why browsers enforce the same-origin policy, and how to configure headers and preflight requests.
Preventing XSS (Cross-Site Scripting)
What XSS is, its main forms, and how to prevent it with escaping, sanitization and a Content Security Policy.
CSRF Protection for Frontend Apps
How CSRF attacks work and how to defend against them with SameSite cookies, tokens and origin checks.
Content Security Policy (CSP)
How Content Security Policy restricts what a page can load and run, and how to roll one out without breaking the site.
Storing Auth Tokens: Cookies vs localStorage
Where to store authentication tokens: HTTP-only cookies versus localStorage, and the security risks of each.
PWA Manifest and Installability
How the web app manifest makes a PWA installable: icons, display modes and installability criteria.
Service Workers: Lifecycle and Caching Strategies
How the service worker lifecycle works, and when to use cache-first versus network-first caching strategies.
Offline Support and Background Sync
How to make a web app work offline and use background sync to retry requests when the network returns.
Push Notifications for Web Apps
How web push notifications work end to end: permission, subscriptions, the Push API and service workers.
Webpack vs Vite vs Parcel
Compare Webpack, Vite and Parcel on speed, configuration and ecosystem, and how to choose a build tool.
Code Splitting, Tree Shaking, Asset Optimization
How code splitting, tree shaking and asset optimization reduce bundle size and speed up load times.
Module Resolution and Hot Module Replacement
How bundlers resolve modules and how Hot Module Replacement updates code in the browser without a full reload.
Monorepo Tooling: Nx and Lerna
How monorepos work for large frontend projects, and what Nx and Lerna add for builds and dependency management.
Atomic Design for Component Libraries
How Atomic Design structures a component library into atoms, molecules and organisms that scale.
Theming and Customization in Design Systems
How theming and customization work in a design system: CSS variables, dark and light modes, and styled-components approaches.
Accessibility in Component Libraries
How to build accessibility into component libraries: semantics, ARIA, keyboard support and focus management.
Component Library Docs, Testing and Versioning
How to document components with Storybook, test them, and version a component library with semantic versioning.
Publishing and Consuming a Component Library
How to publish a component library and consume it: SemVer versioning, bundling and transpilation, and the release workflow.
Full-Text Search: Levenshtein and Fuzzy Matching
How Levenshtein distance and fuzzy matching power typo-tolerant search, and how to implement them in the browser.
Indexing Large Datasets in the Browser
How to index large datasets in the browser and the trade-offs between memory use and lookup speed.
Search Performance: Debouncing and Web Workers
How to keep search fast with debouncing and Web Workers so typing stays responsive.
Integrating Backend Search Services
How to combine client-side search with backend search services: when to query the server and how to merge results.
Choosing a Chart Library: D3, Chart.js, Recharts
How to choose a charting library: D3, Chart.js or Recharts, compared on flexibility, performance and effort.
Rendering Large Datasets: Canvas vs SVG
How to render large datasets efficiently with virtualization, and when to choose Canvas over SVG.
Interactive, Responsive Data Visualizations
How to make large data visualizations interactive and responsive: zoom, tooltips and resizing.
Data Fetching and Aggregation for Dashboards
How to fetch and aggregate data for dashboards: polling with backoff, time-series aggregation and request deduplication.
A/B Test Design and Rollout Strategies
How to design A/B experiments and roll them out in phases, with feature flag and variant assignment examples.
Client-Side vs Server-Side A/B Testing
Compare client-side and server-side A/B testing: flicker, performance, SEO and consistency trade-offs.
Feature Flags and Remote Configuration
How feature flags and remote configuration work, with examples of client-side flags, config providers and A/B testing.
Experiment Data Collection and Analytics
How to collect experiment and analytics data: client-side versus server-side (beacon) collection and analytics integration.