Seasia Infotech
Skt Enterprise Interview Questions and Answers
Q1. Whai is useEffect hooks in React.Js. Why use empty array[]
useEffect is a hook in React that allows performing side effects in functional components.
useEffect is used to perform side effects in functional components.
It takes two arguments: a function and an array of dependencies.
The function is executed after every render cycle.
The array of dependencies is used to specify when the effect should be re-executed.
An empty array [] means the effect should only be executed once, on component mount and unmount.
Q2. How to manage state in functional components
Use useState hook to manage state in functional components
Import useState hook from React
Declare state variable using useState hook
Use state variable and setState function to update state
Pass state variable and setState function as props to child components if needed
Q3. What is hooks in React.Js
Hooks are a new feature 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 React state and lifecycle methods inside functional components
They allow you to reuse stateful logic across multiple components
useState is a hook that lets you add state to functional components
useEffect is a hook that lets you use lifecycle methods in functional components
useContext is a hook that lets you use context in func...read more
Q4. What is reducer in Redux
Reducer is a pure function that takes the previous state and an action, and returns the new state in Redux.
Reducers specify how the application's state changes in response to actions sent to the store.
They are pure functions that take the previous state and an action, and return the new state.
Reducers should not modify the previous state, but return a new object if the state changes.
Redux uses a single root reducer function that combines multiple reducers into one.
Example: fu...read more
Q5. How Redux works
Redux is a predictable state container for JavaScript apps.
Redux is a library for managing application state.
It provides a central store for all the state in an application.
State changes are made through actions, which are dispatched to the store.
Reducers are pure functions that take the current state and an action, and return the new state.
Selectors are functions that extract data from the state.
Middleware can be used to intercept and modify actions before they reach the red...read more
Q6. Life cycle method in React.Js
Life cycle methods are functions that are invoked at various stages of a component's existence in React.Js.
There are three categories of life cycle methods: mounting, updating, and unmounting.
Mounting methods are called when a component is being created and inserted into the DOM.
Updating methods are called when a component is being re-rendered due to changes in its props or state.
Unmounting methods are called when a component is being removed from the DOM.
Examples of life cyc...read more
Interview Process at Skt Enterprise
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month