Amazon interview question

reconstruct a binary tree