Microsoft Interview Question

Traverse a weird tree