What this C++ bitwise-operator question tests
This is a straightforward question about operator precedence and semantics in C++. It appears simple on the surface but requires precise knowledge of how the language distinguishes between bitwise operations and logical operations, and how each behaves in a given context.
Questions like this are common in quant interviews because they separate candidates who have read the standard carefully from those who rely on intuition. A correct answer requires you to trace through operator precedence, understand short-circuit evaluation where it applies, and predict the exact output—or recognize that none occurs.
- Bitwise vs. logical operators in C++
- Operator precedence and associativity
- Short-circuit evaluation semantics
- Type coercion in expressions