Logo

Question preview

Is it composed?

What this preview is

About this preview

Is it composed? is a cooked quant interview question on language knowledge in Cpp.

Unlock full access to getcracked

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

What this C++ object-oriented design question tests

This is a medium-difficulty conceptual question that probes your understanding of composition versus aggregation versus inheritance in C++. It's the kind of question hiring teams use to verify that you can read code and correctly identify the structural relationships between classes—a fundamental skill for writing maintainable, correctly-modeled systems.

To answer questions like this, you need to examine how objects are created, owned, and destroyed. The distinction between tight coupling (where a parent object's lifetime controls its children) and loose coupling (where objects can exist independently) is central to good OOP design. Pay close attention to member variables, constructors, and destructors to infer the intended relationship semantics.

  • Composition: tight ownership and lifetime dependency
  • Aggregation: loose association without ownership
  • Inheritance: hierarchical "is-a" relationships
  • Object lifetime and cleanup patterns