What this cache coherence interview question tests
This question probes your understanding of cache coherence, a foundational concept in systems programming and computer architecture. It sits at the intersection of memory management, multicore processors, and the gap between what programmers assume about shared memory and what hardware actually provides.
When multiple CPU cores run in parallel, each typically maintains its own private cache for speed. The coherence problem arises when one core writes data that another core later reads—without explicit synchronization, the second core may see a stale cached value rather than the latest write. Interviewers ask this to gauge whether you understand why naive concurrent code breaks, and what guarantees the OS and hardware must enforce to make shared-memory programming possible at all.
- Cache hierarchy and private vs. shared levels
- Write propagation and visibility across cores
- Memory ordering and synchronization primitives
- Performance trade-offs in coherence protocols