Tessell interview question

A question based on Trees and String