Microsoft interview question

"Given a binary tree, write a function to check if it's a valid binary search tree."