Amazon interview question

Serialize a binary tree