← PayPal Interview Insights

PayPal·Software Engineer·Onsite - System Design / Architecture·Senior

Senior
Apr 2026

Summary

PayPal system design round, one meaty question about caching policies that ended up going deeper than I expected. Not a bad experience but I definitely left some points on the table.

Questions Asked (1)

Q1

Compare write-back and write-through caching policies. How does each handle writes, cache coherence, durability, latency, and bandwidth? Where would you use each, and what are the trade-offs around dirty bits, write amplification, and power loss risk?

System DesignTechnical Trade-offs
Author's notes

I started with the basics fine: write-through flushes to storage on every write so you never lose data but you pay the latency cost every time, write-back only writes to the backing store when the cache line is evicted so it's faster but you're sitting on dirty data that disappears if power goes out.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Define both policies clearly, then systematically compare them across the dimensions of write handling, coherence, durability, latency, and bandwidth. Use concrete examples of where each is used and discuss trade-offs like dirty bits, write amplification, and power loss risk, tying them to real-world systems.

Pro tip: Mention that many real systems use a hybrid approach, such as write-back with periodic write-through or write-back with battery-backed cache, to balance performance and durability. This shows you understand practical engineering compromises.

1. Define the policies

Explain that write-through writes to both cache and main memory immediately, while write-back writes only to cache and defers main memory update until eviction.

2. Compare across dimensions

Discuss how each handles writes, cache coherence (e.g., write-through simplifies coherence but can cause more bus traffic), durability (write-through is safer on power loss), latency (write-back has lower write latency), and bandwidth (write-back reduces memory bandwidth usage).

3. Discuss trade-offs

Cover dirty bits (write-back requires dirty bits to track modified cache lines), write amplification (write-back can cause multiple writes to the same location before eviction, but write-through may cause more total writes), and power loss risk (write-back risks data loss if cache is volatile).

4. Provide use cases

Give examples: write-back is common in CPU caches and databases for performance; write-through is used in systems requiring high durability, like some storage controllers or when cache is small.

5. Conclude with hybrid approaches

Mention that many systems combine both, such as write-back with write-through for critical data, or using non-volatile cache to mitigate power loss.

Key Points to Mention

  • Write-through ensures data is always in main memory, simplifying coherence and recovery but increasing write latency and bandwidth usage.
  • Write-back reduces memory traffic and latency by deferring writes, but requires dirty bits and risks data loss on power failure.
  • Cache coherence: write-through can cause more coherence traffic in multiprocessor systems, while write-back may require more complex coherence protocols.
  • Write amplification: write-back can reduce total writes by coalescing multiple writes to the same cache line, but write-through may cause more writes to memory.
  • Use cases: write-back for high-performance CPU caches and databases; write-through for systems needing durability, like some RAID controllers or when cache is write-through to persistent memory.
  • Hybrid approaches: battery-backed write-back caches, or write-back with periodic flushing, balance performance and durability.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.