Frontend developer interview questions and answers
Frontend interviews mix five kinds of questions: HTML and CSS, JavaScript, React, system design, and coding. Here are classic examples of each with a one-line answer, and where to practice the full versions.

At a soccer tryout, the coach doesn't only ask you about the rules. You run a few drills, then you play a short match. Each part shows something different: what you know, what you can do, and how you think on the move. A frontend interview mixes its questions the same way.
Frontend developer interview questions come in five kinds: HTML and CSS, JavaScript, React or another framework, frontend system design, and hands-on coding. Which ones you get depends on the company and the level of the job. Below are classic examples of each kind with a one-line answer, plus where to practice the full versions.
What kinds of questions come up in a frontend interview?
Each kind checks a different skill:
| Kind | What it checks | A classic example |
|---|---|---|
| HTML and CSS | You can build pages that look right and work for everyone | "What is the box model?" |
| JavaScript | You know how the language really behaves | "What is a closure?" |
| React | You can build UI with components and state | "Why do lists need keys?" |
| System design | You can plan a whole feature or app | "Design an autocomplete." |
| Coding | You can write working code under time pressure | "Write a debounce function." |

What HTML and CSS questions are asked?
These check that you can build a page that's correct, not just one that looks right. Here are five classics:
| Question | Short answer |
|---|---|
| What is semantic HTML? | Using elements that describe their content, like <nav>, <main>, and <button>, so screen readers and search engines understand the page. |
| What is the CSS box model? | Every element is a box: the content, then padding, then a border, then margin on the outside. |
How is display: none different from visibility: hidden? |
display: none removes the element from the layout. visibility: hidden hides it but keeps its space. |
| How do you center an element? | Make its parent a flex container with justify-content: center and align-items: center. |
| What is specificity? | How the browser picks a winner when two CSS rules style the same element. An ID beats a class, and a class beats a tag name. |
MDN's guides to the box model and semantics go deeper on the first two.
What JavaScript questions are asked?
JavaScript questions test how the language really works, not just its syntax. Click any question below for the full answer:
| Question | Short answer |
|---|---|
What's the difference between == and ===? |
=== compares without converting types. == converts first, so 0 == "" is true. |
How are var, let, and const different? |
let and const exist only inside their block, and const can't be reassigned. var belongs to the whole function. |
| What is a closure? | A function that remembers the variables around it, even after the outer function has finished. |
| What is the event loop? | It lets JavaScript, which runs one thing at a time, handle waiting work by running each waiting callback once the current code finishes. |
| What is event delegation? | One listener on a parent handles events for all its children, because events bubble up from child to parent. |
Some questions show you code and ask what it prints. Here's a classic:
setTimeout(() => console.log("A"), 0);
Promise.resolve().then(() => console.log("B"));
console.log("C");
It prints C, then B, then A. C runs right away. The promise callback runs as soon as the current code finishes. The timer callback waits for the next turn of the event loop, even with a delay of 0. Promise then vs setTimeout order explains why.
There are hundreds more in the JavaScript interview questions, and how to prepare for a JavaScript interview gives a study plan.
What React questions are asked?
React questions check that you understand how components, state, and rendering fit together:
| Question | Short answer |
|---|---|
| What's the difference between props and state? | Props are inputs a parent passes in. State is data a component keeps and changes itself. |
| Why do lists need keys? | Keys tell React which item is which between renders, so each item keeps the right state. |
What is useEffect for? |
Running code after a render to sync with something outside React, like a timer or a connection. |
| What causes a re-render? | The component's state changes, its parent re-renders, or a context, which is data shared down the tree, changes. |
When do you use useMemo or useCallback? |
useMemo remembers a computed value, and useCallback remembers a function, until their inputs change. |
The full set is in the React interview questions.
What about TypeScript questions?
If the job uses TypeScript, expect a few. A classic is any vs unknown. Both accept any value, but unknown makes you check the type before you use it, while any turns checking off. Another is interface vs type alias. The TypeScript interview questions cover the rest.
What is a frontend system design question?
It's an open question like "Design a news feed." There's no single right answer. You talk through what the feature must do, how its parts fit, what data it keeps, and how to make it fast and usable. A few classics:
- Design an autocomplete. Wait for a pause in typing, cache results, ignore late answers, and support the keyboard.
- Design a news feed. Load posts in batches, draw only the posts on screen, and show a like before the server confirms it.
- Design an image carousel. Load images only when needed, and support swipes, arrow keys, and screen readers.
The RADIO framework gives you an order to answer in. More prompts are in the frontend system design questions.
What coding questions are asked?
Coding rounds ask you to write something that works. Some are JavaScript utilities, some are small UIs, and some are DSA problems, short for data structures and algorithms:
- Write a debounce function. Return a function that waits until calls stop for a set time, then runs once.
- Write
Promise.all. A promise stands for a result that arrives later.Promise.allwaits for a list of them, and fails as soon as one fails. - Build a to-do list in React. Add, tick off, and delete tasks without changing state directly.
- Find two numbers that add up to a target. Remember each number you've seen, and look up the missing partner as you go. That's complement lookup.
The DSA problems have more, and do frontend developers need DSA? helps you decide how much to practice.
How should you prepare?
- Ask your recruiter which rounds you'll have, then practice those first.
- Say your answers out loud. Knowing an answer and explaining it clearly are different skills.
- Solve problems that have tests, so you know your code really works.
- Have two or three projects ready to talk about. How to build a frontend developer portfolio shows how to present them.
- Do a timed practice round. In the mock interviews, Tuto, the site's tutor, plays the interviewer and gives you a report afterward.


