Amazon interview question

Write code that will validate a binary search tree.