Veeva Systems interview question

Leetcode was a medium problem. Tree traversal