Serialize and deserialize a binary tree
by drift4527
Stripe
mid
coding
medium
pending
1
55
I jumped right into the question by explaining how serialization would involve traversing the tree and converting it into a string format. I chose a simple depth-first approach.
The interviewer seemed engaged at first, nodding along as I coded. When I got to deserialization, I faced a hiccup trying to reconstruct the tree from the string.
I second-guessed my index management and noticed the interviewer’s expression changed as I struggled. We ended up discussing alternate approaches, but I felt like I fumbled there.
Markdown supported