Scaling, caching, queues, consistency, storage choices and the trade-offs behind them.
A product-catalog service reads item details from Postgres and you put Redis in front of it using the cache-aside (lazy loading) pattern. Walk through exactly what the service does on a cache hit and on a cache miss, and say what happens to the cached copy when an item's price is edited.
You cache two kinds of data in Redis: currency exchange rates used to show prices (updated by a provider every 60 seconds) and users' display names (changed perhaps once a year). How would you choose a TTL for each, and what goes wrong if a TTL is far too short or far too long?
Your Redis cache for a food-delivery app has 8 GB of memory and the working set keeps growing. What happens when memory is full, and how do LRU and LFU eviction differ in which key they throw away? Give a case where the choice matters.
A ride-matching API serves 20,000 read requests per second for driver profiles. A cache in front of the profile database has a 95% hit ratio. How many requests per second reach the database? A bad deploy changes the cache key format and the hit ratio falls to 80%: what happens to
A ticketing site runs 30 application servers. A teammate suggests caching venue seat maps in each server's own memory instead of in a shared Redis cluster. Compare the two options. What does each do well, and what problem does the in-process cache create?
A concert-ticketing site serves all of its pages, JavaScript bundles and artist images from a single origin in Virginia. Users in Sydney report that pages take several seconds to load. Explain what putting a CDN in front of the site changes, and why it helps those users in particular.