Cognizant interview question

Construct and traverse the tree