Fortinet interview question

substring matching, reverse binary tree