Tesla interview question

design a cache with given functions