Redux is the state library React interviewers reach for most, both to test the predictable data-flow model and to see whether you know when not to use it. The questions below cover the core loop — actions, reducers, store, dispatch — the modern Redux Toolkit that most teams now use, async with thunks, selectors, and the judgement call of Redux versus lighter tools. Answer the flow crisply and always name the trade-off.
How to answer Redux questions
Anchor every answer to the one-way loop: a component dispatches an action, a pure reducer computes the next state from the previous state and the action, the store updates, and subscribed components re-render with the new state. Predictability is the whole point — the same action on the same state always produces the same result, which is what makes Redux testable and debuggable. Then, whenever asked "should you use Redux," lead with the trade-off, not a yes.
Q1. What are the core principles of Redux?
Three: a single source of truth (all app state in one store), state is read-only (you never mutate it, you dispatch actions describing what happened), and changes are made by pure reducers (functions of (state, action) => newState with no side effects). These constraints make every state change predictable, traceable and replayable.
The payoff of the constraints is tooling: because every change is a plain action object through a pure function, Redux DevTools can log, inspect and time-travel through your entire state history.
Interview note: Follow-up: "why must reducers be pure?" So the same inputs always give the same output — enabling time-travel, testing and safe replay. A reducer that fetches or mutates breaks all three.
Q2. Walk through the Redux data flow.
A UI event calls dispatch(action). The action — a plain object with a type and optional payload — reaches the store. The store runs the root reducer with the current state and the action; the reducer returns a new state. The store notifies subscribers, and connected components re-render with the changed slice.
// Action → reducer → new state → re-render
dispatch({ type: "cart/itemAdded", payload: { id: 42 } });
That single direction — never a component mutating the store directly — is what keeps large apps traceable. Every change has a named action you can find in DevTools.
Interview note: Trap: "can a component change the store without an action?" No — that bypasses the whole model and DevTools; the store is only ever updated by dispatched actions running through reducers.
Q3. What is Redux Toolkit and why is it the default now?
Redux Toolkit (RTK) is the official, recommended way to use Redux. createSlice generates action creators and types from reducer functions, Immer lets you write mutating-looking code that produces immutable updates, and configureStore sets up the store with sensible middleware and DevTools. It removes the boilerplate that made classic Redux painful.
const counterSlice = createSlice({
name: "counter",
initialState: { value: 0 },
reducers: {
increment: (state) => { state.value += 1; }, // Immer keeps it immutable
addBy: (state, action) => { state.value += action.payload; },
},
});
export const { increment, addBy } = counterSlice.actions;
Interview note: Trap: "you mutated
state.value— isn't that illegal in Redux?" InsidecreateSlice, Immer intercepts the mutation and produces a new immutable state; you never mutate the real state object. Outside Immer, that would be a bug.
Q4. How does Redux handle asynchronous logic?
Through middleware. Redux Thunk (included in RTK) lets an action creator return a function receiving dispatch, so it can dispatch a pending action, run an async call, then dispatch success or failure. RTK's createAsyncThunk generates the pending/fulfilled/rejected actions automatically.
export const fetchUser = createAsyncThunk("user/fetch", async (id) => {
const res = await fetch(`/api/users/${id}`);
return res.json(); // becomes the fulfilled action's payload
});
Interview note: Follow-up: "thunk vs saga?" Thunks are simpler and cover most needs; sagas use generators for complex, long-running or cancellable async flows. For server data, many teams now prefer RTK Query or React Query over either.
Q5. What is a selector, and why memoize it?
A selector is a function that extracts a slice of state, like state => state.cart.items. It decouples components from the store shape. A memoized selector (via createSelector from Reselect, bundled in RTK) caches derived results so an expensive computation or a new array reference is not produced on every state change, avoiding wasteful re-renders.
const selectTotal = createSelector(
(state) => state.cart.items,
(items) => items.reduce((sum, i) => sum + i.price, 0)
);
Interview note: Trap: "
useSelector(state => state.items.filter(...))re-renders every time — why?"filterreturns a new array each call, failing the reference check; wrap it increateSelectorso the result is memoized.
Q6. How does React Redux connect components to the store?
Wrap the app in <Provider store={store}>, then read state with the useSelector hook and dispatch with the useDispatch hook. useSelector subscribes the component to the store and re-renders it when its selected value changes, using a strict-equality check by default.
function Cart() {
const total = useSelector(selectTotal);
const dispatch = useDispatch();
return <button onClick={() => dispatch(checkout())}>Pay {total}</button>;
}
Interview note: Follow-up: "what does
useSelectorcompare?" The previous and next selected value by reference (===) by default — which is why returning new objects/arrays without memoization causes extra renders.
Q7. Why must Redux updates be immutable?
Redux detects change by reference comparison — if the state object is the same reference, it assumes nothing changed and skips re-rendering. Mutating state in place keeps the same reference, so components miss the update; it also breaks time-travel and DevTools. RTK's Immer lets you write concise updates while preserving immutability under the hood.
Interview note: Trap: "you did
state.items.push(x)in a plain reducer and the UI didn't update — why?" You mutated the array in place; the reference is unchanged, so React Redux skips the render. Return a new array, or use Immer insidecreateSlice.
Q8. When should you NOT use Redux?
Skip Redux when state is local (use useState), when it is server data (use a caching data layer like React Query or RTK Query), or when a small app's global needs are met by Context. Redux earns its cost with large, frequently-updated shared client state that benefits from selectors, middleware and DevTools. Reaching for Redux by default is a common anti-pattern the interviewer is probing for.
The state management questions place Redux on the broader cost ladder, and the Context API questions cover the lighter alternative.
Interview note: Follow-up: "Redux vs Context?" Context transports one value and re-renders all consumers on change; Redux is a store with selective subscription via selectors, middleware and tooling — different tools, not competitors for the same job.
Q9. What is RTK Query and where does it fit?
RTK Query is a data-fetching and caching layer built into Redux Toolkit. You define endpoints and it generates hooks that handle fetching, caching, deduplication, background refetching and invalidation — turning most 'store the API response in Redux' code into a few lines. It targets the server-state problem so you do not hand-roll loading flags and cache logic in slices.
Interview note: Trap: "RTK Query vs React Query?" Both solve server-state caching; RTK Query integrates with a Redux store, React Query is standalone. Choose by whether you already run Redux for client state.
How to prepare
Build one small slice end to end with Redux Toolkit: createSlice for reducers and actions, configureStore, useSelector/useDispatch in a component, and a createAsyncThunk for a fetch. That covers most of the questions above in one exercise, and shows the modern patterns rather than the outdated boilerplate. Then rehearse the judgement answer — when Redux is right versus Context or a data layer — because interviewers weight that heavily. Pair this with the state management and Context API sets, refresh patterns in the React learning path, and use a mock interview to practise walking the data flow out loud under follow-up pressure.
Frequently Asked Questions
What are the three core principles of Redux?
What is Redux Toolkit and should I use it?
How does Redux handle async operations?
What is a selector and why use one?
When should I not use Redux?
Want to Build Your Career in Java Full Stack with AI?
Join CodeBegun and train with working industry engineers — View the Java Full Stack curriculum

