The Formatter Contract
What this preview is
The Formatter Contract is a medium quant interview question on language knowledge in Cpp.
- Difficulty
- Medium
- Topic
- Language Knowledge
- Discipline
- Quant development
- Language
- Cpp
- Companies
- 0
What this C++ const-correctness interview question tests
This is a medium-difficulty question on C++ const-correctness and member-function contracts. It appears in technical interviews to assess whether a candidate understands the semantic and practical implications of const qualification on methods, and how the compiler enforces those constraints.
The question asks you to reason about what breaks or changes when a const qualifier is removed from a member function. This probes your grasp of const propagation, reference binding rules, and how const affects template instantiation, overload resolution, and caller expectations. Strong answers distinguish between compile-time failures and runtime consequences, and explain why const declarations matter for API contracts.
- const member functions and logical vs. physical constness
- const reference binding and temporary lifetimes
- Overload resolution with const and non-const variants
- Template instantiation and const propagation
Related practice
Unlock full access to getcracked
Join to unlock this question, detailed solutions, and our complete library of quant finance interview prep.