[{"id":"reduxadvanced-001","courseId":"redux-advanced","domain":"core-concepts","topic":"Symbols in middleware actions","prompt":"Your app dispatches an action whose payload holds a Promise, which only a custom middleware reads. Which rule does Redux's core enforce on the action itself?","hint":"Redux checks the shape of the action, not every value packed inside it.","explain":"An action is a message the store receives, and the core library validates only a small part of it. Whether a value can be saved or replayed matters only when that value reaches the reducers.","source":"https://redux.js.org/faq/actions","interaction":{"type":"single"},"options":[{"id":"a","text":"It must be a plain object with a string type; what sits in the payload is up to you.","why":"Redux's core checks only that an action is a plain object with a string type, and leaves the rest to the app."},{"id":"b","text":"Every value in it must be serializable, Promise included.","whyNot":"The core does not check every value; serializability is needed only by the time an action reaches the reducers."},{"id":"c","text":"Its type may be a Symbol, because middleware can read it.","whyNot":"The type must be a string. A Symbol may appear as a value meant for middleware, but not as the type."},{"id":"d","text":"It must be built by a class constructor, so middleware can tell it apart.","whyNot":"Redux does not require a constructor; it expects plain objects, and class instances are not supported."}],"answer":"a","explanation":"Redux checks that an action is a plain object with a string type. Other values may be non-serializable if they are serializable by the time they reach the store and reducers.","concept":"Redux checks that an action is a plain object with a string type. Other values may be non-serializable if they are serializable by the time they reach the store and reducers.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","takeaways":["Redux validates an action's envelope, not its payload; serializability matters for reducers and time-travel."]},{"id":"reduxadvanced-002","courseId":"redux-advanced","domain":"core-concepts","topic":"Non-serializable state","prompt":"Putting a non-serializable value, such as a function, into the store's state can stop the store from being persisted and rehydrated correctly.","hint":"Think about what survives saving the state and loading it back.","explain":"Saving a store's contents and loading them back depends on what those contents are. Debugging tools rely on the same property. Consider what a value must be to survive a save and a reload.","source":"https://redux.js.org/faq/organizing-state","interaction":{"type":"true-false"},"options":[{"id":"a","text":"True","why":"The FAQ says non-serializable items can break the ability to persist and rehydrate the store, so the statement holds."},{"id":"b","text":"False","whyNot":"The FAQ says non-serializable items can break the ability to persist and rehydrate the store, so this option is wrong."}],"answer":"a","explanation":"Non-serializable values are technically allowed in the store, but they can break persisting, rehydrating, and time-travel debugging.","concept":"Non-serializable values are technically allowed in the store, but they can break persisting, rehydrating, and time-travel debugging.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","takeaways":["Keep store state plain and serializable unless you accept losing persistence and time travel."]},{"id":"reduxadvanced-003","courseId":"redux-advanced","domain":"core-concepts","topic":"Exported store singletons","prompt":"A Next.js app creates one store in store.js, exports it, and imports it into every page. What is the main problem this creates for server rendering?","hint":"Think about how many store objects the server needs over time.","explain":"A module runs its top-level code once and caches its exports, so every importer gets the same value. Whether that matters depends on when a value is built: at import time, or inside a function run per visitor.","source":"https://redux.js.org/faq/store-setup","interaction":{"type":"single"},"options":[{"id":"a","text":"An exported store is one shared instance, while each server request needs its own store.","why":"The FAQ says server rendering needs separate store instances for every request, which an exported singleton cannot give."},{"id":"b","text":"The server cannot dispatch actions to a store that was imported from a module.","whyNot":"Importing does not stop dispatching; the FAQ's concern is that an exported store becomes a singleton."},{"id":"c","text":"Importing the same store into several pages creates a second store that conflicts with the first.","whyNot":"An exported store is a singleton, so every import refers to the same instance rather than a new one."},{"id":"d","text":"Redux DevTools stop recording actions whenever a store is exported.","whyNot":"The FAQ ties DevTools to having a single store; the export problem it names is isolation and server rendering."}],"answer":"a","explanation":"An exported store becomes a singleton shared by all importers, which blocks the separate store per request that server rendering needs.","concept":"An exported store becomes a singleton shared by all importers, which blocks the separate store per request that server rendering needs.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","takeaways":["For server rendering, create the store inside a function per request, and pass it with Provider."]},{"id":"reduxadvanced-004","courseId":"redux-advanced","domain":"core-concepts","topic":"Shallow equality choice","prompt":"combineReducers walks several state slices in one call. Put these steps of that call in the order the library performs them.","hint":"A decision about the whole object can only follow the work on its parts.","explain":"Large objects are updated part by part, and a cheap test on each part decides whether the whole changed. A step that needs another step's output must wait for it.","source":"https://redux.js.org/faq/immutable-data","interaction":{"type":"sort","items":[{"text":"Takes the reference to the current slice stored under its key.","why":"It starts from the slice as it sits in the current state, before any reducer runs."},{"text":"Calls the reducer for that key and passes it the slice.","why":"The reducer needs the slice to produce its new value, so it runs after the slice is read."},{"text":"Creates a reference to the slice the reducer returned.","why":"Only after the reducer returns is there a returned slice to reference."},{"text":"After all keys are processed, checks the hasChanged flag to pick the root object.","why":"The flag can be read only once every key has been handled, so this check comes last."}]},"options":[],"answer":"o:abcd","explanation":"combineReducers takes each slice, calls its reducer, and takes the slice the reducer returned. After all the keys, it returns a new root object only if the hasChanged flag was set.","concept":"combineReducers takes each slice, calls its reducer, and takes the slice the reducer returned. After all the keys, it returns a new root object only if the hasChanged flag was set.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","takeaways":["combineReducers returns the old root object when every slice keeps its reference."]},{"id":"reduxadvanced-005","courseId":"redux-advanced","domain":"core-concepts","topic":"Per-action subscriber notifications","prompt":"Your React 18 app dispatches three actions in a row inside one click handler. Which TWO statements about subscribers and rendering are true?","hint":"Separate the cost of notifying subscribers from the cost of drawing the screen.","explain":"Each dispatch is a separate store update. Listeners and screen redraws can happen at different rates, and the UI framework's scheduling decides when updates that arrive close together get painted.","source":"https://redux.js.org/faq/performance","interaction":{"type":"multiple","tellCount":true},"options":[{"id":"a","text":"Redux notifies subscribers once for each action that is dispatched and handled by reducers.","why":"The FAQ says subscribers are notified after each successfully dispatched action, so three dispatches mean three notifications."},{"id":"b","text":"React 18 can draw the screen once for these updates, since they fall in the same event loop tick.","why":"React 18 and later automatically batch state updates in the same tick into a single render pass."},{"id":"c","text":"Redux merges the three dispatches into one subscriber call when they happen together.","whyNot":"Core Redux notifies after each action; merging needs an addon such as redux-batch, not the core store."},{"id":"d","text":"Selectors run only once for the whole group, because React-Redux batches them.","whyNot":"The FAQ says dispatching several actions still runs selectors once per action, while React renders once."},{"id":"e","text":"React-Redux's batch() must wrap the dispatches, or React will render three times.","whyNot":"React 18 batches these updates on its own, and batch() is a no-op in React-Redux v9."},{"id":"f","text":"Dispatches made in a timeout or promise callback are never batched by React 18.","whyNot":"The FAQ says React 18 batches updates from thunks, timeouts, and promise callbacks as well."}],"answer":"ab","explanation":"Redux notifies subscribers after every action, and selectors run per action. React 18 batches updates in one tick into a single render; batch() is a no-op in React-Redux v9.","concept":"Redux notifies subscribers after every action, and selectors run per action. React 18 batches updates in one tick into a single render; batch() is a no-op in React-Redux v9.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","takeaways":["Batching cuts renders, not store notifications or selector runs."]}]