CoreHRx Jobs

Apply in one click, save jobs and take free mock tests.

Register free Log in
Hiring? Post jobs with CoreHRx
My account
user

View & update profile

React mock test: free online practice

30 random questions, 30 minutes, at the level you choose: hooks, state, rendering, effects and react 19. After you submit you get your score, your strong and weak topics, and the right answer with an explanation for every question.

Want to revise first? Read the React interview questions and answers.

Choose your experience

Free with a CoreHRx Jobs account: you will be asked to sign in or create one first.

What does the React mock test cover?

The test draws on 300 React questions in 12 topics, across three levels. Each attempt picks 30 of them at random for the level you choose.

  • Hooks26 Qs
  • Performance26 Qs
  • Architecture25 Qs
  • Components25 Qs
  • Concurrent25 Qs
  • Effects25 Qs
  • Forms25 Qs
  • JSX25 Qs
  • Rendering25 Qs
  • State25 Qs
  • Context24 Qs
  • Testing24 Qs

Sample React mock test questions

One question from each level, the way they appear in the test. Try it, then open the answer.

  1. FresherComponents

    Why must a React component's name start with a capital letter when you use it in JSX?

    • The bundler only exports functions whose names are capitalised
    • Lowercase names are reserved for class components only
    • Lowercase tags are treated as built-in HTML elements such as div or span
    • React sorts components by name and needs capitals to do it
    Show the answer

    Answer: Lowercase tags are treated as built-in HTML elements such as div or span. JSX treats <profile /> as an HTML tag named profile and <Profile /> as your component. That is why a lowercase component name renders an unknown DOM element instead of calling your function.

  2. Intermediate (1-5 years)JSX

    Your CMS returns trusted, already sanitised HTML for a job description. How do you render it as HTML?

    • <div dangerouslySetInnerHTML={{ __html: html }} />
    • <div innerHTML={{ __html: html }} suppressWarnings />
    • <div>{{ __html: html }}</div>
    • <div setInnerHTML={html} />
    Show the answer

    Answer: <div dangerouslySetInnerHTML={{ __html: html }} />. React escapes strings by default, so {html} shows the tags as text. dangerouslySetInnerHTML is the explicit opt-out, named to remind you of XSS risk. Sanitise untrusted HTML, for example with DOMPurify, before using it.

  3. Experienced (5+ years)State

    Users double-click 'Like' quickly and the count rises by 1 instead of 2. What is the fix?

    async function like() {
      await api.like(jobId);
      setLikes(likes + 1);
    }
    • Store likes in a ref and re-render manually with a forceUpdate hook
    • Move setLikes before the await so React batches both of the updates
    • Use setLikes(l => l + 1), so each update builds on the latest value
    • Wrap the handler in useCallback so the closure is always current
    Show the answer

    Answer: Use setLikes(l => l + 1), so each update builds on the latest value. Both clicks captured likes from the same render, so each sets the same value. An updater function receives the latest queued state, so two clicks add two. useCallback does not change what the closure captured.

Take the full React mock test: 30 questions, 30 minutes.

How is the React mock test scored?

A question counts as right only when you pick exactly the right option, or all the right options where it says so; a question left blank counts as wrong. Your score is the share of the 30 questions you got right. The result also scores every topic, so you know what to revise before the interview.

  • 75% or more in a topica strength
  • 50% to 74%worth a revision
  • Under 50%a topic to work on

React mock test: questions people ask

Is the React mock test free?

Yes. The React mock test is free. You need a free CoreHRx Jobs account to start it, so your score and the topics to work on are saved.

How many questions are in the React mock test?

Each test has 30 multiple-choice questions to answer in 30 minutes, picked at random from 300 React questions across three levels, so every attempt is different.

Which React topics does the test cover?

The questions cover Hooks, Performance, Architecture, Components, Concurrent, Effects, Forms, JSX, Rendering, State, Context, Testing. Your result shows how you did in each topic.

Which level should I choose?

Fresher if you are a student or have less than a year of experience, Intermediate for 1 to 5 years at work, and Experienced for 5 years or more.

Can employers see my React score?

Only your best React score, and only when it is 60% or more. It shows on the job applications you send on CoreHRx. Lower scores stay private.

Can I take the React mock test again?

Yes, up to 10 tests a day. Each attempt picks questions you have not seen recently first.

All mock tests