Tech Mahindra interview question

Puzzle questions