Last Minute PrepFrontend 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.
Q001Browser URL Lifecycle
Navigation pipeline
Answer ShapeParse URL, check cache and policy, resolve DNS, connect, negotiate TLS, request, stream HTML, parse, render, execute JavaScript, hydrate, and interact.
Avoid SayingDo not stop at DNS and HTTP. Include rendering, security, and Web Vitals.
Q002V8 JavaScript Engine
Tiered execution
Answer ShapeV8 parses source, creates bytecode, runs Ignition, profiles hot paths, optimizes with TurboFan, and de-optimizes when assumptions fail.
Avoid SayingDo not say JavaScript is only interpreted or TypeScript makes runtime faster.
Q003Execution Context
Runtime environment
Answer ShapeExecution context contains lexical bindings, variable bindings, and this. Function calls create contexts that are pushed onto the call stack.
Avoid SayingDo not say hoisting physically moves code.
Q004Call Stack
Active execution
Answer ShapeThe call stack tracks active frames. Function calls push frames; returns and thrown errors pop frames. Async waiting happens outside the stack.
Avoid SayingDo not say async work stays on the stack while waiting.
Answer ShapeThe heap stores objects and dynamic data. Garbage collection reclaims unreachable objects; leaks happen when unused objects remain reachable.
Avoid SayingDo not say garbage collection prevents memory leaks.
Answer ShapeThe event loop runs a task, drains microtasks after the stack clears, gives rendering a chance, then picks the next task.
Avoid SayingDo not say async means parallel execution on the main thread.
Q007Microtasks vs Macrotasks
Queue priority
Answer ShapePromise callbacks and queueMicrotask are microtasks. Timers and user events are tasks. Microtasks drain before the next task and before rendering.
Avoid SayingDo not treat promises as a background thread.
Q008Critical Rendering Path
Pixels pipeline
Answer ShapeHTML builds DOM, CSS builds CSSOM, both form the render tree, then layout, paint, and composite produce pixels.
Avoid SayingDo not ignore render-blocking CSS, parser-blocking scripts, or LCP priority.
Q009DOM and CSSOM
Browser object models
Answer ShapeDOM represents document structure. CSSOM represents parsed style rules. The browser combines them to compute the render tree.
Avoid SayingDo not say the DOM is what users see. Users see pixels after layout, paint, and compositing.
Q010Layout, Reflow, Paint and Compositing
Rendering cost stages
Answer ShapeLayout calculates geometry, paint records visuals, and compositing assembles layers. Reflow is layout recalculation after a geometry-affecting change.
Avoid SayingDo not call every rendering problem a repaint. Separate layout, paint, and composite costs.
Answer ShapeUse Web Storage for small string data, IndexedDB for large structured data, Cache Storage for request/response caching, and cookies for server-visible state.
Avoid SayingDo not store sensitive tokens in localStorage without discussing XSS risk.
Answer ShapeCookies are automatically sent with matching requests. HttpOnly blocks JS reads, Secure requires HTTPS, and SameSite controls cross-site sending.
Avoid SayingDo not say HttpOnly prevents XSS; it only prevents cookie reads.
Q013DOM Events and Event Delegation
Interaction flow
Answer ShapeEvents move through capture, target, and bubble phases. Delegation attaches a listener to an ancestor and handles child events through target checks.
Avoid SayingDo not confuse target with currentTarget or assume every event bubbles.
Q014Script Loading
Discovery and execution
Answer ShapeClassic scripts block parsing, defer preserves order after parsing, async executes when ready, and module scripts are deferred by default.
Avoid SayingDo not use async for ordered dependencies or preload every resource.
Q015Web Workers
Main-thread protection
Answer ShapeWorkers run JavaScript off the main thread and communicate with postMessage. They cannot directly access the DOM.
Avoid SayingDo not move tiny work to workers without measuring message overhead.
Answer ShapeService workers run separately from the page, intercept fetches after activation, and can serve cache, network, or offline fallbacks.
Avoid SayingDo not treat service workers like normal workers or cache every response with one rule.
Q017HTTP Caching
Freshness and validation
Answer ShapeCache-Control defines storage and freshness. ETag and Last-Modified enable conditional requests that can return 304 without a body.
Avoid SayingDo not confuse no-cache with no-store or put long immutable caching on HTML.
Q018CORS
Browser read permission
Answer ShapeCORS lets servers opt in to cross-origin response reads. The browser enforces it with allow headers and preflight checks.
Avoid SayingDo not call CORS authentication or try to fix every CORS issue only in React.
Answer ShapeFetch resolves on HTTP responses, rejects on network or abort failures, and needs response.ok checks plus AbortController for stale work.
Avoid SayingDo not assume fetch rejects on 404 or let old search results overwrite newer state.
Q020Realtime Transports
Direction and latency
Answer ShapePolling pulls updates, SSE streams server-to-client events, and WebSockets provide bidirectional persistent messaging.
Avoid SayingDo not choose WebSockets by default when SSE or polling satisfies the product need.
Answer ShapeCollect browser performance, errors, resources, interactions, and custom marks with route, device, release, and privacy context.
Avoid SayingDo not rely only on Lighthouse or collect telemetry without a debugging use case.
Q022Core Web Vitals
Field attribution
Answer ShapeLCP measures loading, INP responsiveness, and CLS visual stability. Debug with field data, route context, release, and attribution.
Avoid SayingDo not stop at metric names or rely only on lab scores.
Q023Modules and Bundling
Dependency graph cost
Answer ShapeBundlers build dependency graphs, transform source, split chunks, tree-shake safe exports, and emit hashed browser assets.
Avoid SayingDo not focus only on compressed size; parse and execution cost matter.
Q024Rendering Debugging
Trace evidence
Answer ShapeUse browser traces to separate scripting, style recalculation, layout, paint, compositing, and frame presentation costs.
Avoid SayingDo not call every visual problem a repaint or guess without a trace.
Q025Memory Profiling
Retained references
Answer ShapeLeaks happen when unused objects remain reachable. Compare heap snapshots and inspect retaining paths to find the reference.
Avoid SayingDo not blame garbage collection when code still retains objects.
Q026XSS and CSP
Safe rendering
Answer ShapePrevent XSS with safe rendering, context-aware encoding, sanitizer-controlled rich text, token protection, and CSP defense in depth.
Avoid SayingDo not say React prevents all XSS or that CSP replaces sanitization.
Q027CSRF and Isolation
Cross-site browser risk
Answer ShapeCSRF abuses ambient cookies, clickjacking abuses framed UI, and isolation headers reduce cross-origin attack surface.
Avoid SayingDo not confuse CORS with CSRF protection.
Q028Accessibility Foundations
Semantic usable UI
Answer ShapeUse semantic HTML, keyboard support, visible focus, labels, contrast, accessible errors, and careful ARIA.
Avoid SayingDo not reduce accessibility to adding aria labels at the end.
Q029Forms and Validation
Input lifecycle
Answer ShapeGood forms combine semantic controls, client feedback, server validation, duplicate protection, accessible errors, and recovery.
Avoid SayingDo not trust client validation or clear input after failed requests.
Q030Responsive Media
Right asset delivery
Answer ShapeUse responsive candidates, dimensions, modern formats, CDN delivery, lazy loading for non-critical media, and priority for LCP.
Avoid SayingDo not ship one huge image to every device or lazy-load the LCP image.
Q031I18n and L10n
Global-ready UI
Answer ShapeUse message catalogs, plural rules, locale formatting, RTL support, fallbacks, and text expansion testing.
Avoid SayingDo not concatenate translated strings or assume English layout.
Answer ShapePut shareable, reloadable, restorable view state in the URL and use history updates that preserve back-button expectations.
Avoid SayingDo not hide important filters only in memory or push history on every keystroke.
Q033Back Forward Cache
Restored navigation
Answer Shapebfcache stores a frozen page snapshot for instant back/forward navigation when the page avoids blockers.
Avoid SayingDo not add unload handlers casually or assume every visit is a fresh load.
Q034File Upload UX
Reliable file workflows
Answer ShapeUse native input fallback, validation, progress, cancellation, retry, accessible drop zones, and server-side enforcement.
Avoid SayingDo not trust client validation or make drag-and-drop the only path.
Q035Capability APIs
Permission-aware UX
Answer ShapeClipboard, drag, and permission APIs need secure contexts, user gestures, feature detection, fallback UX, and privacy care.
Avoid SayingDo not assume capability APIs always work or that permission is guaranteed.
Q036Motion Performance
Responsive motion
Answer ShapeUse CSS transitions, keyframes, or WAAPI as needed; prefer transform and opacity; respect reduced motion.
Avoid SayingDo not animate layout-heavy properties or ignore interruption.
Q037CSS Architecture
Predictable styling
Answer ShapeManage cascade, layers, specificity, tokens, component boundaries, and override rules to avoid styling fights.
Avoid SayingDo not solve every conflict with !important or high-specificity selectors.
Q038Flexbox and Grid
Responsive layout
Answer ShapeUse flexbox for one-dimensional layout, grid for two-dimensional layout, and intrinsic constraints for resilient responsive UI.
Avoid SayingDo not build fixed layouts that break with long text, zoom, or localization.
Q039Design Systems
Shared UI infrastructure
Answer ShapeDesign systems combine tokens, component contracts, accessibility rules, documentation, and governance.
Avoid SayingDo not treat a component library alone as a design system.
Q040Theming
Preference-aware tokens
Answer ShapeUse semantic tokens, CSS variables, system preference, user override, persistence, and contrast checks.
Avoid SayingDo not invert colors mechanically or ignore dark-mode states.
Q041Client Data Caching
Fresh server state
Answer ShapeDefine cache keys, stale time, refetch triggers, invalidation, optimistic updates, rollback, and error recovery.
Avoid SayingDo not treat server state like local UI state.
Q042State Management
State ownership
Answer ShapePlace state by owner and lifetime: local UI, server cache, URL, derived values, persistent settings, or global app state.
Avoid SayingDo not duplicate sources of truth or put every value in a global store.
Q043Error Boundaries
Graceful failure
Answer ShapeUse boundaries, route fallbacks, async error states, retry UX, and logging so one failure does not blank the app.
Avoid SayingDo not use one global error screen for every failure.
Q044Testing Strategy
Confidence layers
Answer ShapeUse unit, integration, E2E, accessibility, visual, contract, and monitoring checks according to user risk.
Avoid SayingDo not chase snapshots while missing critical user flows.
Q045Playwright
Real browser flows
Answer ShapeUse resilient locators, isolated data, traces, screenshots, and focused critical journeys for trustworthy E2E tests.
Avoid SayingDo not rely on brittle selectors, sleeps, or giant all-in-one tests.
Q046TypeScript Basics
Static contracts
Answer ShapeTypeScript models compile-time contracts, improves refactors, and catches invalid shapes, but runtime data still needs validation.
Avoid SayingDo not claim TypeScript validates external JSON at runtime.
Q047Type Narrowing
Safe branching
Answer ShapeUse narrowing and discriminated unions to model valid UI states and protect refactors with exhaustive checks.
Avoid SayingDo not model every state with optional fields.
Answer ShapeGenerics preserve relationships between inputs and outputs, while utility types transform reusable contracts.
Avoid SayingDo not over-genericize code until simple logic becomes unreadable.
Q049Runtime Validation
Trust boundaries
Answer ShapeValidate external data at runtime because TypeScript types are erased and cannot prove JSON shape.
Avoid SayingDo not assign response.json directly to a trusted domain type.
Q050React Rendering
Render vs commit
Answer ShapeReact renders components to compute UI, reconciles trees, and commits necessary host changes; keys preserve identity.
Avoid SayingDo not say React replaces the whole DOM on every state update.
Q051React State Flow
Ownership
Answer ShapeProps pass data down, state owns changing local values, and clear source-of-truth choices prevent stale UI.
Avoid SayingDo not copy props into state without a synchronization reason.
Q052React Effects
External sync
Answer ShapeEffects synchronize React with external systems and need correct dependencies, cleanup, and stale async handling.
Avoid SayingDo not use effects for pure derived values.
Q053React Memoization
Measured optimization
Answer ShapeUse memo, useMemo, and useCallback when profiler evidence shows meaningful render or calculation cost.
Avoid SayingDo not wrap everything in memoization without measuring.
Q054React Forms
Input ownership
Answer ShapeControlled inputs are owned by React state; uncontrolled inputs are owned by the DOM and read when needed.
Avoid SayingDo not force every field into React state when native behavior is enough.
Q055React Composition
Reusable UI contracts
Answer ShapeUse children, slots, compound components, render props, and controlled APIs to keep reusable UI flexible.
Avoid SayingDo not create giant boolean-prop configuration components.
Q056React Context
Scoped shared values
Answer ShapeContext shares values in a subtree; keep provider scope tight and values stable to avoid broad re-renders.
Avoid SayingDo not put frequently changing large state in one global context.
Q057React Profiling
Evidence-based fixes
Answer ShapeUse React Profiler and browser traces to separate render cost, commit cost, layout, paint, and data processing.
Avoid SayingDo not optimize React before measuring the real bottleneck.
Q058Suspense and Streaming
Async boundaries
Answer ShapeSuspense coordinates loading at boundaries; streaming progressively reveals useful UI before everything is ready.
Avoid SayingDo not use one global spinner for every async operation.
Q059Next.js App Router
Route architecture
Answer ShapeApp Router uses route segments, layouts, pages, loading/error files, Server Components, and intentional Client Components.
Avoid SayingDo not mark broad layouts as client components without need.
Q060Rendering Strategies
Freshness vs speed
Answer ShapeSSR is per request, SSG is build-time, ISR balances static speed with freshness, and hydration adds client cost.
Avoid SayingDo not choose SSR for everything or ignore hydration cost.
Q061SEO Metadata
Discoverability
Answer ShapeUse crawlable semantic content, metadata, canonical URLs, social previews, structured data, sitemap, and performance.
Avoid SayingDo not treat SEO as only title tags.
Q062Frontend Auth
Session lifecycle
Answer ShapeHandle login, restore, refresh, protected routes, storage trade-offs, logout cleanup, and secure error states.
Avoid SayingDo not store sensitive long-lived tokens in JS-readable storage casually.
Q063Authorization
Capability-aware UI
Answer ShapeFrontend reflects capabilities, while the backend enforces authorization. Prefer capability checks over scattered role checks.
Avoid SayingDo not rely on hidden buttons as security.
Q064Micro Frontends
Independent delivery
Answer ShapeMicro frontends split ownership and deployment, but add integration, consistency, performance, and testing overhead.
Avoid SayingDo not choose micro frontends only because the codebase is large.
Q065Module Federation
Runtime composition
Answer ShapeA host loads remote modules at runtime; shared dependencies, compatibility, fallbacks, and monitoring are critical.
Avoid SayingDo not share every dependency blindly or ignore remote loading failure.
Q066Monorepos
Package ownership
Answer ShapeMonorepos need clear package boundaries, ownership, dependency rules, build caching, and affected tests.
Avoid SayingDo not let shared packages become dumping grounds.
Q067Frontend CI/CD
Safe releases
Answer ShapeCI/CD validates, builds, previews, deploys, monitors, and supports rollback with traceable release metadata.
Avoid SayingDo not treat deployment success as release success.
Q068Docker Basics
Portable runtime
Answer ShapeDocker images package runtime dependencies; containers run images; frontend teams must separate public build config from runtime secrets.
Avoid SayingDo not bake secrets into client bundles or containers.
Q069CDN and Edge
Global asset delivery
Answer ShapeCDNs cache assets near users; hashed assets can be immutable, while HTML and personalized data need careful freshness rules.
Avoid SayingDo not cache personalized data or delete old chunks casually.
Q070Feature Flags
Controlled rollout
Answer ShapeFlags decouple deploy from release and support targeting, experiments, progressive rollout, kill switches, and cleanup.
Avoid SayingDo not leave stale flags forever or use client flags as authorization.
Q071Dashboard Design
Complex app architecture
Answer ShapeDesign dashboards from users, data freshness, permissions, URL filters, caching, charts, tables, performance, and telemetry.
Avoid SayingDo not start with components before clarifying data and scale.
Answer ShapeUse server/client operation rules, virtualization, accessible navigation, stable columns, URL state, and measured rendering.
Avoid SayingDo not render thousands of rows without measuring DOM and interaction cost.
Q073Offline Sync
Resilient distributed UX
Answer ShapeOffline-first needs local persistence, queued writes, idempotency, retry, conflict policy, and visible sync status.
Avoid SayingDo not pretend offline sync is just localStorage plus retry.
Q074Trade-Off Communication
Decision clarity
Answer ShapeExplain context, options, constraints, trade-offs, recommendation, rollout, metric, and fallback.
Avoid SayingDo not present only one option or hide uncertainty.
Q075Interview Storytelling
Evidence-based stories
Answer ShapeUse context, constraints, action, trade-off, result, and reflection with measurable impact and honest ownership.
Avoid SayingDo not list technologies without explaining decisions and impact.