Q341. What is `createSelector`?
`createSelector` (from **Reselect**, which Redux Toolkit re-exports) creates **memoized selectors**. It takes one or more "input selectors" and a "result function", and o...
Technical Question Bank · Peer-Reviewed
Search and filter frequently asked interview questions across technical, programming, and behavioral domains. Tailor your interview preparation by difficulty for freshers or experienced developers (454 available).
`createSelector` (from **Reselect**, which Redux Toolkit re-exports) creates **memoized selectors**. It takes one or more "input selectors" and a "result function", and o...
**Normalized state** stores data the way a relational database would: each type of entity is kept in a lookup table keyed by ID, instead of being nested/duplicated inside...
1. **O(1) lookups by ID** instead of scanning/`find()`-ing through an array every time a component needs one item. 2. **Updates are localized**: changing one entity only ...
**Middleware** provides a way to extend Redux with custom logic that runs **between dispatching an action and the moment it reaches the reducer**. It's the standard exten...
Middleware is written as **three nested (curried) functions**: ```javascript const exampleMiddleware = (store) => (next) => (action) => { // store => { getState, dispatch...
1. `store.dispatch(action)` is called with a plain action object (`{ type, payload }`). 2. The action passes through the **middleware chain** in order (e.g., logger → thu...
The recommended approach (and what Redux Toolkit is designed around) is a **"feature folder" / "ducks"** structure rather than splitting by technical type (`actions/`, `r...
Since each `createSlice` only manages its own piece of state, a few patterns let one slice react to actions or data from another: 1. **`extraReducers`**: listen for anoth...
Redux (and Redux Toolkit's default middleware) expects **state and actions to contain only plain, serializable data**: strings, numbers, booleans, `null`, plain objects, ...
A race condition happens when multiple async requests are in flight and they **resolve out of order** — e.g., a user types quickly in a search box, an older request for "...
HireXTech uses essential storage to remember your study preferences and third-party advertising cookies via Google AdSense in compliance with GDPR. You can choose to enable essential cookies only or accept all cookies. Read our Privacy Policy.