HashedIn by Deloitte interview question

React life cycle method