Pocket Gems interview question

Friend circles traverse binary tree preorder