Tech Mahindra interview question

Technical Questions mostly in Java