CASTLE GLOBAL interview question

tree serialization