Top 3 Serialisation Interview Questions
Browse 3 real-world technical and behavioral interview questions about Serialisation. Review scenarios, edge cases, and architectural best practices.
Serialise a binary tree to a string and reconstruct exactly the same tree from it. What has to be in the string?
A bare traversal is not enough, because two different trees can produce identical node sequences. Emitting an explicit marker for every absent child makes a preorder walk unambiguous, and reading it back is the same walk consuming tokens in the same order from a single cursor.
A finished unit fails test, is stripped, gets a replacement component and passes on the second attempt. What has to happen to its genealogy record?
The record is an append-only history, so the replacement adds an install event and a removal event rather than editing the bill of material, and both test results survive. The part that comes out needs a traceable destination, because a component with no exit event is the hole a recall falls through.
You pass an object with extra properties to something typed to accept fewer. When does TypeScript complain, and when does it not?
TypeScript allows extra properties under structural typing, but excess property checking rejects extra fields on fresh object literals. Assign the same object to a variable first and the extra fields usually pass, which can leak undeclared fields into API responses.