smallcase interview question

implement a cache layer