What this C++ operator-overloading question tests
This is an easy C++ language-knowledge question that tests whether you can spot a common mistake in operator overloading. It's the kind of quick diagnostic question used to filter for solid C++ fundamentals before moving to harder algorithmic or systems problems.
The question presents a code snippet with a compilation error and asks you to identify why it fails to compile. Success here means recognizing the constraint or syntax rule that's been violated, rather than anything about algorithms or data structures. Candidates who know the relevant C++ rules can answer immediately; those who don't may waste interview time debugging.
- Operator-overloading signatures and return types
- const-correctness and reference semantics
- Compiler error messages and how to interpret them