HackerEarth interview question

Life cycle methods of react