Implement a LRU cache.
Anonym
I talked about what an LRU cache is with my interviewer. Then I talked about different data structures we could use for our implementation. I settled on a queue. On the whiteboard I began by defining all of the classes I would need. Then I added functions for cache operations to the respective classes. This is the type of question that checks how well you can architect and organize code. We went over many edge cases and then covered a series of input examples to demonstrate the functionality of the LRU cache.