Pergunta de entrevista da empresa RealSelf

How would you go about serializing/deserializing a tree?