Questions
Read the code, predict what happens, then see why. Hand-written questions on C++, Rust, and the systems underneath them.
- A branch that's almost always takenMedium
- Arithmetic around an opaque function callMedium
- Dividing a signed int by twoEasy
- The same recursive sum without the accumulatorHard
- A loop that accumulates squaresMedium
- Two translation units built against different copies of a headerHard
- An overflow guard written in pointer arithmeticHard
- Twelve live values on an eight-register targetHard
- A thousand-iteration body marked inlineEasy
- A helper called from an exported function in a shared libraryHard
- Two handlers with the same body and a pointer comparisonMedium
- Three float pointers and a loopHard
- Type punning through reinterpret_castHard
- An out-of-bounds array write and the code after itHard
- -O2 versus -O3 on a hot pathMedium
- A virtual call before and after placement newHard
- A loop bound computed by an external functionEasy
- Multiplying two uint16_t valuesHard
- Calling a C library from C++Medium
- Type punning through memcpyMedium
1–20 of 44
Page 1 of 3