15Serialize and deserialize a binary tree▼mediumMetaGleanOpenAI2 replies○ sign inA tree question that's secretly a format-design question, which is why FDE loops love it. The preorder-with-null-markers trick is clean, but the delimiter and malformed-input follow-ups are where offers are decided.Open full answer →
36Serialize a key-value store to disk when keys and values can contain any character, including your delimiter▼mediumOpenAI1 replies◆ premiumNo JSON libraries allowed, and the test data contains commas, newlines, and your escape character itself. Length-prefix encoding solves it in fifteen lines, and knowing why it beats escaping is the actual interview.Open full answer →