C&A Associates interview question

Basic about react concepts like useeffect