Tech Mahindra Interview Question

angular component lifecycle, scenario based question