Amazon Interview Question

How to serialize and deserialize a tree.