Tech Mahindra interview question

logical reasoning.