Tech Mahindra interview question

Constructor