Amazon interview question

Basic tree, Hash set problems