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

Compile Time PushBack

What this preview is

Compile Time PushBack is a hard quant coding problem on language knowledge in Cpp, asked at Quant.

Difficulty
Hard
Topic
Language Knowledge
Discipline
Quant development
Language
Cpp

Template metaprogramming at compile time: variadic type manipulation

This is a hard C++ coding problem that tests your fluency with template metaprogramming—specifically, how to manipulate variadic template parameters and create new types at compile time. Quant firms use questions like this to identify candidates who can write code that does real computational work before the program runs, a skill valuable in high-performance trading systems where every runtime cycle counts.

The core challenge is to design a template that accepts a value and an existing Numbers class (itself a variadic template), then produces a new type with that value appended. You'll need to understand how to unpack and repack variadic parameter packs, use template specialization to match patterns, and leverage the ::type member pattern (or C++20 using type = syntax) to expose the result. Edge cases like empty Numbers classes are fair game.

  • Variadic templates and parameter pack expansion
  • Template specialization and partial specialization
  • Type aliases and the ::type idiom
  • Compile-time type checking with static_assert and std::is_same_v

Unlock full access to getcracked

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