Practice question · True or false
A cache works because programs access memory addresses uniformly at random.
Hints
- What would a random access pattern do to a cache?
- Locality is the premise.
Show the answer
False
Why
False. A cache depends on the opposite, locality: recently used data is reused (temporal) and neighbours follow (spatial). Genuinely random access defeats it entirely, which is why pointer-chasing through a large linked list can be far slower than scanning an array of the same size.
Practise Cache and the Memory Hierarchy
The app has 7 more questions on this lesson, and keeps your place in the course. Computer Science I is free to start.