Morgan Stanley interview question

Binary search tree, prime numbers