Common interview questions with model answers, common mistakes and follow-ups.
/
Active filters: 1
93 results
When would you use obj.name versus obj[key]? How can you check whether an object owns a property?
JuniorVery commonjavascriptproperty-access
What is the difference between undefined and null, and what does typeof return for each?
JuniorVery commonjavascriptnull-undefined
You lead the migration of a large codebase from class components and legacy patterns to modern React with hooks and Strict Mode. How do you plan it?
SeniorSometimesreactmigration
Design an optimistic "like" button using React 19's actions and useOptimistic. How do you handle failure and keep the UI honest?
SeniorCommonreactserver-actions
How do you add and remove items at the end of an array? What do push and pop return?
JuniorVery commonjavascriptarray-basics
Several teams want to ship parts of one React application independently using micro-frontends. What are the main trade-offs, and when would you advise against it?
SeniorSometimesreactarchitecture
How does a parent get a ref to a DOM node inside a child component in React 19, and when would you use useImperativeHandle?
MiddleSometimesreactrefs
Your React app opens a modal dialog. What must you handle for keyboard and screen-reader users?
MiddleCommonreactaccessibility
Why must React component names start with a capital letter, and why shouldn't you define a component inside another component?
JuniorVery commonreactcomponents
A component renders {items.length && <List items={items} />} and sometimes shows a stray 0 on the page. Why, and how do you fix it?
JuniorCommonreactconditional-rendering
Two sibling components need to show and change the same value. How do you share it?
JuniorVery commonreactstate
A profile editor keeps the previous user's unsaved text when you switch to another user. How can the key prop fix this, and why does it work?
MiddleCommonreactreconciliation
What principles does React Testing Library encourage, and how would you test a form that shows an error after a failed submit?
MiddleVery commonreacttesting
How do React.lazy and Suspense help with code splitting, and where would you place the Suspense boundary?
MiddleCommonreactsuspense
When is React Context a good fit, and what performance problem appears if the provider's value is a new object on every render?
MiddleVery commonreactcontext
How does streaming server rendering with Suspense work, and how do you decide where to place Suspense boundaries on a page?
SeniorCommonreactstreaming
A form's submit button reloads the whole page in your React app. Why, and how should you handle submission?
JuniorVery commonreactforms
Memory usage of a long-running React single-page app keeps growing as users navigate. How would you find and fix the leak?
SeniorCommonreactmemory-leaks
How do you decide where the boundary between React Server Components and Client Components should go, and what can cross it?
SeniorVery commonreactserver-components
What is the difference between server state and client state, and why do teams often use a library like TanStack Query for the former?