Tech Mahindra interview question

Focus on Oops concept more.