Amazon interview question

Tree level order traversal and Top k frequency.