All featured quizzes

State Management - Basics

Selectors, Context Providers, state stores, dispatch actions, and React state mutation.

Sample Questions

A preview of what's in this quiz. Answer them interactively for instant scoring and full explanations.

What is 'prop drilling' in frontend frameworks like React?

1. What is 'prop drilling' in frontend frameworks like React?

  • A.Compiling properties during build time
  • B.Injecting database queries directly into HTML tags
  • C.Passing props through multiple intermediate component layers to reach a deeply nested child
  • D.Toggling inline styling using CSS variables
What is the definition of global state?

2. What is the definition of global state?

  • A.State that is private to one component only
  • B.State that is stored permanently in the user's hard drive
  • C.State that is accessible across multiple components throughout the application
  • D.State that represents CSS styling rules
What is state in the context of a web application?

3. What is state in the context of a web application?

  • A.The physical geographic location of the database servers
  • B.The CSS class rules applied to layout components
  • C.The data that represents the current condition of the application and determines the UI rendering
  • D.The network latency time of API requests
What is the definition of local state?

4. What is the definition of local state?

  • A.State that is stored in the database on local servers
  • B.State that is accessible across all components globally
  • C.State that is private to a single component and not shared with others
  • D.State that is managed only in the browser's cookies
What does 'immutability' mean in state management?

5. What does 'immutability' mean in state management?

  • A.State variables can change their data types dynamically.
  • B.State is stored in a read-only browser cookie.
  • C.State is never modified directly; instead, a new state copy is returned.
  • D.State is identical for all users across the network.
Which property is strictly required in a Redux Action object?

6. Which property is strictly required in a Redux Action object?

  • A.payload
  • B.id
  • C.type
  • D.state
What is unidirectional data flow in state management architectures?

7. What is unidirectional data flow in state management architectures?

  • A.A layout design where all elements align on one axis
  • B.A routing configuration that redirects users to previous pages
  • C.A design where data moves in a single direction (Action -> State -> View)
  • D.A database connection method that accepts only write requests
Why must Redux reducers be pure functions?

8. Why must Redux reducers be pure functions?

  • A.To allow developers to write direct DOM mutations
  • B.To connect directly to SQL database endpoints
  • C.To ensure state updates are predictable and deterministic
  • D.Because javascript only compiles pure functions
What is state management 'Middleware'?

9. What is state management 'Middleware'?

  • A.A database bridge between client and server
  • B.A compiler that translates TypeScript into JavaScript
  • C.Code that runs between dispatching an action and the moment it reaches the reducer
  • D.A routing package used inside single-page apps
What is a pure function in programming?

10. What is a pure function in programming?

  • A.A function that only contains comments
  • B.A function that communicates with database APIs
  • C.A function that always returns the same output for the same input and has no side effects
  • D.A function that does not return any value
In state management, what is a 'Selector'?

11. In state management, what is a 'Selector'?

  • A.An HTML tag used to select list dropdown items
  • B.A CSS rule that applies border properties
  • C.A function used to extract and query specific parts of the state from the store
  • D.A method that routes user URLs to new pages
In Redux, what is a 'Reducer'?

12. In Redux, what is a 'Reducer'?

  • A.A component that renders database query items
  • B.A method that minifies image sizes in webpack
  • C.A pure function that calculates the next state based on the current state and an action
  • D.An API handler that routes incoming URL requests
In Redux, what is the 'Store'?

13. In Redux, what is the 'Store'?

  • A.The folder where assets are stored
  • B.A database table on the backend server
  • C.The central repository that holds the application's global state
  • D.A compiler that minifies JavaScript code
What problem does a global state management library primarily solve?

14. What problem does a global state management library primarily solve?

  • A.It speeds up network download speeds of images.
  • B.It automatically compiles TypeScript files into CSS.
  • C.It eliminates prop drilling and simplifies sharing data between distant components.
  • D.It secures endpoints from SQL injection attacks.
In Redux, what is an 'Action'?

15. In Redux, what is an 'Action'?

  • A.A function that modifies the HTML DOM directly
  • B.A CSS class that changes background color
  • C.A plain JavaScript object that describes what happened or what state change is requested
  • D.An asynchronous API network fetch call
How do you trigger a state update in Redux?

16. How do you trigger a state update in Redux?

  • A.By modifying store.state directly
  • B.By calling store.updateState()
  • C.By calling store.dispatch(action)
  • D.By reloading the browser window
In Redux Toolkit, what is a 'Slice'?

17. In Redux Toolkit, what is a 'Slice'?

  • A.An array method that extracts items from state
  • B.A middleware that logs performance markers
  • C.A configuration object defining reducer logic and actions for a single feature area
  • D.A routing method that loads pages asynchronously
What is the React Context API?

18. What is the React Context API?

  • A.An external database library for React single-page apps
  • B.A styling utility that compiles inline JSX styles
  • C.React's built-in feature to share values down the component tree without prop drilling
  • D.A development terminal console debugger tool
What is Redux Thunk?

19. What is Redux Thunk?

  • A.A database connector for SQL databases
  • B.A template engine for rendering HTML views
  • C.Middleware that allows action creators to return functions, useful for asynchronous API calls
  • D.A development logger for CSS style modules
What is Redux Toolkit (RTK)?

20. What is Redux Toolkit (RTK)?

  • A.A browser extension used to debug React components
  • B.A command-line script used to host web apps
  • C.The official, recommended toolset for writing Redux logic to reduce boilerplate
  • D.A styling library that integrates TailwindCSS styles

Looking for a different topic? Browse all subjects