Logo

Coding preview

Break the Iceberg (Order)

What this preview is

About this preview

Break the Iceberg (Order) is a hard quant coding problem on language knowledge 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.

Detecting iceberg orders in high-frequency trading interview

This hard Python coding problem tests your ability to model and detect hidden order structures in a live market feed. It combines graph construction, time-windowed pattern matching, and order-matching logic—all skills that matter in market microstructure roles at quant trading firms.

The core challenge is to recognize when a sequence of orders, submitted within a one-minute window and sharing price, quantity, and side, forms a chain of executions consistent with an iceberg strategy. You must track which orders are fully filled, match incoming orders against the book using price-time priority, and then build a directed graph where edges represent the parent-child relationships between suspected iceberg tranches. The root nodes—those with no parents—become your output.

  • Order-book state management and FIFO matching rules
  • Timestamp arithmetic and time-windowed event detection
  • Graph construction from temporal and structural constraints
  • Edge cases: multiple parents, multiple children, partial fills, and competing orders at the same price