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

Nullify

What this preview is

Nullify is a cooked quant coding problem on design patterns in Cpp / Python.

Difficulty
Cooked
Topic
Design Patterns
Discipline
Quant development
Languages
Cpp / Python

Implementing the Null Object design pattern for graceful defaults

This medium-difficulty C++ and Python design-patterns problem tests whether you can recognize and apply the Null Object pattern—a structural approach that replaces absence with a well-defined do-nothing implementation. Rather than returning pointers or optionals and forcing callers to check for null, you provide a harmless instance that conforms to the interface but performs no action.

The question uses a logger factory as its vehicle: when configuration is missing or absent, instead of throwing or returning a null pointer, the factory should instantiate and return a logger that safely ignores all operations. This pattern is especially valuable in systems where optional configuration should degrade gracefully rather than fail hard. You'll need to ensure thread-safety through single allocation (likely via static instances or a cache) and careful conformance to the logger interface.

  • Object-oriented interface contracts and polymorphism
  • Factory patterns with optional/default cases
  • Memory management and single-responsibility allocation
  • Graceful degradation vs. failure modes

Unlock full access to getcracked

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