Samsung Electronics interview question

How does caching work?