NVIDIA interview question

Give a tree, check if one nodes come before another node