Tech Mahindra interview question

In the Technical interview puzzles were asked.