Frontend Developer Interview Questions

Prepare for your frontend developer interview with 10 expert-curated questions and sample answers covering React, performance, CSS, and behavioral topics.

behavioral Questions

Tell me about a time you pushed back on a design that would have hurt performance or usability.

behavioralbeginner

Sample Answer

A design called for an auto-playing video carousel on our landing page. Rather than just objecting, I prototyped it and measured: 2.3MB added, LCP up 1.8 seconds on mobile. I brought the designer the data plus an alternative — a static hero with a click-to-play video — which preserved the visual intent. We shipped that, and conversion improved 6%. Leading with evidence kept the relationship collaborative.

Tip: The pattern interviewers want: measure, propose an alternative, preserve the design intent.

How do you stay current with frontend development without chasing every new framework?

behavioralbeginner

Sample Answer

I follow primary sources — release notes for React and Next, a couple of newsletters — and apply a filter: I adopt in side projects what solves a problem I actually have, and bring it to work only after it survives that trial. That's how I adopted TanStack Query early but skipped several state libraries that didn't outlive their hype cycle.

Tip: Interviewers want judgment, not exhaustive awareness. Show a filtering mechanism.

technical Questions

How does React's rendering work, and how do you prevent unnecessary re-renders?

technicalintermediate

Sample Answer

React re-renders a component when its state or props change, then reconciles the virtual DOM to apply minimal real DOM updates. To prevent waste I keep state as local as possible, memoize expensive children with React.memo and stable callbacks via useCallback, and derive data during render instead of syncing it into state. Profiling with React DevTools comes before optimizing — most 'slow' components aren't the real culprit.

Tip: Mentioning 'profile before memoizing' separates engineers from cargo-culters.

Walk me through optimizing a page with a 5-second Largest Contentful Paint.

technicaladvanced

Sample Answer

First, identify the LCP element and its bottleneck in the waterfall — usually a hero image or render-blocking resource. Typical fixes in order of impact: serve the image responsive and modern-format with priority hints, eliminate render-blocking scripts and unused CSS, code-split below-the-fold JavaScript, and move data fetching server-side. At my last role this sequence took LCP from 4.1s to 1.8s and conversion up 11%.

Tip: Structure by diagnosis-then-fix. Reciting optimizations without a measurement step is a yellow flag.

Explain the difference between server-side rendering, static generation, and client-side rendering. When do you use each?

technicalintermediate

Sample Answer

Static generation builds HTML at deploy time — best for content that's the same for everyone, like marketing and docs. SSR renders per-request — best for personalized or frequently changing pages that still need fast first paint and SEO. Client-side rendering suits highly interactive apps behind a login where SEO doesn't matter. Modern frameworks let you choose per route, and that's how I approach it.

Tip: The per-route framing reflects how Next.js/Remix actually work — interviewers want that nuance.

How do you make a complex web app accessible?

technicalintermediate

Sample Answer

Semantics first: native elements and correct heading structure get you most of the way free. Then keyboard support — every interaction reachable and visible focus management in modals and menus — ARIA only where semantics fall short, and color contrast meeting WCAG AA. I test with a screen reader and keyboard-only navigation, and wire axe checks into CI so regressions fail builds.

Tip: 'Native elements first, ARIA last' is the answer experienced accessibility practitioners give.

How do you manage state in a large React application?

technicalintermediate

Sample Answer

I categorize state first: server cache belongs in TanStack Query, not Redux; URL state in the router; form state in a form library; and only genuinely shared client state in a global store like Zustand. Most 'state management problems' dissolve when server data stops being duplicated in client stores. Local component state remains the default until sharing is proven necessary.

Tip: The server-state vs. client-state distinction is the modern answer — naming TanStack Query shows currency.

What's your approach to testing frontend code?

technicalintermediate

Sample Answer

I follow the testing trophy: a few end-to-end Playwright tests for critical journeys like checkout, a strong middle layer of integration tests with Testing Library asserting behavior users see, and unit tests for pure logic like date math and validation. I avoid snapshot-everything testing — it creates noise without confidence. The goal is tests that fail when users would notice something broke.

Tip: 'Test behavior, not implementation' plus naming Testing Library/Playwright is the expected answer in 2026.

Explain CSS specificity and how you keep styles maintainable at scale.

technicalbeginner

Sample Answer

Specificity ranks selectors — inline beats IDs beats classes beats elements — and conflicts resolve by that weight, then source order. At scale I avoid the war entirely: utility-first CSS like Tailwind or co-located CSS modules keep specificity flat and styles deletable. The maintainability win is knowing that removing a component removes its styles with zero risk.

Tip: 'Keep specificity flat' is the principle; naming your method (Tailwind, CSS Modules, BEM) grounds it.

situational Questions

A user reports the app is broken, but it works on your machine. What do you do?

situationalbeginner

Sample Answer

Gather the specifics: browser, device, steps, and ideally a screen recording or console errors from our error tracker like Sentry. Then reproduce their environment — same browser version, throttled network, cleared cache. Common culprits are stale service workers, ad blockers, locale differences, and race conditions that fast dev machines hide. If I can't reproduce, I add targeted logging and work with the user directly.

Tip: Mentioning error tracking tooling (Sentry) signals you've supported real production apps.

Preparation Tips

1

Build or polish one live project you can demo — frontend interviews reward candidates who can show, not just tell.

2

Practice JavaScript fundamentals (closures, promises, event loop) — they still open most technical screens.

3

Be ready to do a live UI exercise: build a component with state, fetch, and edge cases in 30-45 minutes.

4

Know Core Web Vitals cold — what each metric measures and two fixes for each.

5

Prepare a performance story and an accessibility story with before/after numbers.

Practice Frontend Developer Interview Questions

Get AI-powered feedback on your answers and ace your next interview.

Start Interview Prep

Related Interview Questions