Infosys interview question

React lifecycle , hooks , javascript prototypical inheritance