← Questions
React fundamentals and error handling
0
I was asked this
No reports yet. Sign in to say where you were asked it.
A coding interview question asked in Apple's technical phone screen, last asked Feb 2026. It tests react, frontend and error handling.
A conversation about React, followed by how you deal with errors in a React app. Explain each point with a short code example where it helps.
Concepts to explain
- The virtual DOM and reconciliation: what happens when state changes, and why
keymatters in lists. - Components, props and state: what triggers a re-render, and how to avoid unnecessary ones (
memo,useMemo,useCallback). - Hooks: the rules of hooks and why they exist,
useEffectdependencies and cleanup. - React 18 concurrent features: automatic batching, transitions (
useTransition),Suspense. - Server components versus client components: what runs where and what each can't do.
Error handling
- Error boundaries: what they catch, what they don't (event handlers, async code, server rendering), and where you place them.
- Errors in async work: failed requests, loading and error states, retries, and stale responses after a component unmounts.
- What the user sees when something breaks, and how errors are reported to monitoring.
Clarifying questions
- Which React version and framework (plain React, Next.js) is the app on?
- Should I write code, or explain and sketch?
What a strong answer covers
- An accurate model of rendering: render and commit phases, when effects run.
- Correct effect cleanup, for example cancelling a fetch with
AbortController. - An error boundary written out (a class component with
getDerivedStateFromErrorandcomponentDidCatch), and the async errors it cannot catch. - Concrete user-facing behaviour: a fallback UI, a retry button, keeping the rest of the page usable.
Follow-ups
- A list re-renders slowly when one item changes. How do you find and fix it?
- An effect runs twice in development. Why, and is it a bug?
- How would you handle errors thrown inside a server component?
Where it's asked
- Apple · Technical phone screen · Last asked Feb 2026
What it tests
react · frontend · error handling
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Sign in to submit your code; every attempt is kept here.
Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding
