Amazon Interview Question

To write a tree structure in a file and to read back again in any programming language.