What this C++ code-output question tests
This is an easy C++ question that checks whether you understand language semantics at a foundational level. Nvidia and other firms use questions like this in screening rounds to verify that candidates can read and predict code behaviour accurately, without relying on a compiler.
The question asks you to trace through a code snippet and determine what it prints. Success requires careful attention to operator precedence, type behaviour, and any subtle language features at play. Even simple-looking code can hide a detail worth knowing.
- Operator precedence and associativity
- Type coercion and implicit conversions
- Standard library output formatting