Home · Interview questions · Frontend Developer
Frontend Developer interview questions
Frontend interviews mix JavaScript fundamentals, framework knowledge and judgement about what users actually experience. Expect to explain why a page feels slow as much as how a hook works.
What interviewers look for
- JavaScript depth. Closures, the event loop and async behaviour, not just framework syntax.
- User focus. Accessibility, loading states and how things behave on a slow phone.
- Component design. Where state lives and how components stay reusable.
How the interview usually runs
- Recruiter call.
- JavaScript or framework coding task, live or take-home.
- UI build or component design interview.
- Behavioural round, often with a designer or product manager.
Stages vary by company, so ask the recruiter what to expect before you start preparing.
10 Frontend Developer interview questions, and how to answer them
1. Explain the JavaScript event loop.
What they want to see: Whether you understand async behaviour.
How to answer: Describe the call stack, task queue and microtasks, then predict the order of a promise and a setTimeout.
2. What is a closure, and where have you used one?
What they want to see: Core language knowledge with a real use.
How to answer: Define it in a sentence and give a practical case such as a debounced handler.
3. How do you decide where state should live?
What they want to see: Component design judgement.
How to answer: Keep state as close to its use as you can, lift it when siblings need it, and separate server data from UI state.
4. Why does a React component re-render?
What they want to see: How well you know the framework.
How to answer: Cover changed state, props and parent renders, then say how you'd measure before adding memoisation.
5. How would you speed up a slow page?
What they want to see: Method over tricks.
How to answer: Measure first with Core Web Vitals, then look at bundle size, images, render-blocking work and data fetching.
6. What makes a page accessible?
What they want to see: Care for all users.
How to answer: Mention semantic HTML, keyboard use, focus handling, labels and contrast, and how you test with a screen reader.
7. Explain the difference between CSS grid and flexbox.
What they want to see: Practical layout knowledge.
How to answer: Flexbox for one direction, grid for two. Give an example of each from real work.
8. How do you handle errors and loading states?
What they want to see: Thinking past the happy path.
How to answer: Describe skeletons, error boundaries, retries and what the user sees when the network fails.
9. How do you test a component?
What they want to see: Testing that survives refactors.
How to answer: Test what the user sees and does, not internals, and keep a few end-to-end tests for key flows.
10. Tell me about working with a designer who disagreed with you.
What they want to see: Collaboration.
How to answer: Show you explained the technical cost, suggested an alternative and reached a decision together.
A sample answer
How would you speed up a slow page?
On our pricing page, the largest content took four seconds on mid-range phones. Lighthouse pointed to a heavy hero image and a large chart library loaded on every route. I converted the image to WebP, split the chart into a lazy chunk and preloaded the main font. Load time dropped to about 1.8 seconds and the bundle shrank by a third.
A made-up example to show the structure. Use your own experience and real numbers.Common mistakes
- Knowing a framework's API but not the JavaScript under it.
- Adding memoisation everywhere without measuring.
- Ignoring keyboard users in a live UI exercise.
- Skipping empty and error states when building a component.
Practise this out loud
Run a mock interview for a Frontend Developer role. Questions change every time, you answer by voice or typing, and each answer gets a score with feedback.
Frequently asked questions
Do frontend developers get algorithm questions?
Some do, usually at an easier level than backend roles. Practical tasks such as building a search box or a modal are more common, so practise those too.
Should I learn React or the fundamentals first?
Fundamentals first. Most framework questions in interviews come down to JavaScript, the DOM and rendering, and those carry over to any framework.