What this C++ array indexing question tests
This is a straightforward language-knowledge question on C++ array access syntax. It checks whether you understand the multiple valid ways to address array elements and can spot non-standard or incorrect notation.
C++ offers several syntactically valid approaches to reach an element at a given position—some more idiomatic than others. The question rewards familiarity with pointer arithmetic, subscript operators, and how the compiler interprets each form. This matters in interviews because it signals whether you've worked with low-level C++ code and understand the relationship between arrays, pointers, and memory layout.
- Subscript notation and its semantic equivalence
- Pointer arithmetic and dereferencing
- Valid and invalid operator precedence in element access