Easy
Summing one field of a four-field struct
Point is 16 bytes (four floats). A 64-byte cache line therefore holds exactly 4 Points. This loop sums only the x field across a large array of Point. What fraction of each fetched cache line's bytes does the loop actually use, and what's the consequence?
main.cpp
struct Point { float x, y, z, w; }; // 16 bytes
std::vector<Point> points(N);
float sumX = 0;
for (const auto& p : points) {
sumX += p.x; // y, z, w are loaded into cache too, but never read
}26 of 47 in Computer Architecture