Cache, Query, or Calculate
Memoization, tabulation, even dynamic programming could be considered a kind of local memory caching. A nice front end JS pattern is the interceptor in Angular for caching . I use caching generously on the server side in most APIs I write. Most ORMs have it built in and even offer second level caching . Out on the web CDNs and mirror sites are caches. In fact caching has even more uses than it has names. Caches are useful in many places. Real world application bottlenecks are almost always around I/O. You can optimize your algorithm till the cows come home but if you haven't first looked at your I/O, you're improvements will likely be a drop in the ocean. Often a quick and easy way to alleviate I/O bottlenecks is to slap on an appropriate cache. A particular problem where we see caching is in the classic Fibonacci problem. The Fibonacci sequence is a pattern frequently occurring in nature, but in Computer Sc...