Logo

Question preview

Cache me if you can! 3

What this preview is

About this preview

Cache me if you can! 3 is a easy quant interview question on computer architecture.

Unlock full access to getcracked

Join to unlock this question, detailed solutions, and our complete library of quant finance interview prep.

What this CPU cache behaviour interview question tests

This is an easy computer architecture question that probes intuition about cache locality and memory access patterns. It asks you to reason about the performance difference between two functions operating on the same data, where one accesses elements in a predictable order and the other does not.

The question rewards understanding of how modern CPUs optimise for spatial locality—the tendency to access nearby memory addresses in quick succession. When the cache is cold, the function that scans memory sequentially will benefit from cache-line prefetching and fewer cache misses, while random access defeats these optimisations. For sufficiently large arrays, this difference dominates runtime.

  • Cache lines and prefetching behaviour
  • Sequential vs. random memory access patterns
  • Cold-cache initialisation and warm-up effects