Xirgo Technologies interview question

Write a function to extract a several fields from a byte-steam