Amazon interview question

Tree data structures and string manipulation