What this Rust code-reading question tests
This is an easy Rust question that checks whether you can trace execution through a short code snippet and predict its output. It targets fundamental language semantics—the kind of thing you need to know cold before moving to harder algorithmic or systems problems.
To answer correctly, you'll need to understand how Rust handles variable scope, shadowing, and the control flow of the code as written. The question rewards careful reading and mental execution; there are no tricks, just the straightforward rules of the language.
- Variable scope and lifetime
- Shadowing and rebinding
- Output and side effects