X interview question

Build a caching system that has invalidation.