Nokia interview question

Explain when to use useEffect in a React component.