Redux interviews focus on predictable state, unidirectional data flow, and when Redux Toolkit or RTK Query beats hand-rolled stores.
15 Redux Interview Questions with Answers
Use the short version first, then offer trade-offs if the interviewer wants depth.
1. What is Redux and what problems does it solve?
Redux is a predictable state container for JavaScript apps. It centralizes state updates through a single store, pure reducers, and explicit actions—making data flow traceable and debuggable. It shines when many components share complex client state and you need consistent patterns across a large team.
2. Describe the Redux data flow.
UI dispatches an action object { type, payload }. Middleware may intercept for async work. Reducers compute the next state from previous state and action. The store notifies subscribers; React-Redux re-renders components whose selected state changed. The loop is unidirectional: action → reducer → view → action.
3. Why must reducers be pure functions?
Pure reducers given the same state and action always return the same next state with no side effects. That enables time-travel debugging, predictable tests, and hot reloading. Side effects belong in middleware, thunks, or listener middleware—not inside reducers.
4. What is middleware in Redux?
Middleware sits between dispatch and the reducer, extending dispatch with capabilities like async logic (redux-thunk), logging, or crash reporting. It follows the chain pattern: (store) => (next) => (action) => { ... next(action) }. RTK configureStore includes sensible defaults including thunk.
5. Difference between Redux Toolkit and classic Redux?
RTK reduces boilerplate with createSlice (actions + reducer generated), Immer-powered immutable updates, configureStore with DevTools and thunk prewired, and createAsyncThunk for async. Classic Redux required manual action types, switch statements, and spread-heavy reducers—error-prone at scale.
6. What is createSlice and how does Immer help?
createSlice defines name, initialState, and reducers; RTK generates action creators and the reducer. Immer lets you write mutating-looking logic that produces immutable drafts safely. You still return new state semantics without manual deep spreads for nested updates.
7. How does useSelector work and why memoize selectors?
useSelector subscribes to store changes and runs a selector function to pick state. Without memoization, returning new object references each render causes unnecessary re-renders. createSelector memoizes based on input slices—only recomputes when dependencies change.
8. When would you NOT use Redux?
Skip Redux for local component state, simple shared flags, or primarily server-fetched data better handled by RTK Query or TanStack Query. Context plus useReducer covers modest global state. Adding Redux for a handful of fields adds ceremony without payoff.
9. Explain createAsyncThunk lifecycle.
createAsyncThunk dispatches pending before the promise, fulfilled with payload on success, and rejected with error on failure. Extra reducers in a slice handle those action types to set loading, data, and error flags. It standardizes async patterns without ad-hoc action naming.
10. What is RTK Query and how does it differ from storing API data in Redux manually?
RTK Query generates reducers, actions, and hooks for fetch/cache/invalidate cycles. It handles deduplication, background refetch, cache tags, and loading states. Manual slices duplicate boilerplate and miss cache invalidation patterns RTK Query provides out of the box.
11. How do you structure Redux state in a large app?
Split by feature domains (auth, cart, ui) with combineReducers or RTK slices colocated per feature. Keep server cache in RTK Query slices separate from ephemeral UI state. Normalize entities (byId, allIds) for relational data to avoid duplication and stale nested copies.
12. What is the Flux pattern vs Redux?
Flux is the architectural pattern: unidirectional flow through actions, dispatcher, stores, and views. Redux is one Flux-inspired library with a single store and pure reducers instead of multiple mutable stores. Redux popularized predictable global state for React apps.
13. How do you test Redux reducers and thunks?
Reducers are pure—test by calling reducer(prevState, action) and asserting output. Thunks need a mock store with redux-mock-store or dispatch/getState stubs. RTK slices test the same way; integration tests render components with a real configureStore and Provider.
14. Explain Redux DevTools value in interviews.
DevTools record every action and state diff, enable time-travel by jumping to prior states, and support action replay for reproducing bugs. They reinforce why pure reducers matter—deterministic replay requires no hidden side effects in the reducer path.
15. Compare Redux, Context, and Zustand for global state.
Context propagates values without middleware or DevTools granularity; frequent updates can re-render large subtrees unless split carefully. Zustand offers minimal API and fine-grained subscriptions. Redux adds strict patterns, middleware ecosystem, and DevTools—worth it for complex client state at team scale.
Pro Tip
Sketch one feature slice with createSlice and an async thunk—showing less boilerplate than classic Redux wins credibility fast.