Tech Mahindra interview question

angular component lifecycle, scenario based question