Last Minute Prep

Frontend Interview Cheat Sheet

A dense, scan-first view for the final hour before an interview. Each card gives you the answer shape, the trap to avoid, and the metric or debugging signal to mention.

Q001Q002Q003Q004Q005Q006Q007Q008Q009Q010Q011Q012Q013Q014Q015Q016Q017Q018Q019Q020Q021Q022Q023Q024Q025Q026Q027Q028Q029Q030Q031Q032Q033Q034Q035Q036Q037Q038Q039Q040Q041Q042Q043Q044Q045Q046Q047Q048Q049Q050Q051Q052Q053Q054Q055Q056Q057Q058Q059Q060Q061Q062Q063Q064Q065Q066Q067Q068Q069Q070Q071Q072Q073Q074Q075
Q001

Browser URL Lifecycle

Navigation pipeline

Answer Shape

Parse URL, check cache and policy, resolve DNS, connect, negotiate TLS, request, stream HTML, parse, render, execute JavaScript, hydrate, and interact.

Avoid Saying

Do not stop at DNS and HTTP. Include rendering, security, and Web Vitals.

Q002

V8 JavaScript Engine

Tiered execution

Answer Shape

V8 parses source, creates bytecode, runs Ignition, profiles hot paths, optimizes with TurboFan, and de-optimizes when assumptions fail.

Avoid Saying

Do not say JavaScript is only interpreted or TypeScript makes runtime faster.

Q003

Execution Context

Runtime environment

Answer Shape

Execution context contains lexical bindings, variable bindings, and this. Function calls create contexts that are pushed onto the call stack.

Avoid Saying

Do not say hoisting physically moves code.

Q004

Call Stack

Active execution

Answer Shape

The call stack tracks active frames. Function calls push frames; returns and thrown errors pop frames. Async waiting happens outside the stack.

Avoid Saying

Do not say async work stays on the stack while waiting.

Q005

Memory Heap

Reachability

Answer Shape

The heap stores objects and dynamic data. Garbage collection reclaims unreachable objects; leaks happen when unused objects remain reachable.

Avoid Saying

Do not say garbage collection prevents memory leaks.

Q006

Event Loop

Scheduling

Answer Shape

The event loop runs a task, drains microtasks after the stack clears, gives rendering a chance, then picks the next task.

Avoid Saying

Do not say async means parallel execution on the main thread.

Q007

Microtasks vs Macrotasks

Queue priority

Answer Shape

Promise callbacks and queueMicrotask are microtasks. Timers and user events are tasks. Microtasks drain before the next task and before rendering.

Avoid Saying

Do not treat promises as a background thread.

Q008

Critical Rendering Path

Pixels pipeline

Answer Shape

HTML builds DOM, CSS builds CSSOM, both form the render tree, then layout, paint, and composite produce pixels.

Avoid Saying

Do not ignore render-blocking CSS, parser-blocking scripts, or LCP priority.

Q009

DOM and CSSOM

Browser object models

Answer Shape

DOM represents document structure. CSSOM represents parsed style rules. The browser combines them to compute the render tree.

Avoid Saying

Do not say the DOM is what users see. Users see pixels after layout, paint, and compositing.

Q010

Layout, Reflow, Paint and Compositing

Rendering cost stages

Answer Shape

Layout calculates geometry, paint records visuals, and compositing assembles layers. Reflow is layout recalculation after a geometry-affecting change.

Avoid Saying

Do not call every rendering problem a repaint. Separate layout, paint, and composite costs.

Q011

Browser Storage

Client persistence choices

Answer Shape

Use Web Storage for small string data, IndexedDB for large structured data, Cache Storage for request/response caching, and cookies for server-visible state.

Avoid Saying

Do not store sensitive tokens in localStorage without discussing XSS risk.

Q012

Cookies and Sessions

Browser-managed request state

Answer Shape

Cookies are automatically sent with matching requests. HttpOnly blocks JS reads, Secure requires HTTPS, and SameSite controls cross-site sending.

Avoid Saying

Do not say HttpOnly prevents XSS; it only prevents cookie reads.

Q013

DOM Events and Event Delegation

Interaction flow

Answer Shape

Events move through capture, target, and bubble phases. Delegation attaches a listener to an ancestor and handles child events through target checks.

Avoid Saying

Do not confuse target with currentTarget or assume every event bubbles.

Q014

Script Loading

Discovery and execution

Answer Shape

Classic scripts block parsing, defer preserves order after parsing, async executes when ready, and module scripts are deferred by default.

Avoid Saying

Do not use async for ordered dependencies or preload every resource.

Q015

Web Workers

Main-thread protection

Answer Shape

Workers run JavaScript off the main thread and communicate with postMessage. They cannot directly access the DOM.

Avoid Saying

Do not move tiny work to workers without measuring message overhead.

Q016

Service Workers

Programmable request layer

Answer Shape

Service workers run separately from the page, intercept fetches after activation, and can serve cache, network, or offline fallbacks.

Avoid Saying

Do not treat service workers like normal workers or cache every response with one rule.

Q017

HTTP Caching

Freshness and validation

Answer Shape

Cache-Control defines storage and freshness. ETag and Last-Modified enable conditional requests that can return 304 without a body.

Avoid Saying

Do not confuse no-cache with no-store or put long immutable caching on HTML.

Q018

CORS

Browser read permission

Answer Shape

CORS lets servers opt in to cross-origin response reads. The browser enforces it with allow headers and preflight checks.

Avoid Saying

Do not call CORS authentication or try to fix every CORS issue only in React.

Q019

Fetch Lifecycle

Cancellation and correctness

Answer Shape

Fetch resolves on HTTP responses, rejects on network or abort failures, and needs response.ok checks plus AbortController for stale work.

Avoid Saying

Do not assume fetch rejects on 404 or let old search results overwrite newer state.

Q020

Realtime Transports

Direction and latency

Answer Shape

Polling pulls updates, SSE streams server-to-client events, and WebSockets provide bidirectional persistent messaging.

Avoid Saying

Do not choose WebSockets by default when SSE or polling satisfies the product need.

Q021

Frontend Observability

Real-user browser signals

Answer Shape

Collect browser performance, errors, resources, interactions, and custom marks with route, device, release, and privacy context.

Avoid Saying

Do not rely only on Lighthouse or collect telemetry without a debugging use case.

Q022

Core Web Vitals

Field attribution

Answer Shape

LCP measures loading, INP responsiveness, and CLS visual stability. Debug with field data, route context, release, and attribution.

Avoid Saying

Do not stop at metric names or rely only on lab scores.

Q023

Modules and Bundling

Dependency graph cost

Answer Shape

Bundlers build dependency graphs, transform source, split chunks, tree-shake safe exports, and emit hashed browser assets.

Avoid Saying

Do not focus only on compressed size; parse and execution cost matter.

Q024

Rendering Debugging

Trace evidence

Answer Shape

Use browser traces to separate scripting, style recalculation, layout, paint, compositing, and frame presentation costs.

Avoid Saying

Do not call every visual problem a repaint or guess without a trace.

Q025

Memory Profiling

Retained references

Answer Shape

Leaks happen when unused objects remain reachable. Compare heap snapshots and inspect retaining paths to find the reference.

Avoid Saying

Do not blame garbage collection when code still retains objects.

Q026

XSS and CSP

Safe rendering

Answer Shape

Prevent XSS with safe rendering, context-aware encoding, sanitizer-controlled rich text, token protection, and CSP defense in depth.

Avoid Saying

Do not say React prevents all XSS or that CSP replaces sanitization.

Q027

CSRF and Isolation

Cross-site browser risk

Answer Shape

CSRF abuses ambient cookies, clickjacking abuses framed UI, and isolation headers reduce cross-origin attack surface.

Avoid Saying

Do not confuse CORS with CSRF protection.

Q028

Accessibility Foundations

Semantic usable UI

Answer Shape

Use semantic HTML, keyboard support, visible focus, labels, contrast, accessible errors, and careful ARIA.

Avoid Saying

Do not reduce accessibility to adding aria labels at the end.

Q029

Forms and Validation

Input lifecycle

Answer Shape

Good forms combine semantic controls, client feedback, server validation, duplicate protection, accessible errors, and recovery.

Avoid Saying

Do not trust client validation or clear input after failed requests.

Q030

Responsive Media

Right asset delivery

Answer Shape

Use responsive candidates, dimensions, modern formats, CDN delivery, lazy loading for non-critical media, and priority for LCP.

Avoid Saying

Do not ship one huge image to every device or lazy-load the LCP image.

Q031

I18n and L10n

Global-ready UI

Answer Shape

Use message catalogs, plural rules, locale formatting, RTL support, fallbacks, and text expansion testing.

Avoid Saying

Do not concatenate translated strings or assume English layout.

Q032

URL State

Shareable views

Answer Shape

Put shareable, reloadable, restorable view state in the URL and use history updates that preserve back-button expectations.

Avoid Saying

Do not hide important filters only in memory or push history on every keystroke.

Q033

Back Forward Cache

Restored navigation

Answer Shape

bfcache stores a frozen page snapshot for instant back/forward navigation when the page avoids blockers.

Avoid Saying

Do not add unload handlers casually or assume every visit is a fresh load.

Q034

File Upload UX

Reliable file workflows

Answer Shape

Use native input fallback, validation, progress, cancellation, retry, accessible drop zones, and server-side enforcement.

Avoid Saying

Do not trust client validation or make drag-and-drop the only path.

Q035

Capability APIs

Permission-aware UX

Answer Shape

Clipboard, drag, and permission APIs need secure contexts, user gestures, feature detection, fallback UX, and privacy care.

Avoid Saying

Do not assume capability APIs always work or that permission is guaranteed.

Q036

Motion Performance

Responsive motion

Answer Shape

Use CSS transitions, keyframes, or WAAPI as needed; prefer transform and opacity; respect reduced motion.

Avoid Saying

Do not animate layout-heavy properties or ignore interruption.

Q037

CSS Architecture

Predictable styling

Answer Shape

Manage cascade, layers, specificity, tokens, component boundaries, and override rules to avoid styling fights.

Avoid Saying

Do not solve every conflict with !important or high-specificity selectors.

Q038

Flexbox and Grid

Responsive layout

Answer Shape

Use flexbox for one-dimensional layout, grid for two-dimensional layout, and intrinsic constraints for resilient responsive UI.

Avoid Saying

Do not build fixed layouts that break with long text, zoom, or localization.

Q039

Design Systems

Shared UI infrastructure

Answer Shape

Design systems combine tokens, component contracts, accessibility rules, documentation, and governance.

Avoid Saying

Do not treat a component library alone as a design system.

Q040

Theming

Preference-aware tokens

Answer Shape

Use semantic tokens, CSS variables, system preference, user override, persistence, and contrast checks.

Avoid Saying

Do not invert colors mechanically or ignore dark-mode states.

Q041

Client Data Caching

Fresh server state

Answer Shape

Define cache keys, stale time, refetch triggers, invalidation, optimistic updates, rollback, and error recovery.

Avoid Saying

Do not treat server state like local UI state.

Q042

State Management

State ownership

Answer Shape

Place state by owner and lifetime: local UI, server cache, URL, derived values, persistent settings, or global app state.

Avoid Saying

Do not duplicate sources of truth or put every value in a global store.

Q043

Error Boundaries

Graceful failure

Answer Shape

Use boundaries, route fallbacks, async error states, retry UX, and logging so one failure does not blank the app.

Avoid Saying

Do not use one global error screen for every failure.

Q044

Testing Strategy

Confidence layers

Answer Shape

Use unit, integration, E2E, accessibility, visual, contract, and monitoring checks according to user risk.

Avoid Saying

Do not chase snapshots while missing critical user flows.

Q045

Playwright

Real browser flows

Answer Shape

Use resilient locators, isolated data, traces, screenshots, and focused critical journeys for trustworthy E2E tests.

Avoid Saying

Do not rely on brittle selectors, sleeps, or giant all-in-one tests.

Q046

TypeScript Basics

Static contracts

Answer Shape

TypeScript models compile-time contracts, improves refactors, and catches invalid shapes, but runtime data still needs validation.

Avoid Saying

Do not claim TypeScript validates external JSON at runtime.

Q047

Type Narrowing

Safe branching

Answer Shape

Use narrowing and discriminated unions to model valid UI states and protect refactors with exhaustive checks.

Avoid Saying

Do not model every state with optional fields.

Q048

Generics

Typed reuse

Answer Shape

Generics preserve relationships between inputs and outputs, while utility types transform reusable contracts.

Avoid Saying

Do not over-genericize code until simple logic becomes unreadable.

Q049

Runtime Validation

Trust boundaries

Answer Shape

Validate external data at runtime because TypeScript types are erased and cannot prove JSON shape.

Avoid Saying

Do not assign response.json directly to a trusted domain type.

Q050

React Rendering

Render vs commit

Answer Shape

React renders components to compute UI, reconciles trees, and commits necessary host changes; keys preserve identity.

Avoid Saying

Do not say React replaces the whole DOM on every state update.

Q051

React State Flow

Ownership

Answer Shape

Props pass data down, state owns changing local values, and clear source-of-truth choices prevent stale UI.

Avoid Saying

Do not copy props into state without a synchronization reason.

Q052

React Effects

External sync

Answer Shape

Effects synchronize React with external systems and need correct dependencies, cleanup, and stale async handling.

Avoid Saying

Do not use effects for pure derived values.

Q053

React Memoization

Measured optimization

Answer Shape

Use memo, useMemo, and useCallback when profiler evidence shows meaningful render or calculation cost.

Avoid Saying

Do not wrap everything in memoization without measuring.

Q054

React Forms

Input ownership

Answer Shape

Controlled inputs are owned by React state; uncontrolled inputs are owned by the DOM and read when needed.

Avoid Saying

Do not force every field into React state when native behavior is enough.

Q055

React Composition

Reusable UI contracts

Answer Shape

Use children, slots, compound components, render props, and controlled APIs to keep reusable UI flexible.

Avoid Saying

Do not create giant boolean-prop configuration components.

Q056

React Context

Scoped shared values

Answer Shape

Context shares values in a subtree; keep provider scope tight and values stable to avoid broad re-renders.

Avoid Saying

Do not put frequently changing large state in one global context.

Q057

React Profiling

Evidence-based fixes

Answer Shape

Use React Profiler and browser traces to separate render cost, commit cost, layout, paint, and data processing.

Avoid Saying

Do not optimize React before measuring the real bottleneck.

Q058

Suspense and Streaming

Async boundaries

Answer Shape

Suspense coordinates loading at boundaries; streaming progressively reveals useful UI before everything is ready.

Avoid Saying

Do not use one global spinner for every async operation.

Q059

Next.js App Router

Route architecture

Answer Shape

App Router uses route segments, layouts, pages, loading/error files, Server Components, and intentional Client Components.

Avoid Saying

Do not mark broad layouts as client components without need.

Q060

Rendering Strategies

Freshness vs speed

Answer Shape

SSR is per request, SSG is build-time, ISR balances static speed with freshness, and hydration adds client cost.

Avoid Saying

Do not choose SSR for everything or ignore hydration cost.

Q061

SEO Metadata

Discoverability

Answer Shape

Use crawlable semantic content, metadata, canonical URLs, social previews, structured data, sitemap, and performance.

Avoid Saying

Do not treat SEO as only title tags.

Q062

Frontend Auth

Session lifecycle

Answer Shape

Handle login, restore, refresh, protected routes, storage trade-offs, logout cleanup, and secure error states.

Avoid Saying

Do not store sensitive long-lived tokens in JS-readable storage casually.

Q063

Authorization

Capability-aware UI

Answer Shape

Frontend reflects capabilities, while the backend enforces authorization. Prefer capability checks over scattered role checks.

Avoid Saying

Do not rely on hidden buttons as security.

Q064

Micro Frontends

Independent delivery

Answer Shape

Micro frontends split ownership and deployment, but add integration, consistency, performance, and testing overhead.

Avoid Saying

Do not choose micro frontends only because the codebase is large.

Q065

Module Federation

Runtime composition

Answer Shape

A host loads remote modules at runtime; shared dependencies, compatibility, fallbacks, and monitoring are critical.

Avoid Saying

Do not share every dependency blindly or ignore remote loading failure.

Q066

Monorepos

Package ownership

Answer Shape

Monorepos need clear package boundaries, ownership, dependency rules, build caching, and affected tests.

Avoid Saying

Do not let shared packages become dumping grounds.

Q067

Frontend CI/CD

Safe releases

Answer Shape

CI/CD validates, builds, previews, deploys, monitors, and supports rollback with traceable release metadata.

Avoid Saying

Do not treat deployment success as release success.

Q068

Docker Basics

Portable runtime

Answer Shape

Docker images package runtime dependencies; containers run images; frontend teams must separate public build config from runtime secrets.

Avoid Saying

Do not bake secrets into client bundles or containers.

Q069

CDN and Edge

Global asset delivery

Answer Shape

CDNs cache assets near users; hashed assets can be immutable, while HTML and personalized data need careful freshness rules.

Avoid Saying

Do not cache personalized data or delete old chunks casually.

Q070

Feature Flags

Controlled rollout

Answer Shape

Flags decouple deploy from release and support targeting, experiments, progressive rollout, kill switches, and cleanup.

Avoid Saying

Do not leave stale flags forever or use client flags as authorization.

Q071

Dashboard Design

Complex app architecture

Answer Shape

Design dashboards from users, data freshness, permissions, URL filters, caching, charts, tables, performance, and telemetry.

Avoid Saying

Do not start with components before clarifying data and scale.

Q072

Data Grids

Dense data UX

Answer Shape

Use server/client operation rules, virtualization, accessible navigation, stable columns, URL state, and measured rendering.

Avoid Saying

Do not render thousands of rows without measuring DOM and interaction cost.

Q073

Offline Sync

Resilient distributed UX

Answer Shape

Offline-first needs local persistence, queued writes, idempotency, retry, conflict policy, and visible sync status.

Avoid Saying

Do not pretend offline sync is just localStorage plus retry.

Q074

Trade-Off Communication

Decision clarity

Answer Shape

Explain context, options, constraints, trade-offs, recommendation, rollout, metric, and fallback.

Avoid Saying

Do not present only one option or hide uncertainty.

Q075

Interview Storytelling

Evidence-based stories

Answer Shape

Use context, constraints, action, trade-off, result, and reflection with measurable impact and honest ownership.

Avoid Saying

Do not list technologies without explaining decisions and impact.