Effects in Angular
Explain effect() as the mechanism for running side effects in response to signal changes.
effect() runs a function whenever any Signal it reads changes, and it exists specifically for side effects — things that shouldn't be modeled as a derived value (which is what computed() is for), like logging, synchronizing state to localStorage, manually manipulating a non-Angular-managed DOM element, or triggering an analytics call whenever a piece of state changes. Interviewers ask about this to check whether you understand the important distinction Angular draws between computed() (pure derivation, returns a value) and effect() (side effects, returns nothing).
computed() is like a thermometer's digital readout — a pure, derived reflection of the current temperature. effect() is like a smart thermostat's furnace kicking on in response to that same temperature reading — a genuine side effect triggered by the value, not a value itself.