Tech Mahindra interview question

Basic opps concepts