Intuit interview question

Tree traversal Class design