Fanatics interview question

Check if given tree is valid BST