Tesla Interview Question

design a cache with given functions