Honeywell interview question

Ques are from Trees and String,