Microsoft interview question

Given code snippet, implement efficient caching