Amazon interview question

it was a LRU cache leetcode problem.