KayHut interview question

implement a cache algorithm (or pseudo)