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

Order Book Spread

What this preview is

About this preview

Order Book Spread is a cooked quant coding problem on finance in 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.

What this order-book coding problem tests

This is a straightforward Python coding problem that appears in finance and quant interviews. It tests whether you can quickly extract and compute basic market microstructure metrics from live order-book data—a foundational task in algo trading and market-making roles.

The problem is simple in principle but rewards clean, readable code and correct handling of floating-point rounding. Interviewers care about whether you identify the relevant data (best bid and best ask), compute the derived quantities accurately, and apply rounding consistently. The size field is a realistic red herring; filtering signal from noise is a practical skill.

  • Extracting extrema from unordered lists
  • Floating-point arithmetic and rounding conventions
  • Translating financial definitions into code