React Developer

20+ React Developer Interview Questions and Answers for Freshers

Updated 16 Jul 2025
search-icon

Asked in Cisco

6d ago

Q. Covid Vaccination Distribution Problem

As the Government ramps up vaccination drives to combat the second wave of Covid-19, you are tasked with helping plan an effective vaccination schedule. Your goal is to ma...read more

Ans.

Maximize the number of vaccines administered on a specific day while adhering to certain rules.

  • Given n days, maxVaccines available, and a specific dayNumber, distribute vaccines to maximize on dayNumber

  • Administer positive number of vaccines each day with a difference of 1 between consecutive days

  • Ensure sum of vaccines distributed does not exceed maxVaccines

  • Output the maximum number of vaccines administered on dayNumber for each test case

3d ago
Q. How can we structure the top-level directories in Redux?
Ans.

Top-level directories in Redux should be structured based on functionality and feature modules.

  • Separate directories for actions, reducers, and components

  • Group related functionality together in separate directories

  • Use feature modules to encapsulate related actions, reducers, and components

  • Example: 'actions', 'reducers', 'components', 'utils', 'constants'

6d ago
Q. What are the differences between a class component and a functional component in ReactJS?
Ans.

Class components are ES6 classes that extend from React.Component and have access to state and lifecycle methods, while functional components are simple functions that take props as arguments and return JSX.

  • Class components are defined using ES6 classes and extend from React.Component

  • Functional components are simple functions that take props as arguments and return JSX

  • Class components have access to state and lifecycle methods, while functional components do not

  • Functional com...read more

2d ago
Q. What are the differences between stateless and stateful components in ReactJS?
Ans.

Stateless components do not have internal state, while stateful components have internal state.

  • Stateless components are functional components that do not have internal state.

  • Stateful components are class components that have internal state.

  • Stateless components are simpler and easier to test.

  • Stateful components are more complex and can hold and update internal state.

  • Example: Stateless component - const Button = () => <button>Click me</button>

  • Example: Stateful component - class...read more

Are these interview questions helpful?
6d ago
Q. What are the key differences between mapStateToProps() and mapDispatchToProps() in Redux?
Ans.

mapStateToProps() is used to access the Redux state in a component, while mapDispatchToProps() is used to dispatch actions to update the state.

  • mapStateToProps() is used to access the Redux state and return data as props for a component.

  • mapDispatchToProps() is used to dispatch actions to update the Redux state.

  • mapStateToProps() is a function that takes the current state as an argument and returns an object with props that will be passed to the component.

  • mapDispatchToProps() is...read more

6d ago
Q. What is the difference between slice and splice in JavaScript?
Ans.

slice() returns a shallow copy of a portion of an array without modifying the original array, while splice() changes the contents of an array by removing or replacing existing elements.

  • slice() does not modify the original array, while splice() does

  • slice() returns a new array, while splice() returns the removed elements

  • slice() takes start and end index as arguments, while splice() takes start index, number of elements to remove, and optional elements to add as arguments

  • Example...read more

React Developer Jobs

Robert Bosch Engineering and Business Solutions Private Limited logo
JAVA AWS React developer 5-8 years
Robert Bosch Engineering and Business Solutions Private Limited
4.1
Bangalore / Bengaluru
Capgemini Technology Services India Limited logo
React Developer | 4 To 6 Years | Gurgoan 4-9 years
Capgemini Technology Services India Limited
3.7
Gurgaon / Gurugram
SopraSteria logo
Python/React Developer 3-5 years
SopraSteria
3.8
Noida
5d ago
Q. How would you sort an array of integers in JavaScript?
Ans.

Use the built-in sort() method to sort an array of integers in JavaScript.

  • Use the sort() method with a compare function to sort the array in ascending order.

  • For descending order, modify the compare function to return b - a instead of a - b.

  • Example: const numbers = [4, 2, 5, 1, 3]; numbers.sort((a, b) => a - b);

6d ago
Q. What is a first-class function in JavaScript?
Ans.

A first-class function in JavaScript is a function that can be treated like any other variable.

  • Can be passed as an argument to other functions

  • Can be returned from other functions

  • Can be assigned to variables

  • Can be stored in data structures

Share interview questions and help millions of jobseekers 🌟

man-with-laptop
2d ago
Q. What is the diffing algorithm in ReactJS?
Ans.

React uses a diffing algorithm called Virtual DOM to efficiently update the actual DOM based on changes in state or props.

  • Virtual DOM is a lightweight copy of the actual DOM.

  • React compares the Virtual DOM with the previous Virtual DOM to identify the minimal number of changes needed to update the actual DOM.

  • This process is known as reconciliation and helps in optimizing performance by reducing unnecessary re-renders.

  • Example: If a component's state changes, React will update t...read more

3d ago
Q. Can you explain hoisting in JavaScript?
Ans.

Hoisting is a JavaScript mechanism where variable and function declarations are moved to the top of their containing scope.

  • Variable declarations are hoisted to the top of their scope but not their assignments.

  • Function declarations are fully hoisted, meaning they can be called before they are declared.

  • Hoisting can lead to unexpected behavior if not understood properly.

Asked in Worldline

1d ago
Q. What are callbacks in JavaScript?
Ans.

Callbacks in JavaScript are functions passed as arguments to other functions to be executed later.

  • Callbacks are commonly used in event handling, asynchronous programming, and functional programming.

  • They allow for functions to be executed after another function has finished its execution.

  • Example: setTimeout(callbackFunction, 1000) will execute callbackFunction after 1 second.

Asked in Simform

1d ago
Q. What is reconciliation in ReactJS?
Ans.

Reconciliation in ReactJS is the process of updating the DOM to match the virtual DOM after a component's state or props have changed.

  • Reconciliation is the algorithm React uses to update the UI efficiently.

  • It compares the virtual DOM with the actual DOM and only updates the parts that have changed.

  • Reconciliation is a key feature that helps React achieve high performance.

  • Example: When a user interacts with a React component, reconciliation ensures that only the necessary parts...read more

1d ago
Q. How is Relay different from Redux?
Ans.

Relay is a GraphQL client specifically designed for React, while Redux is a state management library for any JavaScript application.

  • Relay is tightly integrated with GraphQL, making it easier to fetch and manage data from a GraphQL server.

  • Redux is a more general-purpose state management library that can be used with any backend technology.

  • Relay uses a declarative approach to data fetching, where components declare their data dependencies upfront.

  • Redux relies on a more imperati...read more

6d ago
Q. What are the advantages of using Redux?
Ans.

Redux helps manage application state in a predictable way.

  • Centralized state management

  • Predictable state changes with actions and reducers

  • Time-travel debugging with Redux DevTools

  • Ecosystem of middleware for additional functionality

6d ago
Q. What is the Combine Reducer in Redux?
Ans.

Combine Reducer is a function in Redux that combines multiple reducers into a single reducer function.

  • Combines multiple reducers into a single reducer function

  • Helps manage different pieces of state in Redux store

  • Improves code organization and maintainability

  • Example: combineReducers({ reducer1, reducer2 })

  • Example: const rootReducer = combineReducers({ reducer1, reducer2 })

5d ago
Q. What are closures in JavaScript?
Ans.

Closures in JavaScript are functions that have access to variables from their outer scope even after the outer function has finished executing.

  • Closures allow functions to access variables from their parent function's scope

  • They maintain a reference to the variables they need, even after the parent function has finished executing

  • Closures are commonly used to create private variables and data encapsulation in JavaScript

  • Example: function outerFunction() { let outerVar = 'I am out...read more

4d ago
Q. What are props in React?
Ans.

Props in React are used to pass data from a parent component to a child component.

  • Props are read-only and cannot be modified by the child component.

  • Props are passed down the component tree.

  • Props can be any type of data, such as strings, numbers, objects, or functions.

  • Example: <ChildComponent name='John' age={25} />

3d ago

Q. What strategies can you implement to enhance the speed of a web application built with React?

Ans.

Optimize React apps using techniques like code splitting, memoization, and lazy loading for improved performance.

  • Implement code splitting using React.lazy and Suspense to load components only when needed.

  • Use React.memo to prevent unnecessary re-renders of functional components.

  • Optimize images and assets by using formats like WebP and implementing lazy loading.

  • Utilize the useCallback and useMemo hooks to memoize functions and values, reducing recalculations.

  • Leverage server-sid...read more

Asked in TechNeutron

6d ago

Q. What is react js? What is props? What is useRef hook and use context hook

Ans.

React JS is a JavaScript library for building user interfaces.

  • React JS is a declarative, efficient, and flexible JavaScript library.

  • It allows developers to build reusable UI components.

  • React uses a virtual DOM to efficiently update and render components.

  • Props are used to pass data from a parent component to a child component.

  • Props are read-only and cannot be modified by the child component.

  • useRef hook is used to create a mutable reference that persists across component render...read more

Asked in Bytesplex

6d ago

Q. Are you available for a full month?

Ans.

Yes, I am available for complete 1 month.

  • I am committed to completing any project I start

  • I have no prior commitments that would interfere with this timeline

  • I am willing to work extra hours if necessary to meet deadlines

4d ago

Q. How do you manage state in React?

Ans.

State management in React can be handled using local state, context API, or external libraries like Redux.

  • Local State: Use the useState hook for managing component-specific state. Example: const [count, setCount] = useState(0);

  • Context API: Use React's Context API for global state management across components. Example: const MyContext = createContext();

  • Redux: Use Redux for complex state management needs, allowing for a centralized store. Example: const store = createStore(redu...read more

6d ago

Q. Explain React Route Guards.

Ans.

React guard is a higher-order component used to restrict access to certain routes in a React application.

  • React guard is used for implementing authentication and authorization in React applications.

  • It can be used to prevent unauthorized users from accessing certain routes.

  • React guard can redirect users to a login page if they are not authenticated.

  • It can also be used to restrict access based on user roles or permissions.

1d ago

Q. What are the use cases for Axios interceptors?

Ans.

Axios interceptors are used to globally handle HTTP requests and responses in an application.

  • Interceptors can be used to add headers, handle errors, or modify requests before they are sent.

  • Example: Adding a token to all outgoing requests for authentication.

  • Example: Logging all incoming responses for debugging purposes.

Asked in Cognizant

4d ago

Q. What is the Virtual DOM?

Ans.

The Virtual DOM is a lightweight copy of the actual DOM that optimizes rendering and improves performance in React applications.

  • The Virtual DOM is a JavaScript representation of the real DOM.

  • React uses the Virtual DOM to minimize direct manipulation of the real DOM, which is slow.

  • When a component's state changes, React creates a new Virtual DOM tree.

  • React compares the new Virtual DOM with the previous one using a process called 'reconciliation'.

  • Only the differences (or 'diffs...read more

Asked in Accenture

3d ago

Q. Explain React Hooks.

Ans.

React Hooks are functions that let you use state and other React features without writing a class.

  • Hooks allow functional components to manage state using the useState hook.

  • useEffect hook enables side effects like data fetching and subscriptions.

  • Custom hooks can be created to encapsulate reusable logic.

  • Hooks must be called at the top level of a component, not inside loops or conditions.

  • Common built-in hooks include useContext, useReducer, and useMemo.

Interview Experiences of Popular Companies

TCS Logo
3.6
 • 11.1k Interviews
Accenture Logo
3.7
 • 8.7k Interviews
Infosys Logo
3.6
 • 7.9k Interviews
Cognizant Logo
3.7
 • 5.9k Interviews
Capgemini Logo
3.7
 • 5.1k Interviews
View all
Interview Tips & Stories
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories
React Developer Interview Questions
Share an Interview
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+

Reviews

10L+

Interviews

4 Cr+

Salaries

1.5 Cr+

Users

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2025 Info Edge (India) Ltd.

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits