Tech Mahindra interview question

The questions were easy. Into technical stuff