TikTok interview question

They asked me to create a cache in JavaScript based on a problem question