React Redux Interview Questions & Answers 2026
- Authors

- Name
- Geeks Kai
- @KaiGeeks

These 31 Redux questions distinguish modern Toolkit workflows from APIs you may encounter in older applications. Start with store ownership and pure reducers, then follow asynchronous requests, selector stability and persistence boundaries. Classic connect and Saga questions remain for maintenance interviews.
Version scope: The executable modern examples target React/React DOM 19.3.0, Redux Toolkit 2.14.0, React Redux 9.3.1, and Redux 5.0.1. Classic API fragments are labeled separately. connect is deprecated in React Redux 9.3 but remains available; it is not the default teaching path for new function components.
Redux is a predictable state container for JavaScript applications. Its store holds application state, actions describe events, and reducers calculate the next state. React Redux connects a React tree to that store. Not every piece of UI state belongs there.
The modern starting point is Redux Toolkit, rather than a historical bundle-size comparison or a collection of hand-configured packages. This article distinguishes core Redux concepts from React bindings and optional third-party middleware.
The three principles are a shared state tree, changes described by dispatched actions, and pure reducer calculations. Redux Toolkit keeps those principles while generating action creators and using Immer for immutable updates. The apparent mutation below applies to an Immer draft, not the previous real state.
This complete counter module uses configureStore and createSlice:
// file: counter-store.js
import { configureStore, createSlice } from "@reduxjs/toolkit"
const counterSlice = createSlice({
name: "counter",
initialState: { value: 0 },
reducers: {
increment(state) {
// Immer applies this draft update without mutating the previous store snapshot.
state.value += 1
},
},
})
export const counterReducer = counterSlice.reducer
export const { increment } = counterSlice.actions
export function createCounterStore({ initialValue = 0 } = {}) {
return configureStore({
reducer: { counter: counterReducer },
preloadedState: { counter: { value: initialValue } },
})
}
createStore remains a classic core API. configureStore supplies the normal modern defaults, including thunk support and development checks; a new project need not recreate that setup manually.
Redux adds concepts and conventions that can be unnecessary for a small local interaction. A shared store also requires deliberate state ownership, serializable values, immutable updates, and a policy for server data and persistence. These are design trade-offs, not proof that Redux has weak TypeScript support or that Flux is categorically better.
Redux Toolkit is written with TypeScript support and reduces boilerplate. Use local React state when its scope is local, and evaluate RTK Query when remote-data caching is the actual problem.
mapStateToProps() and mapDispatchToProps()?These are the classic connect bindings. mapStateToProps selects values for component props; mapDispatchToProps binds action creators to dispatch. In React Redux 9.3, connect is deprecated but still available, so keep legacy questions version-labeled. New function components should normally use useSelector and useDispatch.
An object shorthand contains action creators, not callbacks that have already dispatched an action. For example, with toggleTodo imported from the application:
const mapDispatchToProps = { onTodoClick: toggleTodo }
A function form remains useful when binding depends on ownProps. Object shorthand is a convenience, not a requirement for every existing integration.
Do not dispatch while a reducer is executing: Redux forbids it, rather than treating it as merely a style preference. A reducer calculates the next state without network calls, storage writes, subscriptions, or other effects. Put orchestration in the caller, a thunk, RTK Query, or suitable middleware.
In a single browser application, export a declared store from a module and import it where an integration genuinely needs it. Prefer passing the store or a focused operation when that makes ownership clearer.
This module is scoped to one browser application:
import { createCounterStore } from "./counter-store"
export const store = createCounterStore()
For SSR, create a separate store for each request rather than sharing this mutable singleton across users. A server/client framework integration needs its own hydration and ownership design.
MVW is a broad historical label for model/view architectures, not one API with a fixed performance profile. Cyclic update dependencies, unclear ownership, and difficult history tracking can be design problems, but DOM operations are not inherently slow in every application. Evaluate the actual update graph and workload rather than treating this label as a reason to adopt Redux.
Redux coordinates state changes through actions and reducers. RxJS provides Observable-based composition of event streams and asynchronous work. They solve different problems and may be used together. Redux is not a substitute for half of Angular, and RxJS is not simply a drop-in replacement for every Promise. No RxJS integration is required by the examples here.
A pure root reducer can pass undefined to its combined reducer on a logout action, letting each included slice return its initial state. This complete example resets the counter from the earlier module:
// file: reset-store.js
import { combineReducers, configureStore } from "@reduxjs/toolkit"
import { counterReducer } from "./counter-store"
export const USER_LOGOUT = "session/loggedOut"
const appReducer = combineReducers({ counter: counterReducer })
export function rootReducer(state, action) {
const nextInput = action.type === USER_LOGOUT ? undefined : state
return appReducer(nextInput, action)
}
export function createResettableStore() {
return configureStore({ reducer: rootReducer })
}
Clearing a persisted copy is a separate operation outside the reducer. Use the actual persistence library and configuration; do not guess storage keys by appending each slice name to persist:. A Redux reset also does not revoke a server session or prove that logout succeeded.
Context passes a value through the React tree. Redux adds a store with explicit actions, reducers, subscription behavior, middleware, and debugging conventions; React Redux provides React bindings to that store. These responsibilities are different, so choose according to the problem rather than assuming every Context value needs Redux.
React Redux uses Context to make its store available, and exposes documented Provider/Hook APIs. Use those APIs instead of depending on undocumented internals.
Reducers always return the accumulation of the state (based on all previous and current actions). Therefore, they act as a reducer of state. Each time a Redux reducer is called, the state and action are passed as parameters. This state is then reduced (or accumulated) based on the action, and then the next state is returned. You could reduce a collection of actions and an initial state (of the store) on which to perform these actions to get the resulting final state.
Use an explicit asynchronous operation. For application data fetching, consider RTK Query; createAsyncThunk is useful when the application needs an async action workflow. configureStore already includes thunk middleware.
The complete store below checks the HTTP result, awaits JSON parsing, validates the selected response fields, and exposes loading/failure state. The latest request ID owns the account result so an older request cannot overwrite a newer selection. The /account/:id endpoint is an application contract; the fixture intercepts it locally, and a real application must implement its authenticated server endpoint.
// file: account-store.js
import { configureStore, createAsyncThunk, createSlice } from "@reduxjs/toolkit"
export const ACCOUNT_STATUS = Object.freeze({ IDLE: "idle", LOADING: "loading", SUCCEEDED: "succeeded", FAILED: "failed" })
export const fetchAccount = createAsyncThunk("account/fetch", async (id, { signal }) => {
if (typeof id !== "string" || id.trim() === "") {
throw new TypeError("Account ID must be a non-empty string")
}
const response = await fetch("/account/" + encodeURIComponent(id), { signal })
if (!response.ok) {
throw new Error("Account request failed: HTTP " + response.status)
}
const account = await response.json()
if (account?.id !== id || typeof account?.displayName !== "string") {
throw new Error("Invalid account response")
}
return { id: account.id, displayName: account.displayName }
})
const accountSlice = createSlice({
name: "account",
initialState: { currentAccount: null, status: ACCOUNT_STATUS.IDLE, error: null, activeRequestId: null },
reducers: {},
extraReducers(builder) {
builder.addCase(fetchAccount.pending, (state, action) => {
state.status = ACCOUNT_STATUS.LOADING
state.error = null
state.activeRequestId = action.meta.requestId
})
builder.addCase(fetchAccount.fulfilled, (state, action) => {
if (state.activeRequestId !== action.meta.requestId) {
return
}
state.currentAccount = action.payload
state.status = ACCOUNT_STATUS.SUCCEEDED
state.activeRequestId = null
})
builder.addCase(fetchAccount.rejected, (state, action) => {
if (state.activeRequestId !== action.meta.requestId) {
return
}
state.status = ACCOUNT_STATUS.FAILED
state.error = action.error.message || "Account request failed"
state.activeRequestId = null
})
},
})
export function createAccountStore() {
return configureStore({ reducer: { account: accountSlice.reducer } })
}
To require success before a follow-up action, use await store.dispatch(fetchAccount("account-1")).unwrap(), or explicitly match the returned fulfilled/rejected action. Awaiting dispatch alone normally resolves with an action even when the request failed. The caller must display or handle that failure; do not navigate as if every resolved dispatch means success.
Choose by ownership and lifetime. Shared application state and state that benefits from centralized inspection may belong in Redux; an input draft, open menu, or other local interaction can stay in the component. Server data can use a dedicated cache such as RTK Query. "All data in Redux, all UI outside" is not a general rule.
For current function components, use useSelector and useDispatch under a Provider. Subscribe to the fields the component actually needs instead of the entire store. This complete example uses the counter module from question 2 and creates one stable store per application instance:
// file: counter-panel.jsx
import { useState } from "react"
import { Provider, useDispatch, useSelector } from "react-redux"
import { createCounterStore, increment } from "./counter-store"
export function CounterPanel() {
const count = useSelector(state => state.counter.value)
const dispatch = useDispatch()
return (
<div>
<output>Count: {count}</output>
<button onClick={() => dispatch(increment())}>Increment</button>
</div>
)
}
export function CounterApp() {
const [store] = useState(() => createCounterStore())
return <Provider store={store}><CounterPanel /></Provider>
}
connect is a classic higher-order component API and is deprecated in React Redux 9.3, while still published for compatibility. Existing connected components can be maintained with that boundary in mind; do not read undocumented Context internals to bypass React Redux subscriptions.
A presentational component emphasizes rendering, while a container coordinates state or operations. These are informal architectural roles, not mandatory component types or directory names. A container may render its own DOM, and a function component or custom Hook can perform coordination without a separate container class.
Constants allows you to easily find all usages of that specific functionality across the project when you use an IDE. It also prevents you from introducing silly bugs caused by typos – in which case, you will get a ReferenceError immediately.
Classic projects may keep these in constants.js or actionTypes.js. Modern createSlice generates action types and creators; feature-local organization is usually easier to maintain than an obligatory global constants file.
export const ADD_TODO = "ADD_TODO"
export const DELETE_TODO = "DELETE_TODO"
export const EDIT_TODO = "EDIT_TODO"
export const COMPLETE_TODO = "COMPLETE_TODO"
export const COMPLETE_ALL = "COMPLETE_ALL"
export const CLEAR_COMPLETED = "CLEAR_COMPLETED"
In Redux, you use them in two places:
During action creation:
Let's take actions.js:
import { ADD_TODO } from "./actionTypes"
export function addTodo(text) {
return { type: ADD_TODO, text }
}
In reducers:
Let's create reducer.js:
import { ADD_TODO } from "./actionTypes"
export default (state = [], action) => {
switch (action.type) {
case ADD_TODO:
return [
...state,
{
text: action.text,
completed: false,
},
]
default:
return state
}
}
mapDispatchToProps()?There are a few ways of binding action creators to dispatch() in mapDispatchToProps().
Below are the possible options:
const mapDispatchToProps = (dispatch) => ({
action: () => dispatch(action()),
})
const mapDispatchToProps = (dispatch) => ({
action: bindActionCreators(action, dispatch),
})
const mapDispatchToProps = { action }
The third option is just a shorthand for the first one.
ownProps parameter in mapStateToProps() and mapDispatchToProps()?If the ownProps parameter is specified, React Redux will pass the props that were passed to the component into your connect functions. So, if you use a connected component:
import ConnectedComponent from "./containers/ConnectedComponent"
;<ConnectedComponent user={"john"} />
The ownProps inside your mapStateToProps() and mapDispatchToProps() functions will be an object:
{
user: "john"
}
You can use this object to decide what to return from those functions.
The current Redux style guide favors feature folders, with a slice and related selectors or logic kept near the feature. configureStore centralizes store setup. Separate actions/reducers/containers directories describe a classic organization, not the required modern default. Keep an existing coherent layout unless a real maintenance need justifies moving it.
redux-saga is a library that aims to make side effects (asynchronous things like data fetching and impure things like accessing the browser cache) in React/Redux applications easier and better.
It is available in NPM:
$ npm install --save redux-saga
Saga middleware runs generator-based workflows that can wait, resume, or be cancelled through its effect model. "Separate thread" is a mental-model metaphor, not a Web Worker or another JavaScript execution thread. Cancellation and cleanup depend on the workflow and effects involved.
call() and put() in redux-saga?call describes a function invocation for Saga middleware; the function may return a plain value, Promise, or generator. put describes dispatching an action. These are effect descriptions, not a rule that call can only receive a Promise.
The following is an illustrative Saga fragment with api.fetchUser supplied by the application; it is separate from the Toolkit fixture:
import { call, put } from "redux-saga/effects"
function* fetchUserSaga(action) {
// The middleware invokes the function and resumes with its result.
const userProfile = yield call(api.fetchUser, action.userId)
yield put({ type: "FETCH_USER_SUCCESS", userProfile })
}
Redux Thunk middleware allows you to write action creators that return a function instead of an action. The thunk can be used to delay the dispatch of an action, or to dispatch only if a certain condition is met. The inner function receives the store methods dispatch() and getState() as parameters.
redux-saga and redux-thunk?Thunks use ordinary functions and async/await for imperative orchestration. Sagas use generator/effect descriptions for their workflow model; both can coexist in an existing store. Toolkit includes thunks by default. The current Redux guidance favors RTK Query for fetching/caching and listener middleware for many reactive workflows; that guidance does not make every existing Saga invalid.
Redux DevTools is a live-editing time travel environment for Redux with hot reloading, action replay, and customizable UI. If you don't want to bother with installing Redux DevTools and integrating it into your project, consider using Redux DevTools Extension for Chrome and Firefox.
DevTools can inspect actions and state, replay reducer calculations, and support time-travel debugging depending on the chosen tool and configuration. Replaying or skipping an action does not undo a network request, email, payment, or storage write that already happened. Hot replacement and persisted debugging sessions are tool-specific capabilities, not guarantees of every Redux installation.
A selector reads or derives a value from state. A normal function runs when called; it is not automatically memoized. createSelector supplies memoization based on its input selectors and configured memoizer.
// file: todo-selectors.js
import { createSelector } from "@reduxjs/toolkit"
export const selectUserProfile = state => state.user.profile
export const selectCompletedTodos = createSelector(
[state => state.todos],
todos => todos.filter(todo => todo.isCompleted)
)
selectUserProfile is an ordinary lookup. selectCompletedTodos can reuse its derived array when the todos input reference is unchanged. Immutable updates and stable input selectors matter; do not claim every selector skips recomputation merely because its call arguments look similar.
Redux Form is an optional third-party form library associated with the classic Redux ecosystem. It stores form state in Redux and provides bindings for inputs. It is not part of Redux core or a requirement for using Redux Toolkit. Choose local form state or another form approach according to the application's actual needs.
Some of the main features of Redux Form are:
With configureStore, extend the default middleware rather than accidentally replacing thunk support and development checks. In this fragment, counterReducer and logger are supplied by the application:
import { configureStore } from "@reduxjs/toolkit"
const store = configureStore({
reducer: { counter: counterReducer },
middleware: getDefaultMiddleware => getDefaultMiddleware().concat(logger),
})
applyMiddleware is the classic core-store API. If maintaining that setup, match the installed middleware version: Redux Thunk 3 uses a named thunk export rather than assuming an old default export.
configureStore accepts preloadedState with the same shape as its reducer tree. It supplies initial values, not a permanent synchronization channel. This article's counter factory exposes the relevant initial value explicitly:
import { createCounterStore } from "./counter-store"
const store = createCounterStore({ initialValue: 5 })
Missing slice values can initialize through their reducers, but a wrong field or state shape is not fixed by passing a second arbitrary object. Match server/client initial state deliberately when using SSR.
Continue your React JS interview questions preparation with these related topics:
Master React State Management interview questions covering useState, Context API, Redux, and state optimization. Essenti...
Master Core React interview questions covering JSX, Virtual DOM, Components, Props, State, and more. Essential React JS ...
Comprehensive React Hooks interview questions covering useState, useEffect, useCallback, useMemo, useReducer, and custom...
Master all aspects of React development
This article is part of our comprehensive React JS interview questions series covering all aspects of React development. Explore all topics: