Skip to main content

Data Structure Design Quiz

Editorial

16 questions across the two Data Structure Design lessons and the section's problems: the LRU cache and what an eviction must remove, the random set's swap with the last value, the stacks by count and the stack beside a heap, buckets of counts and LFU; then histories read at a time, snapshots that keep only changes, a window of hits, a logger's clock, a browser's cursor and strings with their lengths. Pick an answer to see whether it's right and why. Nothing is saved, so you can take it again.

If one trips you up, its lesson is Designing a Data Structure or Designing with History.

Quiz

1 / 16

Multiple choice

An LRU cache of capacity 3 runs put(7, 70), put(8, 80), put(9, 90), get(7), put(10, 100). Which keys does it hold, most recent first?