Microsoft interview question

serialising binary tree