Airbnb software engineer interviews cover algorithms, data structures, system design, and coding problems drawn from real interview rounds.
No verified questions yet for Airbnb.
capacity. The cache should support get(key) and put(key, value) operations.class LRUCache:def __init__(self, capacity: int): - Initializes the LRUCache with the maximum capacity.def get(self, key: int) -> int: - Returns the value of the key if the key exists in the cache, otherwise return -1.def put(self, key: int, value: int): - Update the value of the key if it exists, otherwise add the key-value pair to the cache. When the cache reaches its capacity, it should invalidate the least recently used item before inserting a new item.1 <= capacity <= 30000 <= key <= 10^40 <= value <= 10^4Sign up for free to access walkthroughs, AI-generated questions, and more.
Get Started Free