React JS Interview Questions for Freshers (With Answers)

Nov 03, 2026

The interview question on React JS that freshers face most often is "What is React and why do we use it?", followed closely by the Virtual DOM, props vs state, and how useState and useEffect work. If you can explain these four topics clearly, with a small example for each, you will handle most entry-level rounds. Interviewers now also expect awareness of React 19, the current major version. If you are building these skills from scratch, a structured React JS course with hands-on projects helps you practise the coding rounds, not just memorise answers.

Below are React JS interview questions for freshers grouped by level: basics, hooks, state management, performance and practical coding. Each answer is short enough to say aloud in an interview.

Basic React JS Interview Questions

1. What is React?

React is an open-source JavaScript library for building user interfaces from reusable components. It handles the view layer: you describe what the UI should look like for a given state, and React updates the screen when that state changes.

2. What is JSX?

JSX is a syntax extension that lets you write HTML-like markup inside JavaScript. Browsers cannot read it directly, so a build tool converts it into regular JavaScript function calls. Remember: use className instead of class, and return a single parent element or a fragment <>...</>.

3. What is the Virtual DOM?

The virtual DOM is a lightweight JavaScript copy of the real DOM. When state changes, React builds a new virtual tree, compares it with the previous one (a process called reconciliation or "diffing"), and applies only the necessary changes to the real DOM. Fewer real DOM updates keep the UI fast.

4. What is the difference between props vs state?

This is one of the most repeated interview questions in React JS. A quick table makes it easy to remember:

PointPropsState
OwnerPassed in by the parentOwned by the component itself
Changeable?Read-only inside the childUpdated with a setter function
PurposeConfigure a componentTrack data that changes over time
ExampleA product name sent to a cardItems in a shopping cart

5. Why do lists need a key prop?

Keys help React identify which list items were added, removed or reordered. Use a stable, unique ID from your data. Avoid using the array index when items can be reordered, because React may reuse the wrong element and mix up input values.

These basics depend on solid JavaScript, HTML and CSS. If your fundamentals feel shaky, a web front-end development course covering ES6, the DOM and responsive layouts is a sensible first step.

React Hooks Interview Questions

6. What are hooks, and what are the rules of hooks?

Hooks are functions that let function components use state and other React features. There are two rules: call hooks only at the top level of a component or custom hook (never inside loops, conditions or nested functions), and call them only from React functions, not regular JavaScript functions.

7. How do useState and useEffect work?

useState stores a value and gives you a function to update it; each update triggers a re-render. useEffect runs side effects such as API calls, timers or subscriptions after render. The dependency array decides when it runs again, and the returned function cleans up.

function Timer() { const [seconds, setSeconds] = useState(0); useEffect(() => { const id = setInterval(() => setSeconds(s => s + 1), 1000); return () => clearInterval(id); // cleanup on unmount }, []); // empty array: run once after first render return <p>{seconds} seconds</p>; }

Interviewers often ask why the code uses s => s + 1 instead of seconds + 1. The functional form always reads the latest value, which avoids stale state inside intervals and closures.

8. What is the difference between useRef and useState?

Both keep a value between renders, but changing ref.current does not cause a re-render. Use useRef for DOM access (focusing an input) or for storing values like a timer ID that the UI does not display.

9. What is the use() API in React 19?

use reads the value of a promise or a context during render. When reading a promise, the component suspends until it resolves, so it works with <Suspense>. Unlike hooks, use can be called inside conditions and loops, which is a good detail to mention. React 19.2 also added useEffectEvent, which separates non-reactive logic from an Effect so it does not re-run unnecessarily.

State Management Questions

10. What is prop drilling, and how do you avoid it?

Prop drilling means passing data through several components that do not need it, just to reach a deeply nested child. The built-in fix is the Context API: create a context, wrap the tree in a provider, and read the value where needed. For larger apps, teams use libraries such as Redux Toolkit or Zustand.

11. What does "lifting state up" mean?

When two sibling components need the same data, you move that state to their closest common parent and pass it down as props. For example, a search box and a results list share the search text through their parent.

12. What are Actions in React 19?

According to the official React 19 release post, Actions are async functions run inside transitions, with React managing pending state, errors and optimistic updates. A <form> can take a function in its action prop, and related hooks include useActionState, useFormStatus and useOptimistic. Another React 19 change: function components now receive ref as a normal prop, so new code rarely needs forwardRef.

Performance Questions in React JS

13. What do React.memo, useMemo and useCallback do?

  • React.memo skips re-rendering a component when its props have not changed.
  • useMemo caches the result of an expensive calculation between renders.
  • useCallback caches a function so a memoised child does not receive a "new" function every render.

14. What is the React Compiler?

The React Compiler is a build-time tool that memoises components and hooks automatically, so you write less manual useMemo and useCallback. The team announced its first stable release, v1.0, in October 2025. It is opt-in for Vite and Next.js projects through compiler-enabled templates. You still need to understand memoisation, as the compiler relies on code following the Rules of React.

Practical and Coding Round Questions

Many companies give a short coding task instead of theory: a counter, a to-do list, a search filter or an API data display. Here is a common warm-up:

function CourseSearch({ courses }) { const [query, setQuery] = useState(""); const filtered = courses.filter(c => c.name.toLowerCase().includes(query.toLowerCase()) ); return ( <> <input value={query} onChange={e => setQuery(e.target.value)} /> <ul> {filtered.map(c => <li key={c.id}>{c.name}</li>)} </ul> </> ); }

While coding, say your reasoning aloud: why the input is controlled, why filtered is derived during render instead of stored in separate state, and why each item has a key.

Other practical questions freshers should prepare for:

  • How would you fetch data and show loading and error states?
  • How do you set up a new React project today? (The React team deprecated Create React App in February 2025 and recommends a framework such as Next.js or React Router, or a build tool like Vite.)
  • How would your React app talk to a REST API built with Express?

That last question is where React meets the server. Freshers who also understand the backend through a Node JS course, or who aim for MERN roles via a full stack development course, can answer it with real project examples.

How to Prepare for React JS Interview Questions

  • Build two or three small projects you can explain line by line, such as a weather app or an expense tracker.
  • Revise JavaScript first: closures, map and filter, destructuring, promises and async/await come up in nearly every round.
  • Practise logic problems. Some service companies add an aptitude or DSA round, which a software development foundation course covering C, C++ and DSA prepares you for.
  • Host your work on GitHub with a clear README and a live link, so the interviewer can see it before the call.

At RW Skill Education, React students build projects of this kind with trainer feedback, so the interview becomes a conversation about work they have actually done.

Frequently Asked Questions

Which React version should I mention in an interview?

React 19 is the current major version. Mention its key additions, such as Actions, the use() API and ref as a prop, to show you are up to date.

Do freshers need to know class components?

Basic awareness helps, since older codebases still use them, but new projects use function components and hooks. Focus your preparation there.

Is Redux compulsory for a React fresher job?

No. Know useState, Context and lifting state up well. Learn Redux Toolkit basics if the job description lists it.

How long does it take to prepare for React interviews?

It depends on your JavaScript level. With strong JavaScript, a few weeks of daily practice and two small projects is a realistic starting point.

Should I learn TypeScript with React?

It is not required for most fresher roles, but many companies use it. Learn it after you are comfortable with React in plain JavaScript.

Do I still need useMemo if the React Compiler exists?

Yes, you should understand it. The compiler is opt-in, many existing projects do not use it, and interviewers still ask about memoisation.

Turning These Answers Into Interview Confidence

Pick the questions you find hardest, write the code yourself and explain it aloud. Once you can link the virtual DOM, hooks and Actions to a project you built, you are ready for real React rounds.