# Additional Junior React Frontend Developer Interview Questions ## React Basics 1. What are the advantages of using React? 2. Can you explain the concept of "unidirectional data flow" in React? 3. How does React handle updates to the DOM efficiently? ## Functional Components 1. How do you create a functional component in React? 2. What are the differences between functional components and class components? 3. Can functional components have state? How? ## Props and State 1. How do you pass data from a parent component to a child component in React? 2. What happens if you try to modify `props` directly? 3. What is the difference between `state` and `props` in React? ## React Hooks 1. What are the rules of hooks in React? 2. How do you fetch data inside a React functional component using hooks? 3. What is the difference between `useState` and `useReducer`? 4. Can you explain how `useMemo` works and provide an example use case? ## Conditional Rendering 1. How do you conditionally render components in React? 2. What is the difference between using `&&` and a ternary operator for conditional rendering? ## Forms 1. How do you handle form inputs in React? 2. What is a controlled component, and how is it different from an uncontrolled component? 3. How would you implement validation in a React form? ## Event Handling 1. How do you handle click events in React? 2. What is the difference between binding an event handler in the constructor and using an arrow function? 3. How do you pass arguments to an event handler in React? ## React Router 1. What is the purpose of `BrowserRouter` in React Router? 2. How do you navigate programmatically in React Router? 3. What is the difference between `Switch` and `Routes` in React Router v6? ## State Management 1. How do you manage state in a large React application? 2. When should you use Context API instead of passing props? 3. What are the pros and cons of using a library like Redux for state management? ## Testing 1. How do you test a React component? 2. What is the purpose of Jest in a React project? 3. How would you test a component that uses hooks like `useEffect`? ## Performance Optimization 1. How can you optimize the performance of a React application? 2. What is the purpose of `React.memo`, and when should you use it? 3. How does lazy loading work in React? ## Error Handling 1. How do you handle errors in a React application? 2. What are error boundaries, and when would you use them? ## Miscellaneous 1. What is React's strict mode, and what is its purpose? 2. How do you debug React applications? 3. What are some common anti-patterns in React, and how can you avoid them? 4. Can you explain the purpose of React's `key` prop? 5. What are portals in React, and when would you use them?