What this C++ language-rules question tests
This easy question probes your working knowledge of C++ syntax and compiler rules. It presents a short code snippet and asks you to identify which lines are valid — a direct test of whether you understand the language's grammar and type system well enough to predict compiler behavior without running the code.
Questions like this are common in screening rounds because they separate candidates who have internalized C++ semantics from those who are guessing. You'll need to reason about things like declaration scope, type compatibility, reference rules, and what the standard actually permits. The challenge is not computational; it's about precision and confidence in the language itself.
- Declaration and initialization syntax
- Type conversion and implicit rules
- Reference and pointer semantics
- Scope and lifetime rules