AI Coding · NVIDIA · Hard
Task You are provided with four separate C++ code snippets. For each one: Find every bug you can identify, including undefined behavior, incorrect memory handling, out-of-bounds access, dangling pointers, object-lifetime problems, incorrect inheritance or polymorphism usage, and data races. Assuming the snippet is executable as written—or after the critical defects have been corrected—determine what it prints. If the result is nondeterministic, explain the reason, such as…
Checking your access…