React
/Intermediate
Debugging Questions
Definition
Questions that provide broken code and ask you to spot the bug and fix it.
Explain Like I'm New
The interviewer shows you a piece of code that causes an infinite loop, a memory leak, or a stale closure, and asks you to explain why it's broken.
Real World Example
A classic stale closure bug where `setInterval` inside a `useEffect` keeps logging the old state value.
Common Use Cases
- •Live Coding Interviews
Interactive Example
Loading...
Console output will appear here...
Interview Questions
basic
- Why am I getting a 'Cannot update a component while rendering a different component' warning?
intermediate
- Spot the bug: `useEffect(() => { const timer = setInterval(() => console.log(count), 1000); }, []);`
advanced
- Why is my React app showing a blank white screen with no console errors in production?