Amazon interview question

Write functions to serialize and deserialize a binary tree.