Q111. How would you create a reusable Context?
A **reusable Context** bundles the `createContext` call, its `Provider` (with local state/logic), and a custom hook to consume it into a single module. This hides the raw...
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 (154 available).
A **reusable Context** bundles the `createContext` call, its `Provider` (with local state/logic), and a custom hook to consume it into a single module. This hides the raw...
**Client state** is data that lives entirely in the browser and is owned by the UI — it doesn't need to be synchronized with a backend. **Server state** is data that actu...
**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 is written as **three nested (curried) functions**: ```javascript const exampleMiddleware = (store) => (next) => (action) => { // store => { getState, dispatch...
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, ...
**`redux-persist`** is the standard library for persisting and rehydrating a Redux store across page reloads/app restarts. It wraps your root reducer so selected slices a...
A practical, step-by-step approach: 1. **Confirm it's actually Redux**: use the React DevTools **Profiler** to see which components re-render and how often, before assumi...
A common mistake is storing **computed/derived values** in Redux state itself, which then has to be kept in sync manually every time the source data changes. The rule of ...
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.