Frontend Interview Practice

Practice 60 original frontend interview questions covering JavaScript, HTML, CSS, React, the browser, performance, accessibility, and security, with answers and explanations.

Level: Frontend Interview Difficulty: intermediate 60 questions 60 min
Choose a practice mode, answer each frontend interview question, then review the explanation. Wrong answers are saved locally for review.
Day streak: 0 days Saved only on this device
Progress 0 / 60
Question 1

What is a JavaScript closure?

Select an answer
Question 2

What is hoisting in JavaScript?

Select an answer
Question 3

What is the difference between == and ===?

Select an answer
Question 4

What is a Promise?

Select an answer
Question 5

What does async/await do?

Select an answer
Question 6

What is event delegation?

Select an answer
Question 7

What does `this` refer to in JavaScript?

Select an answer
Question 8

What is a pure function?

Select an answer
Question 9

What is immutability?

Select an answer
Question 10

Which array method creates a new array by transforming each element?

Select an answer
Question 11

Which array method returns elements that match a condition?

Select an answer
Question 12

Which array method reduces an array to a single value?

Select an answer
Question 13

What is a Set in JavaScript?

Select an answer
Question 14

What is localStorage?

Select an answer
Question 15

What is semantic HTML?

Select an answer
Question 16

Which landmark element represents the main content of a page?

Select an answer
Question 17

What is CSS specificity?

Select an answer
Question 18

In the CSS box model, which property sits between padding and margin?

Select an answer
Question 19

What is flexbox designed for?

Select an answer
Question 20

What is CSS Grid designed for?

Select an answer
Question 21

Which CSS unit is relative to the root font size?

Select an answer
Question 22

Which CSS unit is relative to viewport width?

Select an answer
Question 23

What does a media query do?

Select an answer
Question 24

What does position: fixed do?

Select an answer
Question 25

What is a pseudo-class?

Select an answer
Question 26

What does box-sizing: border-box do?

Select an answer
Question 27

What is a React component?

Select an answer
Question 28

What are props in React?

Select an answer
Question 29

What is state in React?

Select an answer
Question 30

What is a React hook?

Select an answer
Question 31

Which hook manages state in a function component?

Select an answer
Question 32

Which hook runs side effects after render?

Select an answer
Question 33

What is the virtual DOM?

Select an answer
Question 34

Why do list items need keys in React?

Select an answer
Question 35

What is a controlled input in React?

Select an answer
Question 36

What is reconciliation in React?

Select an answer
Question 37

What does useMemo do?

Select an answer
Question 38

What is the DOM?

Select an answer
Question 39

Which method selects an element by its id?

Select an answer
Question 40

Which method attaches an event listener?

Select an answer
Question 41

What is event bubbling?

Select an answer
Question 42

What is the event loop?

Select an answer
Question 43

What is a microtask?

Select an answer
Question 44

What is requestAnimationFrame used for?

Select an answer
Question 45

What is a cookie?

Select an answer
Question 46

What does stopPropagation do?

Select an answer
Question 47

What is debouncing?

Select an answer
Question 48

What is throttling?

Select an answer
Question 49

What is lazy loading?

Select an answer
Question 50

What are Core Web Vitals?

Select an answer
Question 51

Which Core Web Vital measures visual stability?

Select an answer
Question 52

Which Core Web Vital measures loading performance?

Select an answer
Question 53

What is ARIA?

Select an answer
Question 54

What is XSS?

Select an answer
Question 55

What is a Content Security Policy?

Select an answer
Question 56

What is CORS?

Select an answer
Question 57

Which of the following are JavaScript array methods? Select all that apply.

Select an answer
Question 58

Which of the following are React hooks? Select all that apply.

Select an answer
Question 59

Flexbox is the best choice for two-dimensional grid layouts.

Select an answer
Question 60

Match each CSS unit to its meaning.