Altimetrik interview question

tree implementation