Logo

Question preview

Lambda defaults

What this preview is

About this preview

Lambda defaults is a easy 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++ lambda-capture interview question tests

This is an easy question on C++ language fundamentals, specifically how lambda functions handle variable capture and default argument semantics. It's the kind of thing interviewers ask to quickly filter for candidates who have hands-on experience with modern C++ rather than just book knowledge.

The question asks you to reason carefully about what happens when a lambda is defined, what variables it has access to, and what the actual behaviour is when the code runs. It rewards close attention to syntax and the distinction between different capture mechanisms.

  • Lambda capture modes (by value vs. by reference)
  • Variable scope and lifetime in lambda contexts
  • Default arguments and when they are evaluated