Compare

Side-by-side on the decisions that recur: index vs scan, normalize vs denormalize, optimistic vs pessimistic, partition vs shard, and more — with when to choose each.

LRUClock (second chance)
Structuredoubly linked list + hash map; move to head on every hitcircular array + one reference bit per frame + a hand
Cost per hitlist surgery under a lock — contention on hot pagesset a bit; no lock
Evictionexact least-recently-usedapproximately LRU: clear bits as the hand sweeps
Sequential flooda big scan evicts the whole working setsame, unless paired with ring buffers / old-young sublists
Used byin-memory caches, textbooksPostgreSQL clock-sweep; Linux page cache variants
Choose this whenSmall caches, single-threaded access, when exact recency matters (and for the DSA interview).Large shared buffer pools with many concurrent readers where the per-hit cost of exact LRU is the bottleneck.