Search test library by skills or roles
⌘ K

Adaface Sample React Questions

Here are some sample React questions from our premium questions library (10273 non-googleable questions).

Skills

🧐 Question

Medium

Context re-renders
Context
Solve
Review the following React code:
 image
Pick the correct statements:
            
            A: The code renders 10 INDIAN RUPEE
            B: The code renders 10 SINGAPORE DOLLAR
            C: The code does not render anything and throws an error since JavaScript objects are not valid as React children
            D: When the currency portion is clicked, the parent component is re-rendered
            E: When the currency portion is clicked, parent component will skip the re-render because shouldComponentUpdate returns false
            F: Parent component can be converted to a functional component with memoization (useMemo or memo) to avoid the re-render

Medium

Error Boundaries and Event handlers
Error Boundaries
Solve
Review the following React code:
 image
Notice that clicking on ‘Click Me’ will invoke handleClick which will throw an error. Also note that, ErrorBoundaryOne throws the error in getDerivedStateFromError. What will be rendered once ‘Click Me’ is clicked?
A: ErrorBoundaryOne will catch the error of MyComponent and <h1>C</h1> will be rendered
            B: ErrorBoundaryOne will catch the error of MyComponent and its own error, <h1>C</h1> will be rendered
            C: ErrorBoundaryTwo will catch the error of MyComponent and ErrorBoundaryOne, <h1>B</h1> will be rendered
            D: ErrorBoundaryTwo will catch the error of MyComponent and ErrorBoundaryOne, <h1>B</h1><h1>C</h1> will be rendered
            E: ErrorBoundaryTwo will catch the error of ErrorBoundaryOne. ErrorBoundaryOne will catch the error of MyComponent, <h1>B</h1> will be rendered
            F: Error thrown in the click handler is not caught by any error boundary, ‘Click Me’ button will be rendered

Medium

Rhyme Reducer
Hooks
Solve
Which of the following React code snippets
            - triggers the reducer ‘rhymeReducer’ to update the ‘song’ value to ‘Jack and Jill’
            - renders the updated ‘song’ value
            - does not produce any errors/warnings
 image
 image
🧐 Question🔧 Skill

Medium

Context re-renders
Context
3 mins
React
Solve

Medium

Error Boundaries and Event handlers
Error Boundaries
3 mins
React
Solve

Medium

Rhyme Reducer
Hooks
3 mins
React
Solve
🧐 Question🔧 Skill💪 Difficulty⌛ Time
Context re-renders
Context
React
Medium3 mins
Solve
Error Boundaries and Event handlers
Error Boundaries
React
Medium3 mins
Solve
Rhyme Reducer
Hooks
React
Medium3 mins
Solve

Adaface questions are trusted by enterprises globally

Amazon Morgan Stanley Vodafone United Nations HCL PayPal Bosch WeWork Optimum Solutions Deloitte Microsoft NCS Doubtnut Sokrati J&T Express Capegemini

We evaluated several of their competitors and found Adaface to be the most compelling. Great default library of questions that are designed to test for fit rather than memorization of algorithms.


Swayam Narain, CTO, Affable

hashtag image heart icon Swayam
Join 1200+ companies in 75+ countries.
Try the most candidate friendly skills assessment tool today.
Ready to streamline your recruitment efforts with Adaface?
Ready to streamline your recruitment efforts with Adaface?
Chat with us
40 min tests.
No trick questions.
Accurate shortlisting.
Ada
Ada
● Online
Previous
Score: NA
Next
✖️