All questions

Advanced · JavaScript · Data structures

Implement an LRU cache

Commonly asked: Senior SDET and product-company rounds · ~20 min

Write a class LRUCache(capacity) with get(key) (returns value or -1) and put(key, value).

Checking your membership…