Tech Mahindra interview question

joins