AlgoViz

Design an LRU cache

medium 85 min

Design an in-memory Least Recently Used cache with O(1) lookups, updates and evictions.

Watch lesson4:49

Check yourself

One question at a time. Each answer explains why.

Question 1 of 14

Score 0
conceptual

What is the time complexity of get in this design?

Pick an answer to see why.

Flashcards

Say your answer, then reveal it.

Card 1 of 15

Recall

Why a map and a list?

Say your answer, then reveal it.

These cards come back in Today, just before you would forget them.