Boarding pass · React Beginner
React · Beginner interview
An AI mock interview for developers new to React (0–2 years). Practise the fundamentals — JSX, components, props, state, useState, useEffect, and event handling — out loud, under interview conditions, and get a readiness score.
- Voice interview
- Live feedback
- Browser-only
- No installation required
Your report · sample
AI Readiness Score
Finish the mock and get this report — scored on content and English, with concrete tips and a model answer for every question, plus a study plan.
Your flight path
Five steps to interview-ready.
From a quick warm-up to a personalised study plan — here's the whole loop, and what you get at each gate.
Step 01
Preparation
Skim the topics and warm up — you're briefed before takeoff.
Step 02
AI Interview
A realistic AI interviewer asks tailored questions — answer by voice or text.
Step 03
Instant Score
Finish and get a 0–100 readiness score across content and English.
Step 04
AI Feedback
Concrete tips and a rewritten model answer for every response.
Step 05
Study Plan
A personalised plan targets your weakest areas — so the next run scores higher.
Preview the AI demo
See one answer scored, end to end.
The whole loop on sample data — question, your answer, instant feedback and a study plan. Hover to pause.
Interviewer · Question 1
“Tell me about yourself.”
Who it's for
- Developers new to React
- JavaScript developers learning React
- Students learning frontend frameworks
- Anyone preparing for junior React roles
What you'll practice
- Understanding React and JSX
- Creating functional components
- Working with props and state
- Using the useState hook
- Basic useEffect usage
- Handling events in React
Topics covered
What this level expects.
React basics
- What is React
- JSX syntax
- Components
- Props
State management
- useState hook
- State vs props
- Updating state
Effects
- useEffect basics
- Side effects
- Component lifecycle
User interaction
- Event handling
- Forms
- Controlled components
- Lists and keys
Practice questions
16 questions, with model answers.
Read them, then run the live mock to answer out loud and get scored. Tap any question to reveal a model answer.
01What is React and why would you use it?React basics
React is a JavaScript library for building user interfaces out of reusable components. You describe what the UI should look like for a given state, and React efficiently updates the DOM when that state changes — using a virtual DOM to apply the minimal set of changes. You'd reach for it because it makes complex, interactive UIs easier to build and maintain through composition, a one-way data flow that's easy to reason about, and a huge ecosystem.
02What is JSX and how is it different from HTML?React basics
JSX is a syntax extension that lets you write HTML-like markup inside JavaScript; it compiles down to React.createElement calls. It differs from HTML in a few ways: attributes are camelCased (className instead of class, onClick instead of onclick), you embed JavaScript expressions with curly braces { }, every element must be closed, and a component must return a single root (or a Fragment).
const name = "Sam";
return <h1 className="title">Hello, {name}!</h1>;03What is a component, and what's the difference between functional and class components?React basics
A component is a reusable, self-contained piece of UI that returns markup. Functional components are plain JavaScript functions that return JSX and use hooks for state and lifecycle — they're the modern standard. Class components are ES6 classes that extend React.Component, hold state in this.state, and use lifecycle methods; you'll still see them in older code, but new code uses functions and hooks.
04What are props?React basics
Props (short for properties) are read-only inputs passed from a parent component to a child, like arguments to a function. They enable React's one-way data flow: data flows down from parent to child. A child must never mutate its props — to change data, the parent updates its own state and passes new props down.
function Greeting({ name }) {
return <p>Hi, {name}</p>;
}
<Greeting name="Sam" />05What is the difference between props and state?State management
Props are passed in from the parent and are read-only from the component's perspective. State is data the component owns and manages internally, and it can change over time — usually in response to user interaction. When state changes, the component re-renders. A rule of thumb: if a value is controlled by the parent it's a prop; if the component itself needs to change it, it's state.
06How do you use the useState hook?State management
useState lets a functional component hold state. You call it with the initial value, and it returns a pair: the current value and a setter function. Calling the setter with a new value schedules a re-render with that value. Hooks must be called at the top level of the component, never inside loops or conditions.
const [count, setCount] = useState(0);
return <button onClick={() => setCount(count + 1)}>{count}</button>;07Why shouldn't you mutate state directly?State management
React decides whether to re-render by comparing references, so mutating state in place (e.g. arr.push(x) or state.value = 1) doesn't register as a change and the UI won't update. Always create a new value and pass it to the setter — spread arrays/objects into new ones. Treating state as immutable keeps renders predictable.
// wrong: items.push(newItem); setItems(items); setItems([...items, newItem]);
08How do you update state based on the previous state?State management
Pass a function to the setter — React calls it with the latest state and uses the return value. This is important because state updates are batched and asynchronous, so reading the state variable directly can be stale, especially when you update several times in a row.
setCount(prev => prev + 1); // safe under batching
09What is the purpose of the useEffect hook?Effects
useEffect runs side effects — work that reaches outside the render, like data fetching, subscriptions, timers, or manually touching the DOM. It runs after the component renders. You give it a setup function and a dependency array that controls when it re-runs.
useEffect(() => {
document.title = `Count: ${count}`;
}, [count]);10What does the dependency array in useEffect control?Effects
The dependency array tells React when to re-run the effect. With [] it runs once after the first render (on mount). With [a, b] it re-runs whenever a or b change. With no array at all it runs after every render. You should list every value from the component scope that the effect uses, or it can read stale values.
11How do you clean up a side effect?Effects
Return a cleanup function from the effect. React runs it before the effect runs again and when the component unmounts. Use it to undo work — clear timers, remove event listeners, cancel subscriptions — so you don't leak resources or update an unmounted component.
useEffect(() => {
const id = setInterval(tick, 1000);
return () => clearInterval(id);
}, []);12How does component lifecycle work in function components?Effects
Function components express lifecycle through useEffect rather than methods. An effect with [] dependencies acts like 'on mount'; its returned cleanup acts like 'on unmount'; an effect with dependencies runs on mount and again whenever those dependencies change, like 'on update'. There's no separate render/mount/update method — it's all the render function plus effects.
13How do you handle events in React?User interaction
You pass a function to a camelCased event prop like onClick or onChange. React wraps native events in a cross-browser SyntheticEvent. You typically pass an inline arrow function or a named handler; to pass arguments, wrap it in an arrow function so it isn't called during render.
function handleClick() { console.log("clicked"); }
return <button onClick={handleClick}>Go</button>;14What is a controlled component?User interaction
A controlled component is a form input whose value is driven by React state. You set its value from state and update that state in onChange, making React the single source of truth. This lets you validate, format, or conditionally enable inputs as the user types.
const [email, setEmail] = useState("");
<input value={email} onChange={e => setEmail(e.target.value)} />15How do you handle form submission in React?User interaction
Put an onSubmit handler on the <form> and call e.preventDefault() to stop the browser's full-page reload, then read the values from state (for controlled inputs) and do your work. Using onSubmit (rather than a button onClick) also handles the user pressing Enter.
function onSubmit(e) {
e.preventDefault();
save(email);
}
<form onSubmit={onSubmit}>…</form>16Why do lists need a key prop, and why not use the array index?User interaction
Keys give each list item a stable identity so React can match items between renders and update only what changed instead of re-rendering the whole list. Use a stable unique id from your data. The array index is risky because if items are reordered, inserted, or removed, the index-to-item mapping shifts and React can keep the wrong DOM state (like a typed-in input value) on the wrong row.
{users.map(u => <li key={u.id}>{u.name}</li>)}Preparation tips
Walk in ready.
- Build simple React components
- Practice with useState for state management
- Learn JSX syntax thoroughly
- Understand props and prop drilling
- Practice useEffect for side effects
- Build a simple form with controlled components
Ready for the real thing?
Run a 6-question React mock interview, answer out loud, and get a readiness score with tips and model answers.
More beginner interviews