06 / 10

What is the store?

  1. 1

    The current Redux application state lives in an object called the store. Redux stores its application state in a plain JavaScript object called the store.

  2. 2

    The store is a single source of truth that holds the entire application state.

  3. 3

    It has a method called getState that returns the current state value

javascript
Difficulty: 5/10
Topics: Redux store, state management, middleware

Scenario Questions

0-2 years experience
  1. 1

    How would you set up a Redux store for a simple counter component that only needs increment and decrement actions?

  2. 2

    What happens if you dispatch an action before the store has been created, and how would you prevent that?

2-5 years experience
  1. 1

    You added a new feature that updates a user's profile in the store, but the UI never shows the new data. Walk me through how you would debug the issue.

  2. 2

    Explain why you would choose Redux Thunk over putting async API calls directly inside reducers when handling data fetching.

5-8 years experience
  1. 1

    Your application’s Redux store has grown to dozens of slices and is causing noticeable UI lag. How would you restructure the store to improve performance and maintainability?

  2. 2

    Design a strategy to share a piece of state (e.g., authentication token) across multiple micro‑frontends that each have their own isolated Redux store.

8+ years experience
  1. 1

    Your organization wants to migrate from a single monolithic Redux store to a modular, feature‑based store architecture across several teams. What steps would you take to plan and execute that migration safely?

  2. 2

    Given long‑term maintenance concerns and a mixed skill set on the team, how would you decide whether to keep Redux or adopt a newer state‑management library like Recoil or Zustand?

Follow-up Questions

  • Can you sketch the minimal code for creating that store?
  • What are the trade‑offs of putting async logic in reducers versus middleware?
  • How would you verify that your store changes are correctly reflected in the UI?