React · Frontend system thinking
What is React and why would you use it?
Short answer
React is a JavaScript library for building user interfaces from components. You describe what the UI should look like for a given state, and React updates the DOM to match.
React's core idea is declarative rendering. Instead of manually finding DOM nodes and changing them, you return a description of the UI from a component. When state or props change, React works out what changed and updates the DOM.
function Welcome({ name }) {
return <h1>Hello, {name}</h1>;
}
function App() {
return (
<main>
<Welcome name="Asha" />
<Welcome name="Ravi" />
</main>
);
}Why teams use it
- Components make UI reusable and easier to reason about
- Declarative updates remove a large class of manual DOM bugs
- Unidirectional data flow makes state changes predictable
- A large ecosystem covers routing, data fetching, forms and testing
- React Native reuses the same model for mobile
React is a library, not a full framework. It does not prescribe routing, data fetching or project structure. In an interview, say that clearly and explain which surrounding tools you would choose and why.
Follow-ups you should expect
Interviewers use these to check whether the first answer was understanding or memorisation.
- 1Is React a library or a framework?
- 2What does declarative UI mean?
- 3How does React differ from direct DOM manipulation?
- 4When would you not choose React?
Say it in the interview
React is a library for building UI from components. I describe what the interface should look like for a given state, and React updates the DOM to match. That declarative model, plus component reuse and one-way data flow, makes complex interfaces easier to reason about. React is not a complete framework, so I still choose tools for routing, data fetching and testing, and I do not assume it makes performance automatic.
Use this as a model, not a script. Saying it in your own words is what makes it survive follow-up pressure.
Related questions
Reading is step one
Now say it out loud.
Understanding an answer and delivering it under pressure are different skills. Rehearse this topic in a live React mock interview and get scored feedback on depth, clarity and confidence.