Question presented to candidate: "Start me off simply — what is React, and what are the main features that define it?"
What a strong answer should cover:
- React is a library for building user interfaces, not a full framework — it deliberately leaves routing, data fetching, and build tooling to others.
- Declarative: you describe what the UI should look like for a given state; React works out the DOM operations.
- Component-based: the UI is composed from independent, reusable pieces that own their own state.
- The Virtual DOM and reconciliation: React diffs a cheap in-memory description against the previous one and applies the minimum real DOM changes.
- Unidirectional data flow: data travels down through props, which makes state changes traceable.
- Learn once, write anywhere: the same component model targets DOM, native, and other renderers.
- Bonus signal: an "element" is just a plain, frozen JavaScript object — the declarative description React works from.
Clarifying questions expected:
- "Do you want the pitch, or the mechanism underneath it?"
- "Should I cover the modern additions — Server Components and the compiler — or stick to fundamentals?"
Code / implementation expected: Optional. A tiny component showing declarative state-to-UI mapping is plenty.