Implement LRU Cache (Python)

Veröffentlicht am: 26 September 2022
auf dem Kanal: interviewing.io
1,076
8

Implement LRU Cache in Python. Watch someone try to design and implement a data structure for Least Recently Used (LRU) cache in this mock interview.

Watch the full-length mock interview here for free: https://interviewing.io/mocks/microso...

It should support the following operations: get and put.

Get(key) - Get the value (will always we positive) of the key if the key exists in the cache, otherwise return -1.

Put(key, value) - Set or insert the value if the key is not already present. When the cache reached its capacity, it should invalidate the least recently used item before inserting a new item

The cache is initialized with a positive capacity.

To watch more data structures mock interviews and solutions: https://interviewing.io/questions/

Overview of Problem (00:00)
Implementation (02:20)
Creating the Class (13:30)
Feedback (33:25)


Auf dieser Seite können Sie das Online-Video Implement LRU Cache (Python) mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer interviewing.io 26 September 2022 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 1,076 Mal angesehen und es wurde von 8 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!