JS Guide
HomeQuestionsSearchResources
Search

Built for developers preparing for JavaScript, React & TypeScript interviews.

ResourcesQuestionsSupport
HomeQuestionsSearchProgress
HomeQuestionsreact

react

React components, hooks, patterns, and best practices

Your Progress

0 of 7 completed

0%

7 Questions

junior Level
1
What is JSX and why does React use it?
junior
jsx
JSX is a syntax extension that allows writing HTML-like code in JavaScript. React uses it because it provides a familiar, readable way to describe UI structure while leveraging JavaScript's full power for logic and expressions.
2
What is the difference between functional and class components in React?
junior
components
Functional components are JavaScript functions that return JSX and use hooks for state/lifecycle. Class components extend React.Component and use this.state and lifecycle methods. Functional components with hooks are now the recommended approach.
3
What are props in React and how do you pass data between components?
junior
props
Props (properties) are read-only inputs passed from parent to child components, similar to function arguments. They enable component reusability and one-way data flow from parent to child.
4
What is state in React and how is it different from props?
junior
state
State is internal, mutable data managed within a component that triggers re-renders when changed. Props are external, read-only inputs passed from parent components. State is for data that changes over time; props are for configuring components.
5
Why are keys important when rendering lists in React?
junior
lists
Keys help React identify which items in a list have changed, been added, or removed. They should be unique among siblings and stable across renders. Using proper keys improves performance and prevents bugs with component state.
6
Why would you choose React over other frameworks like Vue or Angular?
junior
fundamentals
React is a flexible UI library (not a full framework) with virtual DOM optimization, massive ecosystem (React Native, Next.js), largest job market, and one-way data binding that makes debugging easier. Its component-based architecture and JSX syntax offer a JavaScript-first approach.
7
What is unidirectional data flow in React and why is it important?
junior
data-flow
Unidirectional data flow means data moves one direction only: parent → child via props. Children cannot modify parent state directly; they must use callback functions. This makes state changes predictable and debugging easier.