Frontend Careers · Interview Strategy
React Developer Practice: Explaining Their Code Aloud
Quick summary — the 12 mistakes React developers make when explaining code
Writing React code is one skill. Explaining it clearly to an interviewer is an entirely different skill. After conducting hundreds of technical interviews, clear patterns emerge in the mistakes candidates make when asked to "walk through their code." This guide breaks down the 12 most common issues and how to fix them.
In this guide, you will learn:
- Starting with syntax instead of intent — why you need to explain the "what" before the "how".
- Forgetting to explain state flow — why not mentioning props and state is a major red flag.
- Skipping the component tree — how drawing the hierarchy makes you look senior.
- Ignoring performance — why not mentioning re-renders or `useMemo` hurts you.
- Failing to explain edge cases — why loading states and error handling matter.
SECTION 01Starting with Syntax vs. Intent
The most common mistake is opening a file and immediately reading the code line-by-line like a robot.
- The Mistake: "Here I have a `useState` hook, then I map over the `items` array, then I render a `div`..."
- The Fix: Start with the high-level goal. "This component is responsible for fetching a list of users and displaying them in a grid. It manages its own loading state and error state." Then dive into the code to prove how you did it.
SECTION 02Ignoring Component Hierarchy
A common mistake is failing to explain how the component fits into the broader application.
- The Mistake: Explaining the component in isolation without mentioning its parent or children.
-
The Fix: Draw the tree. "This `
` is rendered by ` `, and it passes individual user data down to a ` ` child component." This shows architectural thinking.
SECTION 03Missing State and Data Flow
React is all about data flow. If you don't explicitly explain how data moves, the interviewer will assume you don't understand it.
- The Mistake: Not explaining where the props come from or how state is updated.
- The Fix: Explicitly mention the flow. "The state lives in the parent component because it needs to be shared. When the user clicks the button, the state updates, causing a re-render, and the new data flows down via props."
SECTION 04Forgetting Hooks and Lifecycle
Failing to mention the dependency array of a `useEffect` is one of the most common red flags in React interviews.
- The Mistake: Saying "This runs on mount" without explaining the dependency array, or what happens when dependencies change.
- The Fix: Explain the trigger. "This `useEffect` runs only when the `userId` changes. If I left the array empty, it would only run once on mount."
SECTION 05Overlooking Performance Optimizations
Even for small components, mentioning how you would optimize them shows senior-level awareness.
- The Mistake: Not mentioning `useMemo`, `useCallback`, or `React.memo` if the component does heavy calculations or renders frequently.
- The Fix: Acknowledge the potential issue. "Because this list can grow large, I wrapped the child component in `React.memo` to prevent unnecessary re-renders."
SECTION 06Not Addressing Edge Cases
A robust component handles loading states, errors, and empty data. Failing to mention these makes your code look like a happy-path tutorial.
- The Mistake: Only explaining the path where everything works perfectly.
- The Fix: Point out your error handling. "Here I added a fallback UI if the API request fails, and here is the loading spinner while the data is fetching."
SECTION 07Test yourself — React code explanation
Five questions. No sign-up.
0 / 5Pick an answer to see why it is right or wrong.
SECTION 08Frequently asked questions
How do I start explaining a React component?
Start with the high-level goal. Explain what the component is responsible for and what data it needs (props/state) before diving into the specific JSX or logic.
Why is the `useEffect` dependency array so important?
It controls when the effect re-runs. If you don't explain the array, you might introduce bugs (like infinite loops) or miss essential re-renders.
Should I draw the component tree?
Yes. Drawing the component tree (even mentally, by saying "This is a child of X") shows that you understand the architecture and not just isolated code.
What should I mention regarding performance?
Mention `useMemo`, `useCallback`, or `React.memo` if the component does heavy lifting. It shows that you care about unnecessary re-renders.
What is a common mistake when explaining state?
Failing to explain *why* the state is in a certain component. (e.g., "I lifted the state up because it needs to be shared between these two siblings.")
SECTION 09Related reads
Classroom & online · Noida
Build a resume that proves impact, not just tools.
Our Data Analytics Training Course includes resume rebuilds, portfolio reviews, mock interviews, and placement support — everything you need to turn strong work into a strong resume.
₹15,500 · full programme- Resume & LinkedIn rebuilds
- Portfolio reviews
- Mock interviews
- Placement support