Computer Science I / Cache and the Memory Hierarchy
Practice question · True or false

A cache works because programs access memory addresses uniformly at random.

Hints
  1. What would a random access pattern do to a cache?
  2. 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.

Read the lesson: Cache and the Memory Hierarchy →

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.

More questions on Cache and the Memory Hierarchy