Frontend Developer interview questions
100 real questions with model answers and explanations for Senior candidates.
See a Frontend Developer resume example →Questions
I treat it as a data-driven decision, not trend-chasing.
- Map the team's real pain points against what the framework actually solves, not its marketing.
- Build a small proof-of-concept on the riskiest integration points; measure bundle size, runtime performance, and developer ergonomics.
- Present that data alongside migration cost, training time, and ecosystem maturity.
- If the numbers don't clearly justify the switch, improve the existing stack incrementally.
Why interviewers ask this: The interviewer wants to see structured decision-making under uncertainty, not enthusiasm for novelty. A weak answer names benefits of the framework; a strong answer shows a repeatable evaluation process.
I used a strangler-fig migration that ran alongside normal delivery.
- New features were built in the target architecture while a shared adapter layer let old and new code coexist.
- Both ran in parallel behind a feature flag, so QA validated each migrated section independently.
- Over six months every critical path moved over, then we deleted the adapter layer.
- Feature delivery never paused because no sprint was blocked on migration.
Why interviewers ask this: Seniors are expected to manage migration risk without freezing product roadmaps. The interviewer checks whether the candidate understands incremental migration patterns and cross-team coordination.
I favor composition over configuration and design around real consumers.
- Build small, focused primitives users assemble rather than one component with thirty props.
- Treat the first two or three real consumers as the design input and extract shared interfaces into types.
- Keep escape hatches like renderProp or slot patterns so consumers override behavior without forking.
- Hide internal implementation behind a stable public surface so I can refactor internals without breaking callers.
Why interviewers ask this: This tests API design judgment. The interviewer distinguishes candidates who think about the component from the consumer's perspective versus those who optimize for the initial implementation.
I map each route to the rendering strategy that fits its content, not one strategy for the whole app.
- SSR fits frequently changing, personalized content but adds server cost and caching complexity.
- SSG wins for mostly stable content because it shifts work to build time and gives very fast TTFB.
- CSR is fine for authenticated dashboards where SEO is irrelevant, but it harms initial load.
Why interviewers ask this: Seniors make rendering decisions at the route level, not the app level. The interviewer checks whether the candidate understands the performance, SEO, and operational consequences of each approach.
I set concrete numbers, enforce them in CI, and document the rationale.
- Define hard limits, for example a 200 KB compressed initial JS bundle and LCP under 2.5 seconds on a mid-range device.
- Wire those numbers into CI so a pull request that exceeds the budget fails the build.
- Record the rationale in a shared ADR so teams understand why the limit exists.
- Review thresholds quarterly as the product evolves.
Why interviewers ask this: The interviewer is testing whether the candidate can translate performance goals into enforceable engineering practices, not just aspirations.
The event loop runs one task at a time, then drains microtasks before rendering, which shapes how I schedule work.
- Long synchronous tasks block the loop and make the page unresponsive.
- I break expensive computations into chunks with requestIdleCallback or scheduler.postTask.
- I defer non-critical work to microtasks via Promise.resolve.
- I avoid synchronous DOM reads and writes in the same task to prevent layout thrashing.
Why interviewers ask this: This question separates developers who have used performance tools from those who understand why the browser behaves as it does, which is essential for diagnosing subtle jank.
I build accessibility in from the start using ARIA authoring practices and real assistive-tech testing.
- Start with ARIA authoring practices to define expected keyboard navigation and role semantics for each pattern.
- Give every interactive component a focus management contract: where focus lands on open and on close.
- Test keyboard-only first, then with VoiceOver and NVDA, because the ARIA spec and real browsers diverge.
- Put accessibility requirements into each component's Storybook story as acceptance criteria, not a separate audit.
Why interviewers ask this: Accessibility is a design and engineering discipline, not a checklist. The interviewer is checking whether the candidate builds it in from the start or treats it as a post-shipping concern.
I sort state into categories and keep their boundaries sharp; the library matters less than that discipline.
- Server cache goes to React Query or SWR, global UI state to Zustand or a minimal Context, local ephemeral state to useState.
- Sharp boundaries prevent syncing server data into a global store and then managing staleness by hand.
- I compute derived state rather than storing it, which eliminates whole classes of sync bugs.
Why interviewers ask this: The interviewer is checking whether the candidate designs state architecture or just reaches for Redux because it is familiar. A strong answer names specific trade-offs between categories.
I follow semantic versioning strictly and make every breaking change easy to absorb.
- Any prop removal or behavior change is a major version bump.
- I send a deprecation notice in the previous minor version, with a codemod where feasible.
- I keep a CHANGELOG with migration guides, not just a diff.
- For large teams I run an office-hours session so consumers can ask questions before upgrading.
Why interviewers ask this: This tests whether the candidate thinks about library maintenance as a product responsibility, not just a code task. Communication and migration support are as important as the technical change.
I find the cause before applying any fix, working from the profiler down.
- Start in the browser profiler to see whether the bottleneck is JavaScript, layout/paint, or network.
- If it is JavaScript, use the React DevTools Profiler to find what re-renders and why.
- The usual culprits are inline object or function literals, missing memoization on expensive values, or a context broadcasting to too many consumers.
- I fix the cause rather than wrapping everything in memo as a patch.
Why interviewers ask this: The interviewer wants to see a systematic diagnostic process, not a list of optimization tricks. A weak answer immediately suggests memo or useMemo without measuring first.
I use a three-tier token system fed from a single source of truth.
- Primitive tokens encode raw values like colors and spacing; semantic tokens map to roles like background-primary; component tokens reference the semantic ones.
- Themes swap only the semantic layer, so a dark theme redefines semantic tokens while primitives stay unchanged.
- I generate tokens from one source, usually Figma Variables or a JSON schema.
- I distribute them as CSS custom properties or platform constants through an automated build step.
Why interviewers ask this: This tests whether the candidate understands token architecture rather than just token usage. The tier structure and the separation of primitive from semantic is the key insight.
I split by route and lazy-load heavy dependencies, guided by bundle analysis.
- Analyze the bundle with webpack-bundle-analyzer to find large deps not needed on the initial route.
- Use React.lazy and Suspense to split each route into its own chunk.
- Put heavy third-party libraries like a charting library behind a dynamic import inside the component that needs them.
- Watch for shared chunk bloat: if every route pulls the same large vendor, revisit lazy-loading or replacing it.
Why interviewers ask this: Code splitting is a well-known technique, but seniors explain the analysis step and the edge cases, not just the React.lazy API.
I keep E2E thin, deterministic, and reserved for critical journeys.
- Limit E2E to critical journeys like authentication and checkout; cover the rest with faster unit and integration tests.
- Run each test against a deterministic environment with seeded data so it doesn't depend on external services.
- Assert only observable outcomes, never implementation details.
- Quarantine flaky tests immediately, because known failures train teams to ignore red builds.
Why interviewers ask this: The interviewer is testing whether the candidate respects the testing pyramid and understands what E2E tests are best suited for, rather than over-investing in slow browser tests.
My main tools are documentation paired with visible proof and making the right path the default.
- To push accessibility-first work, I ran a two-hour workshop with real screen reader demos, then published a concise guide in the shared wiki.
- I made compliance easy by adding ESLint jsx-a11y rules to the shared config, so the right path became the default.
- I tracked adoption informally and recognized teams that shipped accessible components.
- That created social momentum without requiring mandates.
Why interviewers ask this: Influence at senior level is organizational, not just technical. The interviewer is checking whether the candidate uses systems thinking to change defaults rather than relying on persuasion alone.
I tackle each metric separately and track them with real user monitoring, not just Lighthouse.
- For LCP, preload the hero image with link rel=preload, serve it in a modern format like AVIF, and never lazy-load it.
- For CLS, reserve explicit dimensions for every image and embed and avoid inserting dynamic content above existing content.
- For INP, profile long tasks during interactions and break them up or defer non-critical work.
- Track all three in real user monitoring because lab and field scores often diverge.
Why interviewers ask this: This tests depth of Core Web Vitals knowledge. Weak answers list the three metrics; strong answers describe specific interventions for each and distinguish lab from field measurement.
I prioritize debt by blast radius and cost to fix now versus later.
- Debt in a hot path, blocking delivery, or carrying security and accessibility risk gets fixed this quarter.
- Isolated, well-understood debt that costs only slightly more later goes to the backlog with a clear trigger for urgency.
- I resist debt drives disconnected from product work, because they rarely complete and cause context-switching pain.
Why interviewers ask this: The interviewer is checking whether the candidate makes pragmatic trade-off decisions rather than treating all tech debt as equally urgent or equally deferrable.
I build the edge-case instinct through repetition, not a single lecture.
- Review a specific PR together and ask them to narrate their reasoning aloud.
- The gap is usually the habit of asking what could go wrong before writing the happy path, not knowledge.
- Assign a structured debugging exercise on a past bug report to build that instinct.
- In later reviews, point out the missed edge case and ask for a test before merging.
Why interviewers ask this: The interviewer is checking for concrete mentoring strategies, not generic statements about patience or feedback. A good answer describes a behavioral loop, not a one-time conversation.
Cascade layers give you a controllable specificity hierarchy through the @layer rule.
- Styles in a layer declared later win over earlier layers, and un-layered styles win over any layered style by default.
- This controls priority without hacking specificity with extra selectors or !important.
- I use layers when integrating a third-party reset or UI library, putting their styles in a low-priority layer.
- That way my component styles always win without per-selector overrides.
Why interviewers ask this: This tests modern CSS knowledge. The key insight is the relationship between declaration order and layer priority, and the advantage over traditional specificity management.
Micro-frontends solve team autonomy and independent deployment, not performance.
- Recommend them only when multiple teams genuinely need independent deploys and monorepo coordination causes measurable pain.
- The costs are real: bundle duplication, shared dependency conflicts, integration test complexity, and orchestration overhead.
- For three to five frontend engineers a well-organized monorepo with clear ownership delivers the same autonomy without the operational complexity.
Why interviewers ask this: The interviewer is checking whether the candidate understands that micro-frontends are an organizational solution, not an architectural optimization, and can articulate when the cost is not justified.
The pipeline runs in gated stages and stays under eight minutes.
- Stages: install and cache deps, type-check, unit and integration tests, build, visual regression with Chromatic or Percy, deploy to a preview URL.
- Each stage must pass before the next runs.
- Preview deployments are automatic on every pull request so reviewers verify UI without checking out code.
- Main deploys to staging automatically; production promotion is a manual gate.
Why interviewers ask this: The interviewer wants to see a concrete pipeline design with opinions about speed and manual gates, not a generic description of what CI/CD is.
Locked questions
- 21
How do you handle internationalization in a large React application, including RTL layout support?
reacti18nsoft-skills - 22
What is the virtual DOM and what are its actual performance limitations?
domvirtual-domperformance - 23
How would you implement optimistic UI updates and handle rollback when the server request fails?
locking - 24
Explain how you would implement a virtualized list for rendering tens of thousands of rows efficiently.
virtualization - 25
How do you approach security in frontend code, specifically around XSS and CSRF?
xsscsrf - 26
How do you write TypeScript types that are genuinely helpful rather than just silencing the compiler?
typescript - 27
What is your process for reviewing a pull request from a less experienced developer?
code-reviewconcurrency - 28
Describe how module federation works and what problems it solves in a distributed frontend architecture.
distributedfederation - 29
How do you handle feature flags in a frontend application at scale?
soft-skillsfeature-flags - 30
Explain the difference between useMemo, useCallback, and React.memo, and when each is actually worth using.
react - 31
How would you architect a real-time collaborative feature like a shared document editor in a React app?
react - 32
What makes a good monorepo setup for a frontend-heavy codebase, and what are the common failure modes?
monorepo - 33
How do you approach testing React components that depend on complex asynchronous behavior?
reactcomponentsasync - 34
Describe the browser rendering pipeline from HTML parsing to pixels on screen.
htmlrendering - 35
How do you balance shipping fast with maintaining code quality under product pressure?
- 36
Explain the difference between authentication and authorization in a frontend context and how you handle both.
auth - 37
How would you set up error tracking and monitoring for a production frontend application?
monitoring - 38
What is the CSS containment specification and how does it improve rendering performance?
cssperformance - 39
How do you evaluate and introduce a new tool or library to your team's stack?
decision-making - 40
Describe how you would implement a robust form system with complex validation and dynamic fields.
formssystem-designvalidation - 41
How do you structure a frontend application's folder and module organization for long-term maintainability?
structure - 42
What are the trade-offs between using GraphQL and REST for a frontend-heavy product?
restgraphql - 43
How do you approach web performance for mobile users on slow networks?
performance - 44
Explain how you would implement an infinite scroll feed with good performance and accessibility.
a11yperformance - 45
How do you handle data normalization on the frontend and why does it matter?
soft-skillsnormalization - 46
How do you communicate technical risk to non-technical stakeholders?
communication - 47
What is the difference between layout, paint, and composite in browser rendering, and why does it matter for animations?
rendering - 48
How would you migrate a large application from JavaScript to TypeScript without blocking the team?
typescriptjavascript - 49
How do you ensure consistent behavior across browsers and devices for a production application?
- 50
Describe a time a feature you built had an unexpected negative impact and how you handled it.
- 51
What is your approach to documenting a component library so that other developers actually use the docs?
components - 52
How does the JavaScript garbage collector work and how can poor data structure choices cause memory leaks in a browser application?
memorygcjavascript - 53
How do you approach writing shared utilities that are genuinely reusable without becoming a kitchen sink?
- 54
Explain the difference between hydration and rendering in a Next.js application and the common pitfalls.
hydrationnextjs - 55
How do you handle CSS-in-JS at scale and when would you recommend against it?
soft-skillscss - 56
What is your strategy for keeping dependencies up to date without breaking production?
dependencies - 57
How do you use web workers to improve performance in a browser application?
web-workerperformance - 58
Describe how you would build a complex drag-and-drop interface that also works for keyboard users.
types - 59
How do you approach progressive enhancement versus graceful degradation in modern frontend development?
- 60
How do you handle loading states and skeleton screens without creating layout shift?
soft-skillsuxweb-vitals - 61
What is your experience with Web Components and how do they compare to React components?
reactcomponents - 62
How do you structure analytics and event tracking in a frontend app to keep it maintainable?
- 63
How would you implement offline support in a web application using service workers?
service-worker - 64
Describe your experience leading a frontend architecture decision that had a long-term impact on the team.
architecture - 65
How do you design the error handling strategy for a frontend application?
design - 66
What are the SOLID principles and how do they apply to frontend component design?
designsolidcomponents - 67
How do you approach A/B testing at the frontend level without causing performance issues?
testing - 68
How do you handle deprecated browser APIs or features that are being removed?
soft-skillsapi - 69
Describe your strategy for frontend observability beyond error tracking.
observability - 70
How do you handle the challenge of keeping shared component styles consistent when teams customize them locally?
soft-skillscomponents - 71
What are the most important things you look for when onboarding onto an unfamiliar frontend codebase?
onboarding - 72
How do you approach performance optimization for animations on low-end devices?
optimization - 73
How do you design the data fetching layer of a frontend application to be testable and maintainable?
design - 74
Describe how Content Security Policy headers improve application security and how you configure them without breaking functionality.
cspconfig - 75
How do you ensure your frontend team's code review process scales as the team grows?
code-reviewconcurrency - 76
What is the difference between optimistic locking and pessimistic locking, and how do you apply these concepts to frontend concurrent editing?
lockingconcurrency - 77
How do you evaluate the accessibility impact of a new component before shipping it?
componentsa11ydecision-making - 78
How do you approach building a frontend for a multi-tenant SaaS product where each tenant can have different branding?
multi-tenancy - 79
What are the trade-offs of using a monorepo versus polyrepo for a multi-team frontend organization?
monorepo - 80
How do you handle very large datasets in the frontend, such as exporting or rendering tens of thousands of records?
soft-skills - 81
How does React's concurrent mode change how you think about rendering and data fetching?
reactconcurrency - 82
How do you structure CSS for a large application to avoid specificity conflicts and global style pollution?
css - 83
What is your approach to pairing with a developer who has a very different coding style?
- 84
Explain how you would implement a plugin system in a frontend application.
system-design - 85
How do you validate that your UI changes are safe to ship, beyond running the test suite?
validation - 86
How do you manage environment variables securely in a Next.js application?
nextjsconfig - 87
What is your approach to internationalizing date, time, and number formatting across locales?
i18n - 88
How do you handle the challenge of keeping a Storybook component library in sync with the actual application components?
componentsstorybooksoft-skills - 89
Describe how you would architect an authentication flow for a Next.js application using JWTs.
nextjsauth - 90
How do you approach writing documentation for a technical decision so future engineers understand the context and can challenge it if needed?
documentation - 91
What is Suspense for data fetching and how does it change component design?
componentsreactdesign - 92
How do you handle third-party script loading without blocking the main page render?
soft-skills - 93
How do you handle long-running background tasks in the frontend, such as generating a large report?
soft-skills - 94
What is your approach to versioning a public-facing UI component library?
componentsversioning - 95
How do you identify and address burnout risk in yourself and your teammates?
wellbeing - 96
What is the difference between structural and nominal typing and how does TypeScript handle each?
typescript - 97
How do you approach capacity planning and effort estimation for a complex frontend project?
capacity - 98
How do you handle the challenge of consistent cross-platform behavior for a React Native and React web shared codebase?
soft-skillsreact - 99
What is your process for deprecating and removing a component from an internal design system?
componentsdesign-systemsystem-design - 100
How do you think about the trade-off between developer experience and end-user experience when choosing tools and abstractions?