Perchwell interview question

medium Leetcode type, create a cache mechanism for backend.