Pergunta de entrevista da empresa PolicyBazaar

They asked me to explain the difference between useEffect and useLayoutEffect in React, and when to use each one. They also asked how closures work in JavaScript and gave a small coding challenge involving state updates in a functional component.