Tech Mahindra interview question

WAF function