A critical component is crashing in production. How would you debug it?
This statically generated page is showing stale data. How do you fetch and display live data on the client?
This component is failing its test. Fix the component to make the test pass.
This form doesn't reset correctly. Fix the bug and refactor to a more robust solution.
An expensive component is re-rendering unnecessarily. How would you fix this state management issue?
This data fetching component has a race condition. How do you fix it?
This component causes a hydration mismatch error. Why and how to fix it?
This component has hardcoded text. Refactor it to support multiple languages.
This component is not reusable. Refactor it using the composition pattern.
This legacy class component mixes logic and UI. Refactor it to a modern functional component using Hooks.
Why does this component log the old state value after calling a useState setter?
A child component is failing to update the parent's state. Why is this happening and how do you fix it?
Clarify the core React concepts: Element, Component, and Node.
Your app's state management is a mess. How would Flux architecture help?
Your UI freezes during large updates. How does React Fiber help?
This list re-renders inefficiently. How does React's reconciliation algorithm explain why?
This component makes duplicate API calls in development. How does Strict Mode help identify the bug?
Your team is evaluating React. How would you explain its core benefits?
This component has accessibility ID issues. Fix it with `useId`.
This modal is clipped by its parent. Fix it using a React Portal.
This component re-renders unnecessarily due to context object reference changes. How do you fix it?
This button should increment twice, but only increments once. How do you fix it?
An expensive component is re-rendering unnecessarily. How would you fix this state management issue?
This component flickers when resizing. Fix it using the correct effect hook.
This data fetching component is causing an infinite loop. How do you fix it?
This component is crashing with a JSX syntax error. How do you fix it?
This component is breaking layout. Fix it using a React Fragment.
This component is trying to modify a prop directly. How do you fix it?
This application suffers from 'prop drilling.' How do you fix it?
This component is crashing due to a 'Rules of Hooks' violation. How do you fix it?
This custom component is not forwarding its ref. How do you fix it?
This `useEffect` is logging a stale value. How do you fix its dependency array?
This component's UI is not updating. Why is direct state mutation problematic?
This component has issues managing a timer ID. Fix it with `useRef`.
This optimized component re-renders unnecessarily. How do you fix it with `useCallback`?
This large component is slowing down initial load. Implement code splitting.
This component is crashing the entire app. Implement an Error Boundary to gracefully handle the error.
This component performs expensive calculations unnecessarily. Optimize it with `useMemo`.
This component re-renders unnecessarily. How do you prevent it?
This component's state logic is complex. Refactor it with `useReducer`.
These components duplicate logic. Refactor them using a Higher-Order Component.
These components duplicate logic. Refactor them using the Render Props pattern.
These components duplicate stateful logic. Refactor them using a custom Hook.
This component manages loading state imperatively. Refactor it to use React Suspense.
This form uses an uncontrolled input. Refactor it to be a controlled component.
Questions
Q
C
Q
Q
C
Q
C
Q
C
Q
C
Q
C
Q
C
Q
C
Q
C
Q
C
Q
C
Q
C
Q
C
Q
C
Q
C
Q
C
Q
C
Q
C
Q
C
Q
C
Q
C
Q
C
Q
C
Q
C
Q
C
Q
C
Clarify the core React concepts: Element, Component, and Node.
How Different Experience Levels Approach This
Junior Engineer
They're all basically the same thing—they're all parts of React that make up the UI.
Senior Engineer
They're distinct concepts with specific meanings:
React Element A plain JavaScript object that describes what you want to see on the screen. It’s a lightweight, immutable blueprint—not the actual DOM node.
// A React Element describing a div
const divElement = <div>Hello!</div>;
// What JSX compiles to:
// React.createElement('div', null, 'Hello!')React Component A function or class that takes props and returns a React Element. Components are the reusable building blocks you write.
// A Function Component - returns a React Element
function MyComponent({ name }) {
return <h1>Hello, {name}!</h1>;
}React Node The broadest term—anything React can render:
- React Elements (
<div />,<MyComponent />) - Strings (
"Hello") - Numbers (
123) - Booleans,
null,undefined(ignored but valid) - Arrays of React Nodes
// All of these are valid React Nodes
<ParentComponent>
<div>Element node</div>
{"String node"}
{123}
{[<p key="1">Array item</p>]}
</ParentComponent>The Relationship:
- You write a React Component
- A Component returns a React Element
- An Element is a description of what to render
- A Node is anything React can render
What Makes the Difference?
- Context over facts: Explains when and why, not just what
- Real examples: Provides specific use cases from production experience
- Trade-offs: Acknowledges pros, cons, and decision factors
Practice Question
Which of the following best describes a 'React Element'?