Parity interview question

Second live code interview: serialize/deserialize a binary tree.