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

Implement new using something else.

What this preview is

Implement new using something else. is a medium quant coding problem on language knowledge in Cpp.

Difficulty
Medium
Topic
Language Knowledge
Discipline
Quant development
Language
Cpp

Implementing manual memory management in C++

This medium-difficulty coding problem tests your understanding of how new and delete actually work under the hood. It requires you to separate the two phases of object lifecycle—raw allocation and construction—and handle both cleanly, with proper exception safety.

The core challenge is managing the invariant that if construction fails, allocated memory must be freed before the exception propagates, and for arrays, all partially-constructed objects must be torn down in reverse order. This demands careful placement of try-catch blocks and understanding when destructors run.

  • Placement new syntax and semantics
  • Exception-safe resource acquisition and cleanup
  • Destructor ordering and array lifetime management
  • The relationship between malloc, operator new, and construction

Unlock full access to getcracked

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