Start here. This is the direct spoken answer to practice first.
Why this question matters
useEffect is one of the most overused and misunderstood React APIs. Interviewers use it to test render purity, synchronization, and dependency reasoning.
An effect runs after render to synchronize the component with something outside React, such as a subscription, timer, browser API, or network request. The dependency array tells React which values the effect uses from render. When those values change, React reruns the effect. I would include the values used by the effect rather than choosing dependencies to force a desired timing.