Frontend Interview Questions 2026: React, JavaScript, and System Design
Comprehensive guide to frontend engineering interviews covering React hooks, JavaScript internals, CSS layout, performance optimization, and frontend system design — with 50+ real interview questions asked at top companies.
The Frontend Interview Landscape in 2026
Frontend engineering interviews have become significantly more comprehensive. Companies now evaluate across 5 distinct areas:
- JavaScript/TypeScript fundamentals (30% weight at most companies)
- React or framework expertise (25%)
- Frontend system design (20% — increasingly important)
- CSS/HTML and browser knowledge (15%)
- Performance and accessibility (10%)
The biggest change in 2026: Frontend system design is now asked at mid-level roles (not just senior), and TypeScript is expected by default at most companies.
JavaScript Core Concepts (Must-Know)
Closures and Lexical Scope
Every frontend interview tests closure understanding. You must be able to:
- Explain what a closure is in one sentence
- Predict the output of closure-based code
- Build solutions using closures (debounce, throttle, memoize)
Definition: A closure is a function that remembers the variables from its lexical scope even after the outer function has returned.
Classic interview question:
"Implement a function createCounter() that returns an object with increment(), decrement(), and getCount() methods."
This tests: closures for private state, module pattern, encapsulation without classes.
Event Loop, Microtasks, and Macrotasks
What you must know:
- JavaScript is single-threaded with an event loop
- Microtasks (Promise.then, queueMicrotask) run BEFORE macrotasks (setTimeout, setInterval)
- The event loop processes ALL microtasks before moving to the next macrotask
- async/await is syntactic sugar over Promises (microtask queue)
Classic interview question:
"What is the output order of: console.log, setTimeout, Promise.resolve.then, queueMicrotask?"
Prototypes and 'this' Binding
The 4 rules of 'this':
- Default binding:
this= window/undefined (strict mode) - Implicit binding:
obj.method()→this= obj - Explicit binding:
call(),apply(),bind()→this= specified object newbinding:this= newly created object
Arrow functions: Lexically bind this from the enclosing scope. Cannot be rebound.
ES6+ Features to Know Cold
- Destructuring (objects, arrays, nested, defaults)
- Spread/Rest operators
- Optional chaining (?.) and nullish coalescing (??)
- WeakMap/WeakSet (for memory-safe caching)
- Generators and iterators (less common but asked at senior levels)
- Proxy and Reflect (Meta/framework-level questions)
React Deep Dives (2026 Edition)
Hooks — Beyond Basic Usage
useState pitfalls:
- State updates are batched in React 18+ (even in setTimeout!)
- Setter functions with callbacks:
setState(prev => prev + 1)for correctness in async contexts - Lazy initialization:
useState(() => expensiveComputation())
useEffect mastery:
- Empty dependency array = componentDidMount equivalent
- Return function = cleanup (componentWillUnmount equivalent)
- Object dependencies cause infinite re-renders (use primitive values or useMemo)
- Race conditions in async useEffect (AbortController pattern)
useMemo and useCallback:
- useMemo: memoize computed VALUES. Use when computation is expensive.
- useCallback: memoize FUNCTIONS. Use when passing callbacks to memoized children.
- Common mistake: using them everywhere. They have overhead — only optimize when you measure a performance issue.
useRef:
- Persists across renders without causing re-renders
- DOM refs (accessing elements imperatively)
- Storing mutable values (previous state, timer IDs, instance variables)
Custom Hooks — Design Principles
Custom hooks are the backbone of reusable stateful logic. Interview questions:
- "Implement useDebounce(value, delay)"
- "Implement useLocalStorage(key, initialValue)"
- "Implement useIntersectionObserver()"
- "Implement useFetch with loading, error, and caching"
Key principles:
- Start with "use" prefix
- Can call other hooks
- Share logic, not state (each component gets its own instance)
- Should be testable in isolation
React 19 Server Components
What you must understand:
- Server Components render on the server, send HTML (not JS) to the client
- Client Components (marked with 'use client') run in the browser
- Server Components can access databases, file system, and secrets directly
- You CANNOT use hooks or browser APIs in Server Components
- The boundary between server and client components is explicit and important
Interview question: "When would you use a Server Component vs a Client Component?"
Answer framework: Use Server Components for data fetching, static content, and large dependencies. Use Client Components for interactivity (forms, animations, browser APIs, state).
State Management Patterns
When to use what:
useState: Local component state (form inputs, toggles, UI state)useReducer: Complex state with multiple sub-values or state machine logicuseContext: Shared state needed by many components (theme, auth, locale)- External store (Zustand/Redux): Global app state, server cache, cross-cutting concerns
- React Query/SWR: Server state (API data with caching, refetching, stale-while-revalidate)
Interview question: "You have a dashboard with 10 widgets that all need user preferences. How do you manage this state?"
Frontend System Design (The Differentiator)
What Frontend System Design Tests
Unlike backend system design, frontend system design focuses on:
- Component architecture and data flow
- State management strategy
- Performance optimization (rendering, bundle size, lazy loading)
- Error handling and resilience
- Accessibility and internationalization
- Offline support and caching
Common Frontend System Design Questions
- Design an autocomplete/search component
- Key considerations: debouncing, caching, keyboard navigation, accessibility, handling slow networks
- Design an infinite scroll feed (like Twitter/Instagram)
- Key considerations: virtualization, data fetching strategy, scroll position restoration, memory management
- Design a real-time collaborative editor (like Google Docs)
- Key considerations: conflict resolution (OT vs CRDT), cursor synchronization, offline support
- Design a form builder with validation
- Key considerations: schema-driven rendering, custom validation rules, conditional fields, performance with 100+ fields
- Design a notification system (frontend architecture)
- Key considerations: WebSocket vs polling, priority queues, read/unread state, cross-tab synchronization
Framework for Frontend System Design Answers
- Clarify requirements — Features, scale (how many items/users), performance requirements
- Component hierarchy — Draw the component tree, identify smart vs presentational components
- Data flow — Where does state live? How does data flow between components?
- API design — What endpoints do you need? What's the response shape?
- Performance considerations — Lazy loading, code splitting, virtualization, caching
- Edge cases — Error states, loading states, empty states, offline behavior
CSS and Layout (Don't Neglect This)
Many senior candidates fail on CSS. You must know:
Flexbox (asked in 90% of frontend interviews)
display: flex,flex-direction,justify-content,align-itemsflex-grow,flex-shrink,flex-basis— what each does- Centering (horizontally, vertically, both)
- Common patterns: sticky footer, holy grail layout, responsive nav
CSS Grid
grid-template-columns,grid-template-rowsfrunits,repeat(),minmax()- Named grid areas
- When to use Grid vs Flexbox (Grid = 2D layouts, Flexbox = 1D alignment)
Performance-Related CSS
will-changeand composite layerscontainproperty for rendering optimization- CSS animations vs JavaScript animations (CSS is GPU-accelerated)
- Critical rendering path (how CSS blocks rendering)
Performance Optimization
Core Web Vitals (Google ranking factors)
- LCP (Largest Contentful Paint): < 2.5s. Optimize with: image loading, font loading, server response time
- FID/INP (Interaction to Next Paint): < 200ms. Optimize with: code splitting, reducing main thread work
- CLS (Cumulative Layout Shift): < 0.1. Optimize with: explicit dimensions, font-display: swap
React-Specific Performance
- React.memo for expensive components
- useMemo/useCallback for expensive computations/callbacks
- Code splitting with React.lazy and Suspense
- Virtualization for long lists (react-window, @tanstack/virtual)
- Avoiding unnecessary re-renders (proper key usage, stable references)
Bundle Size Optimization
- Tree shaking (ensure ESM imports)
- Dynamic imports for route-based code splitting
- Analyzing bundle with webpack-bundle-analyzer
- Replacing large libraries with lighter alternatives
Accessibility (a11y) — The Differentiator
Companies increasingly evaluate accessibility knowledge:
- Semantic HTML: Use
<button>not<div onClick>. Use<nav>,<main>,<article>. - ARIA:
aria-label,aria-expanded,aria-live(for dynamic content),roleattributes - Keyboard navigation: All interactive elements must be keyboard-accessible. Focus management in modals/dialogs.
- Color contrast: 4.5:1 minimum for normal text, 3:1 for large text
- Screen reader testing: How does your component sound when read aloud?
20 High-Frequency Interview Questions
- Explain the event loop and how async operations work in JavaScript
- What is the difference between == and ===?
- Implement a debounce function from scratch
- How does React's reconciliation algorithm work?
- Explain the Virtual DOM and its benefits
- What are React's rules of hooks? Why do they exist?
- How would you optimize a React component that re-renders too often?
- Implement a custom useLocalStorage hook
- Explain CSS specificity rules
- How does Flexbox alignment work? Center a div both horizontally and vertically.
- What happens when you type a URL in the browser? (Full lifecycle)
- How would you implement infinite scroll with virtualization?
- Explain CORS — what is it and how do you handle it?
- What is tree shaking and how does it work?
- How do you prevent XSS attacks in a React application?
- Explain the difference between Server Components and Client Components
- How would you handle error boundaries in React?
- Implement a simple pub/sub event system
- How does React Query / SWR differ from useEffect for data fetching?
- Design a responsive image gallery component (system design)
Frequently Asked Questions
What are the most common React interview questions in 2026?
The most frequently asked React questions in 2026 are: (1) How hooks work internally and their rules, (2) State management strategies and when to use Context vs external stores, (3) Performance optimization with useMemo, useCallback, and React.memo, (4) Server Components vs Client Components in React 19, (5) Custom hook design patterns, and (6) Error boundaries and Suspense for error/loading handling.
Do I need to know TypeScript for frontend interviews?
Yes. As of 2026, TypeScript is expected by default at most companies. You should be comfortable with: basic types, interfaces vs types, generics, utility types (Partial, Pick, Omit, Record), discriminated unions, and typing React components (props, events, refs). Companies like Google, Meta, and Stripe specifically test TypeScript proficiency.
How important is CSS knowledge in frontend interviews?
Very important and often underestimated. Most frontend interviews include at least one CSS/layout question. You must know Flexbox and Grid layout, responsive design principles, CSS specificity, and common patterns (centering, sticky elements, holy grail layout). Many candidates fail on "simple" CSS tasks because they rely too heavily on frameworks.
What is frontend system design and how do I prepare for it?
Frontend system design tests your ability to architect complex UI systems — component hierarchies, state management, data flow, performance optimization, and error handling at scale. Common questions include designing an autocomplete, infinite scroll feed, or collaborative editor. Prepare by: practicing component decomposition, understanding rendering performance, and doing mock interviews focused on frontend architecture.