Frontend Interview Questions
Practice JavaScript, TypeScript, CSS, React, accessibility, and performance with free frontend interview questions. Each exercise includes hints and an answer you can compare with your own.
Practice questions
- Which runs first, Promise callbacks or setTimeout? · Event loop · 5 min
- Why does a CSS class beat this ID selector? · CSS cascade · 5 min
- How do you stop stale search results overwriting newer ones? · Browser requests · 6 min
- How should a modal dialog manage keyboard focus? · Accessibility · 6 min
- Why is INP poor when LCP is good? · Web performance · 6 min
- Why does this React component fail to hydrate? · React rendering · 6 min
- Why does res.json() as Invoice let bad API data slip in? · TypeScript validation · 7 min
- Why do separate UI booleans allow impossible screen states? · Discriminated unions · 7 min
- Why does rows[idx].email type-check and still crash at runtime? · Type narrowing · 7 min
- Why does copying props into useState with useEffect cause bugs? · React derived state · 7 min
- Why does React StrictMode run useEffect twice, and what breaks? · React effects · 8 min
- Why do tests of internal state and CSS classes fail refactors? · Component testing · 8 min
How to practice
Predict the result or explain what you would change before opening the hints. Then compare your reasoning with the answer and try the follow-up question.