Go Binary Protocols Checkpoint

Decode fresh byte streams, classify failures, and reason about buffer ownership. Select one answer per multiple-choice question; enter only the requested integer for numeric answers.


Get every question correct to pass this checkpoint. You can review feedback, revise your answers, and submit again.

1. An unsigned-varint length prefix is 96 01 in hexadecimal. What is the payload length in decimal? Enter one integer.
2. The buffer is [03, 'c', 'a', 't', 02, 'o', 'k'] and maxLen=8. How many bytes does one successful DecodeFrame call consume? Enter one integer.
3. The entire current input consists of ten 0x80 bytes. maxLen=1024. What does this frame contract require now?

Select one answer.

4. With maxLen=6, the buffer contains only [08] in hexadecimal. Which result is correct?

Select one answer.

5. A complete prefix declares MaxInt bytes, maxLen=MaxInt, and the input has no body. Which availability check avoids overflow after the safe uint64-to-int conversion?

Select one answer.

6. A caller keeps the zero-copy payload and overwrites the same receive array for its next read. What can preserve the saved payload independently?

Select one answer.

7. The buffer starts with [80,00] in hexadecimal and maxLen=0. What does this exercise accept?

Select one answer.

8. Two correct parsers each report zero allocations on complete two-byte payloads. What conclusion is justified?

Select one answer.

Join Discord