Akamai interview question

Find a given tree is BST or not