Code Review16 min read

React Code Review Interview Questions: 10 Pull Requests to Analyze

Practice reviewing realistic React pull requests containing stale closures, missing hook dependencies, unhandled async states, and memory leaks.

Pairlet TeamPublished: 2026-09-10

Code review interviews test candidate engineering maturity better than traditional algorithm puzzles. Candidates analyze realistic React pull requests containing concurrency bugs, performance bottlenecks, and hook misuse.

Bug 1: Stale Closure in useEffect Timer

JSX
// ❌ Flawed Implementation
function Timer() {

useEffect(() => { const id = setInterval(() => { setCount(count + 1); // Stale closure over initial count (0)! }, 1000); return () => clearInterval(id); }, []); // Empty dependency array

return

{count}
; }

// ✅ Corrected Implementation function TimerFixed() { const [count, setCount] = useState(0);

useEffect(() => { const id = setInterval(() => { setCount((prev) => prev + 1); // Functional state update }, 1000); return () => clearInterval(id); }, []);

return

{count}
; } ```

---

Practice React Code Review Live Explore Pairlet's interactive [React Custom Hook Bug Review task](https://www.pairlet.dev/problems/react-custom-hook-bugs) in a collaborative room.

Practice Live Coding

Conduct Live Coding Interviews with Zero Friction

No candidate sign-up required. Create an instant room, share the link, and code together in real time with shared code execution.

Related Articles