State management and data fetching · senior
Redux Toolkit: slices, selectors, side effects and RTK Query
Redux Toolkit (2.x) is the standard way to write Redux: configureStore sets up devtools and safety checks, createSlice uses Immer so you can write "mutating" reducers, memoized selectors prevent re-renders, and side effects go in thunks, the listener middleware or RTK Query.
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceThe notes
What you must know
configureStoreadds Redux DevTools, the thunk middleware, and development checks for mutation and non-serializable values.createSlicegenerates action creators and a reducer; Immer turns draft mutations into immutable updates.useSelectorre-renders when the selected value changes by reference; selectors that return new arrays or objects needcreateSelector(Reselect) memoization.- Middleware signature:
store => next => action => { ...; return next(action) }. - Side effects:
createAsyncThunk(pending/fulfilled/rejected actions plus an abortsignal); the listener middleware (react to actions,cancelActiveListeners,delay) for orchestration; redux-saga (generators,takeLatest) still exists in older codebases but RTK recommends the listener middleware for most cases. - Server data belongs in RTK Query, not hand-written slices: endpoints, caching, tag invalidation, polling, optimistic updates via
onQueryStarted. createEntityAdapternormalises collections by id (ids array + entities map) so one update reaches every view.- Current line is 2.x (2.14 in late 2026) with a 3.0 roadmap announced; Redux core 5 and React-Redux 9 pair with it. (Version detail from release listings; verify before quoting.)
The red pen
Common traps: mistake → fix
Mistake: "Put async logic in reducers"
Fix: reducers must be pure; use thunks or listeners.
Mistake: "Sagas for every fetch"
Fix: heavy; use RTK Query.
Mistake: "Immer means Redux state is mutable"
Fix: Immer produces new immutable objects.
Easy to hard
Questions interviewers ask, easy to hard
- What does Redux Toolkit add on top of plain Redux?
- Why can
createSlicereducers "mutate"? - Why do derived arrays break
useSelectorequality, and how doescreateSelectorhelp? - Thunk vs saga vs listener middleware: implement "cancel the previous search request" in each.
- When would you move fetching to RTK Query?
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceYour first interview is free
Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.