eBay CS Fundamentals: Cache Memory Write Policies Explained
Question Description
This question checks your understanding of cache write policies—primarily write-back and write-through—and how they affect performance, consistency, and system design.
You will be asked to explain the fundamental difference: with write-through every write is propagated to main memory immediately, while write-back defers the write until the cache line is evicted. Expect to discuss write allocation (write-allocate vs no-write-allocate) and how it changes behavior on a write miss.
The interview flow typically moves from definitions to trade-offs and then to systems implications. First, define each policy and show simple timing/bandwidth implications (latency, memory bandwidth). Next, compare reliability and complexity: write-through is simpler for coherence but increases memory traffic; write-back reduces bandwidth but requires coherence support and dirty-bit tracking. Finally, apply these choices to use cases—e.g., cache-heavy CPUs, database buffers, or I/O caches—and sketch how they interact with cache-coherence protocols (MESI-like) and replacement policies.
You should demonstrate: knowledge of memory hierarchy, ability to reason about latency and bandwidth, familiarity with coherence protocols and write allocation strategies, and practical trade-offs for different system goals. Be ready to diagram flows (write hit/miss sequences) and to justify a recommended policy for a given workload.
Common Follow-up Questions
- •How does write-allocate vs no-write-allocate interact with write-back and write-through on write misses?
- •Explain how a MESI (or similar) cache-coherence protocol affects correctness and complexity for write-back caches.
- •Design a simple benchmark to measure the latency and memory-bandwidth impact of switching from write-through to write-back for a given workload.
- •If you must support atomic write visibility across cores, how would you modify cache design or protocol when using write-back?
Related Questions
Explore More Questions
Practice This Question with AI
Get real-time hints, detailed requirements, and insightful analysis of the question.