Logo

Coding preview

Strategizing for multiple inputs.

What this preview is

About this preview

Strategizing for multiple inputs. is a medium quant coding problem on design patterns in Cpp.

Unlock full access to getcracked

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

Design patterns for flexible market data ingestion in C++

This medium-difficulty C++ problem tests your ability to apply a structural design pattern to support multiple data sources without coupling your algorithm to any single input format. It's representative of real quant infrastructure work, where trading systems must seamlessly switch between live market feeds and replayed historical data for debugging and backtesting.

The core challenge is recognizing which pattern enables you to define a common interface that abstracts away the differences between PCAP file parsing and raw binary market data streams. You'll need to implement concrete source classes that handle format-specific parsing (string tokenization for PCAP, binary casting for live data), then wire them together so the consuming algorithm remains unchanged regardless of input type. Key skills include interface design, variant handling, error detection, and clean separation of concerns.

  • Strategy or adapter patterns for pluggable data sources
  • Variant types and type-safe dispatch
  • String parsing and binary serialization in C++
  • Exception safety and type mismatch handling