Microsoft interview question

Coding question on binary tree