Capgemini
Enliven Learning Interview Questions and Answers
Q1. What is redux, explain about middleware?
Redux is a state management library for JavaScript applications. Middleware is a function that intercepts actions before they reach the reducer.
Redux is used to manage the state of an application in a predictable way.
Middleware in Redux allows you to write logic that has access to the actions being dispatched.
Common middleware in Redux includes logging, asynchronous API calls, and routing.
Example: Redux Thunk is a popular middleware for handling asynchronous actions in Redux.
Q2. What is hooks and explain useEffect
Hooks are a new addition in React 16.8 that allow you to use state and other React features without writing a class.
Hooks are functions that let you use state and other React features in functional components.
useEffect is a hook that lets you perform side effects in function components.
It is similar to componentDidMount, componentDidUpdate, and componentWillUnmount in class components.
useEffect takes two arguments: a function that contains the side effect logic, and an option...read more
Q3. What is props,ternary operator?
Props are used to pass data from parent to child components in React. Ternary operator is a conditional operator that evaluates a condition and returns one of two values.
Props are read-only and help in maintaining the unidirectional data flow in React
Ternary operator syntax: condition ? value if true : value if false
Example of props:
Example of ternary operator: const message = isTrue ? 'Yes' : 'No';
Q4. What is throttling?
Throttling is a technique used to control the rate at which a function is executed.
Throttling limits the number of times a function can be called over a specified time period.
It helps in optimizing performance by preventing excessive function calls, especially in scenarios like scroll events or API requests.
Example: Limiting the number of API calls to a server to prevent overwhelming the server with too many requests.
Q5. What is Virtual Dom
Virtual DOM is a lightweight copy of the actual DOM, used for efficient updates in React applications.
Virtual DOM is a concept in React where a lightweight copy of the actual DOM is maintained.
When changes are made to the virtual DOM, React compares it with the actual DOM and only updates the necessary parts.
This helps in improving performance by minimizing the number of updates to the actual DOM.
Q6. Way of copy a object
Use the spread operator or Object.assign() method to copy an object in JavaScript.
Use the spread operator: const newObj = { ...oldObj };
Use Object.assign() method: const newObj = Object.assign({}, oldObj);
More about working at Capgemini
Interview Process at Enliven Learning
Top React Js Frontend Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month