Algorithm · Mongodb · Hard
Problem: Binary Decoder / Simplified BSON Parser Given a hexadecimal string containing binary-encoded information, write a parser that converts the data to JSON. This encoding follows a simplified BSON-like format. Every integer uses little-endian byte order. Document Format Each document has the following layout: In this representation: total_length is a 4-byte signed integer equal to the complete document size in bytes, counting both the length field itself and the closing…