Common interview questions with model answers, common mistakes and follow-ups.
/
Active filters: 1
93 results
Right after calling setCount(count + 1), you log count and still see the old value. Why?
JuniorVery commonreactstate
You are designing a Tabs component for a design system used by many teams. How would you structure its API and make sure it stays accessible?
SeniorCommonreactdesign-systems
What should an image's alt text describe, and when should alt="" be used?
JuniorVery commonhtmlimage-alternatives
What is the difference between useEffect and useLayoutEffect, and when do you need the layout version?
MiddleCommonreactuselayouteffect
After deploying server rendering, you see hydration mismatch errors. What typically causes them, and how do you fix them properly?
SeniorVery commonreacthydration
What is the difference between a controlled and an uncontrolled input in React?
JuniorVery commonreactforms
Why does React need a key on list items, and why is the array index often a poor choice?
JuniorVery commonreactkeys
What is a React Fragment, and when do you need the long form with a key?
JuniorCommonreactfragments
How do you give a component prop a default value, and when is the default used?
JuniorCommonreactprops
A modal is rendered with createPortal into document.body. A click inside it triggers an onClick handler on a parent component in the React tree. Why?
MiddleSometimesreactportals
Users report that a dashboard feels sluggish after interactions. Walk through how you would find and confirm the cause of the slowness.
SeniorCommonreactperformance
A component copies a prop into state with useState(props.value) and then keeps it in sync with useEffect. What is wrong with this, and what should you do instead?
MiddleCommonreactderived-state
When would you choose useReducer over several useState calls?