Prepping for the 2027 recruiting cycle? Use code 2027RC for 10% off, valid until July 31st! Oh, and check out our members-only recruitment services.

Logo

Coding preview

Pcap, Pcapng, Pcapgg

What this preview is

About this preview

Pcap, Pcapng, Pcapgg is a hard quant coding problem on networking in Cpp / Python, asked at Quant.

Unlock full access to getcracked

Join to unlock this problem, detailed solutions, and our complete library of quant finance interview prep.

Parsing a proprietary packet-capture format in C++ or Python

This hard coding problem tests your ability to parse binary file formats with strict structure requirements—a core skill in quantitative trading infrastructure. Market data and order feeds are often captured in pcap files for forensic analysis; this problem asks you to implement a parser for a proprietary variant called .pcapgg.

You must correctly deserialize a fixed global header, validate endianness and magic numbers, then iterate through variable-length packet records while respecting byte boundaries and detecting corruption. The challenge lies in handling both endianness variants, managing pointer arithmetic over raw bytes, and distinguishing between file-level corruption (which invalidates everything) and packet-level corruption (which marks individual records but permits parsing to continue).

  • Binary format parsing and byte-order handling (little-endian vs. big-endian)
  • Fixed and variable-length record structures
  • Error detection and graceful degradation (nullopt on fatal errors, corrupted flag on recoverable ones)
  • Pointer safety and lifetime management in C++