PUBLIC QUESTION PREVIEW
React & Frontend interview questions
Hooks, state management, rendering, performance, browser fundamentals.
Showing 12 of 100 source questions. Sample answers are study material, not employer-specific hiring guidance.
How to work through this preview
Attempt each question before reading its answer. For a concept, give a definition and a concrete example. For code, state constraints, walk through a small input, and check complexity. For design, separate requirements from assumptions and explain failure handling. Use real situations for behavioral answers.
QUESTION 1 / medium / conceptual
What is the difference between useEffect and useLayoutEffect?
Sample answer
Hints to guide your next attempt
- When does each fire relative to DOM updates?
- Synchronous vs. asynchronous after render
Source tags: react / hooks / useEffect / useLayoutEffect / rendering
QUESTION 2 / medium / conceptual
What causes unnecessary re-renders in React and how do you prevent them?
Sample answer
Hints to guide your next attempt
- React re-renders when state/props change by reference
- useMemo, useCallback, React.memo for optimization
Source tags: react / performance / memo / useMemo / re-render
QUESTION 3 / hard / conceptual
Explain React's reconciliation algorithm. What is the "diffing" process?
Sample answer
Hints to guide your next attempt
- React compares old and new virtual DOM trees
- Same type = update, different type = unmount + remount
- Keys matter for lists
Source tags: react / reconciliation / virtual-dom / fiber / diffing
QUESTION 4 / easy / conceptual
What is the difference between controlled and uncontrolled components?
Sample answer
Hints to guide your next attempt
- Controlled: React state is the source of truth
- Uncontrolled: DOM is the source of truth
Source tags: react / controlled / uncontrolled / forms / refs
QUESTION 5 / easy / conceptual
What is useState and how does functional state update work?
Sample answer
Hints to guide your next attempt
- setState with a function receives the previous state
- Batching means multiple setStates in one event = one render
Source tags: react / hooks / useState / batching
QUESTION 6 / medium / conceptual
When should you use useReducer instead of useState?
Sample answer
Hints to guide your next attempt
- useReducer is better for complex state transitions
- Reducer makes state logic testable in isolation
Source tags: react / hooks / useReducer / state-management
QUESTION 7 / medium / conceptual
How does useContext work and what are its performance pitfalls?
Sample answer
Hints to guide your next attempt
- Every context consumer re-renders when context value changes
- Split contexts by update frequency
Source tags: react / hooks / useContext / context / performance
QUESTION 8 / easy / conceptual
What is useRef used for? What are the two main use cases?
Sample answer
Hints to guide your next attempt
- DOM access and mutable values that do not trigger re-render
Source tags: react / hooks / useRef / dom
QUESTION 9 / medium / conceptual
How do useMemo and useCallback work? When are they actually worth using?
Sample answer
Hints to guide your next attempt
- useMemo caches a value; useCallback caches a function
- Only worth it when the child is wrapped in React.memo
Source tags: react / hooks / useMemo / useCallback / performance
QUESTION 10 / medium / conceptual
What are custom hooks? What rules must you follow when writing them?
Sample answer
Hints to guide your next attempt
- Custom hooks extract reusable stateful logic
- Must start with "use" and can call other hooks
Source tags: react / custom-hooks / hooks / patterns
QUESTION 11 / medium / conceptual
What is React.memo? How is it different from useMemo?
Sample answer
Hints to guide your next attempt
- React.memo is for components; useMemo is for values
- React.memo does shallow prop comparison by default
Source tags: react / memo / performance / optimization
QUESTION 12 / medium / conceptual
What are Error Boundaries? How do you implement one?
Sample answer
Hints to guide your next attempt
- Error boundaries must be class components
- They catch errors in the render phase, not in event handlers
Source tags: react / error-boundary / class-components / error-handling
Check understanding, not recognition
- Can you explain the answer without reading it?
- Can you show when the approach fails or needs a different assumption?
- Can you connect the concept to a real project, task, or decision you have made?
- Can you distinguish a simplified interview example from a production requirement?
A LITTLE MORE CLARITY
Frequently asked questions
How many React & Frontend questions are shown here?
This public preview shows 12 questions with the supplied answers from the app's 100-question React & Frontend bank. Full interactive practice requires signing in.
Should I memorize the sample answers?
Use them as reference explanations, not a script or a guarantee of technical correctness for every environment. Explain your assumptions, validate code against your language and version, and discuss trade-offs. Behavioral answers should be built from your own experience.
What do hints and solution steps mean?
Hints identify ideas to consider before reading the answer. When the source question includes steps, they are shown as a separate walkthrough. Example capacities and design targets in a solution are assumptions for that exercise, not real system statistics.
BUILD YOUR NEXT OPPORTUNITY
Practice React & Frontend actively.
Sign in to use the full topic bank and interactive practice workspace.