Frontend Developer interview questions and answers

Frontend interviews test JavaScript fundamentals, a framework such as React, CSS layout, and how you make pages fast and accessible. Many include a small take-home or live task building a component.

Skills and knowledge

  1. Explain the JavaScript event loop.

    Sample answer: JavaScript runs one task at a time on a single call stack. When async work such as a timer or network request finishes, its callback is queued. After the current code finishes, the engine first runs all microtasks (promise callbacks), then takes the next task from the task queue, then the browser may repaint. That is why a long loop freezes the page and why a resolved promise runs before a setTimeout of zero.

  2. What is a closure and where would you use one?

    Sample answer: A closure is a function that remembers variables from the scope where it was created, even after that outer function has returned. It is used for private state (a counter only one function can change), for event handlers that need data from when they were set up, and in React hooks, where stale closures are also a common bug to watch for.

  3. How does React decide when to re-render a component?

    Sample answer: A component re-renders when its state changes, when its parent re-renders, or when a context it reads changes. React then compares the new output with the previous one and updates only the changed DOM parts. You can skip unnecessary work with React.memo, useMemo and useCallback, but only after measuring, since memoising everything adds its own cost.

  4. What is the difference between flexbox and CSS grid?

    Sample answer: Flexbox lays items out in one direction, a row or a column, and is great for navigation bars, button groups and centring. Grid controls rows and columns at once, which suits whole page layouts and card galleries. They work well together: grid for the page skeleton, flexbox inside each piece.

  5. How would you make a slow web page load faster?

    Sample answer: Measure first with Lighthouse or the browser's performance panel and look at Core Web Vitals. Common fixes: compress and correctly size images, lazy-load what is below the fold, split JavaScript so each page loads only what it needs, cache static files with a CDN, remove unused CSS and third-party scripts, and render important content on the server so it appears before scripts run.

  6. How do you make a site accessible?

    Sample answer: Use semantic HTML (real buttons, headings in order, labels on form fields), give images useful alt text, make everything work with a keyboard with a visible focus style, keep colour contrast high enough, and use ARIA only when native elements cannot do the job. Test with a screen reader and an automated checker like axe.

  7. What is the difference between server-side rendering and client-side rendering?

    Sample answer: With client-side rendering the browser receives a nearly empty page and JavaScript builds it, which can be slow to first show and harder for search engines. With server-side rendering the server sends finished HTML, so content appears quickly and is easy to index, then JavaScript makes it interactive. Static generation builds pages ahead of time, which is fastest when content does not change per request.

  8. How do you manage state in a larger frontend app?

    Sample answer: Keep state as close as possible to where it is used. Local UI state stays in components; data from the server is best handled by a fetching library such as React Query or SWR that caches and refreshes it; only truly global state such as the signed-in user goes into context or a store like Redux or Zustand. Most mess comes from putting server data in a global store.

  9. What is the difference between let, const and var?

    Sample answer: var is function-scoped and hoisted, so it can be used before its line and leaks out of blocks. let and const are block-scoped and cannot be used before they are declared. const cannot be reassigned, though an object it holds can still be changed. Modern code uses const by default and let when the value must change.

  10. What are Core Web Vitals?

    Sample answer: Google's main measures of page experience: Largest Contentful Paint (how fast the main content appears, aim for under 2.5 seconds), Interaction to Next Paint (how quickly the page responds to taps and clicks, under 200 milliseconds) and Cumulative Layout Shift (how much the page jumps while loading, under 0.1).

  11. How do you build a responsive layout?

    Sample answer: Start mobile first with fluid widths, flexbox and grid, use relative units such as rem and percentages, add media or container queries where the layout needs to change, give images max-width 100% with srcset for sizes, and test on real phones as well as desktop.

  12. What are controlled and uncontrolled inputs in React?

    Sample answer: A controlled input gets its value from React state and updates it through onChange, so React is the single source of truth and validation is easy. An uncontrolled input keeps its own value in the DOM and you read it with a ref when needed, which is simpler for basic forms. Form libraries often mix both for speed.

Past experience

  1. Tell me about a time a design was hard to build as given.

    Sample answer: Describe the design, the specific problem (for example it broke on small screens or needed an expensive animation), how you raised it with the designer early with a quick prototype or screenshots, and the compromise you reached. Interviewers look for collaboration rather than just saying it could not be done.

  2. Tell me about a UI you made faster.

    Sample answer: Give the page, the before number (for example a 5-second load or a laggy list), how you measured, what you changed such as code splitting, image optimisation or list virtualisation, and the after number. Mention any effect on users, like lower bounce rate.

What would you do?

  1. A user reports the page looks broken on their phone. How do you investigate?

    Sample answer: Ask for the device, browser and a screenshot. Reproduce it with the browser's device mode, then on a real device or a cloud testing service. Check for fixed widths, missing viewport meta tag, unsupported CSS features and overflowing content. Fix it, then add that screen size to your regular checks.

  2. The designer wants an animation that makes the page janky on cheap phones. What do you do?

    Sample answer: Show the problem with a recording or performance profile on a low-end device. Suggest alternatives: animate only transform and opacity, shorten or simplify it, or turn it off for users who prefer reduced motion and for slow devices. Agree on the version that keeps the feel without hurting speed.

Open Frontend Developer jobs

DDeWarmte
The Hague, Netherlands

Full Stack Engineer, Frontend-focused (Next.js + Django)

OnsiteEngineeringFull Time
€5.000 – €7.000Today · via Arbeitnow
AAmplemarket
Remote · EMEA

Frontend Software Engineer

RemoteEngineeringFull Time
Pay not listedToday · via Jobicy
UUnivé
Zwolle, Netherlands

IT Specialist Frontend Platform

OnsiteEngineeringExperienced
Pay not listedToday · via Arbeitnow
TThe Sharing Group
Almere, Netherlands

Senior Frontend Engineer (Full Stack)

OnsiteEngineeringExperienced
Pay not listedToday · via Arbeitnow
SSkdse
Berlin, Germany

Senior Frontend Engineer (All Genders)

OnsiteEngineeringFull Time
Pay not listedToday · via Arbeitnow
UUpstart
Remote · Worldwide

Senior Frontend Software Engineer, Personal Loans

RemoteEngineeringFull-Time
Pay not listedToday · via We Work Remotely

More interview guides