Subjects

All subjects Django Java Python React Spring Boot JavaScript PHP
Sign Up Free
React 10 questions

State Management (Redux, Context API)

Manage global app state. Differentiate Context API for small state and Redux, actions, reducers, and stores for large apps.

More React
Interview questions 1–10 of 10
1

What is state management and why is it important?

State management is handling application state centrally. It prevents prop drilling, makes debugging easier, a...

Read answer →
2

What is Redux and how does it work?

// Redux: Predictable state container // 1. Action - describes what happened const INCREMENT = 'INCREMENT'; co...

Read answer →
3

What are the alternatives to Redux?

Context API, Recoil, Zustand, MobX, etc.

Read answer →
4

How do you use Redux Thunk for async actions?

// Redux Thunk - middleware for async operations function fetchUser(userId) { return dispatch => { dispa...

Read answer →
5

What is Redux Saga?

// Redux Saga - side effects management import { call, put, takeEvery } from 'redux-saga/effects'; function*...

Read answer →
6

What is Recoil and why use it over Redux?

// Recoil - simpler state management import { atom, selector, useRecoilState } from 'recoil'; // Atom - unit...

Read answer →
7

How do you handle global state without Redux?

// Using Context API with useReducer const StoreContext = React.createContext(); function StoreProvider({ chi...

Read answer →
8

What is MobX?

// MobX - reactive state management import { makeObservable, observable, action } from 'mobx'; import { observ...

Read answer →
9

How do you handle authentication state?

// Authentication context const AuthContext = createContext(); function AuthProvider({ children }) { const...

Read answer →
10

What is Zustand?

// Zustand - minimal state management import create from 'zustand'; const useStore = create((set) => ({ cou...

Read answer →