Capital One interview question

Validate that a tree is a BST