HCLTech interview question

Hooks based in React component