Amazon interview question

Implement a cache in python