Suggested approach: There are lots of ways of making caches, with the most humble being a simple dictionary, but whatever you choose you should be prepared to explain your choice and why you like it. Make sure and take into account how you remove data from the cache, either explicitly or to hit a memory quota.
If you're comfortable talking about it, NSCache
is definitely preferable over a simple dictionary because it automatically gets cleared by the system when memory is low.
Estimated difficulty: Intermediate
See the full list of iOS interview questions
Link copied to your pasteboard.