Tech Mahindra interview question

OOPS Concepts