Skip to content

Discussing design patterns from your C++ work

Question

Which object-oriented design patterns have you applied in C++ code?

Short answer

Pick two or three you have actually used and explain why. Common ones in pricing code are factory (create payoffs or models from configuration), strategy or bridge (swap random generators or payoffs), template method, decorator, singleton (with its drawbacks) and the virtual-constructor clone idiom. For each, describe the problem it solved and the trade-off; a pattern list without context scores poorly.

Adapted from Joshi, Denson & Downes, Quant Job Interview Questions and Answers, Q7.2, p.226; question and answer rewritten by SelfMadeQuant.com.

See the hint and the full worked solution in the question bank (free account).

Open the worked solution

Lessons behind this question