Tech Mahindra interview question

height of tree