We use optional cookies for analytics and affiliate attribution. Essential cookies and marketing measurement are always on. Read our privacy policy

We just launched our Black Friday sale. You can use code BF2026 to get 25% off all subscriptions, valid until Nov 30th. There is a limit of 100 redemptions.

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.