Immutable Update Patterns for State Management
Conventions for updating nested objects and arrays without mutating the original, central to predictable state management in frameworks like Redux and React.
Immutable update patterns are a set of conventions for producing a *new* version of a nested data structure — reflecting some change — without mutating the original structure in place, and they're central to how predictable state management works in React, Redux, and similar frameworks that rely on reference-equality checks to detect when something has actually changed. Interviewers ask about this specifically because it's both conceptually important and genuinely easy to get subtly wrong with deeply nested state.
Immutable updates with structural sharing are like renovating a single room in a large house by building a new room and updating just that one doorway's connection in the floor plan, while every other untouched room in the house keeps existing exactly as it physically already was, rather than tearing down and rebuilding the entire house from scratch for one room's renovation.