Caching Flashcards

1
Q

“What is caching?”

A

“Caching is a technique that stores frequently accessed data temporarily in a fast storage layer to improve performance and reduce latency.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

“How does caching improve application performance?”

A

“Caching reduces latency by serving data from a fast storage layer instead of fetching it from a slower database or computation.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

“What are the main benefits of caching?”

A

“Improved performance, reduced server load, cost-efficiency, and better scalability.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

“What are some challenges of caching?”

A

“Ensuring cache consistency, handling stale data, and implementing proper cache invalidation strategies.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

“What is client-side caching?”

A

“Client-side caching stores data locally on the user’s device to minimize server interactions and speed up response times.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

“What are examples of client-side caching mechanisms?”

A

“Browser cache, local storage, and cookies.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

“What is a drawback of client-side caching?”

A

“Limited storage capacity and the risk of serving stale data if not properly refreshed.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

“What is CDN caching?”

A

“CDN caching stores static content on geographically distributed edge servers to serve users from the nearest location.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

“How does a CDN improve performance?”

A

“It reduces latency by serving content from a nearby server instead of the origin server.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

“What is a challenge in using a CDN?”

A

“Managing cache invalidation to ensure users always receive updated content.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

“What is web caching?”

A

“Web caching stores HTTP responses to reduce server load and improve page load times.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

“What are the two main types of web caching?”

A

“Proxy caching and reverse proxy caching.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

“How does reverse proxy caching work?”

A

“It caches content on the server-side to reduce the load on application servers.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

“What is database caching?”

A

“Database caching stores query results or frequently accessed data in a cache layer to reduce database load and improve query response times.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

“Which tools are commonly used for database caching?”

A

“Redis and Memcached.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

“What is a key challenge of database caching?”

A

“Ensuring cache consistency with the database and handling cache invalidation.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

“What is application caching?”

A

“Application caching stores data at the application level to optimize processes and improve responsiveness.”

18
Q

“What are the types of application caching?”

A

“Session caching, object caching, and page caching.”

19
Q

“How does session caching work?”

A

“It stores user session data in memory for quick retrieval.”

20
Q

“What is cache aside (lazy loading) caching?”

A

“Data is loaded into the cache only when requested; if not found, it is retrieved from the database and stored in the cache.”

21
Q

“What is a benefit of cache aside?”

A

“It prevents unnecessary caching of rarely accessed data.”

22
Q

“What is a downside of cache aside?”

A

“Cache misses can cause delays as the database must be queried first.”

23
Q

“What is write-through caching?”

A

“Every time data is written to the database, it is also written to the cache immediately.”

24
Q

“What is a benefit of write-through caching?”

A

“Ensures cache consistency with the database.”

25
Q

“What is a downside of write-through caching?”

A

“Slower writes due to double updates.”

26
Q

“What is write-behind caching?”

A

“Data is written to the cache first and asynchronously updated in the database later.”

27
Q

“What is a benefit of write-behind caching?”

A

“Improves write performance as database updates happen in the background.”

28
Q

“What is a risk of write-behind caching?”

A

“Data loss if the cache fails before writing to the database.”

29
Q

“What is refresh-ahead caching?”

A

“The cache updates data before it expires to prevent stale reads.”

30
Q

“What is a benefit of refresh-ahead caching?”

A

“Ensures users always receive fresh data.”

31
Q

“What is a challenge of refresh-ahead caching?”

A

“May waste resources updating unused cached data.”

32
Q

“What is cache invalidation?”

A

“Cache invalidation is the process of removing or updating outdated data from the cache to ensure consistency with the data source.”

33
Q

“What are common cache invalidation techniques?”

A

“Time-to-Live (TTL), manual invalidation, and event-driven updates.”

34
Q

“How do you handle cache consistency?”

A

“By using write-through caching, proper TTL settings, and cache invalidation strategies.”

35
Q

“What is a cache hit?”

A

“A cache hit occurs when a requested data item is found in the cache, reducing the need for database access.”

36
Q

“What is a cache miss?”

A

“A cache miss occurs when requested data is not found in the cache, requiring retrieval from the database or other sources.”

37
Q

“What is a cache eviction policy?”

A

“A set of rules determining how old or unused cache entries are removed when space is needed.”

38
Q

“What are common cache eviction policies?”

A

“Least Recently Used (LRU), Least Frequently Used (LFU), and First-In, First-Out (FIFO).”

39
Q

“What is the difference between a distributed cache and a local cache?”

A

“A distributed cache is shared across multiple nodes, while a local cache exists only within a single application instance.”

40
Q

“Why is Redis a popular caching solution?”

A

“Redis is in-memory, supports multiple data structures, and provides high-speed performance.”

41
Q

“What is Memcached used for?”

A

“Memcached is used for caching key-value data to improve response times and reduce database load.”

42
Q

“How does caching help with scalability?”

A

“By reducing the load on backend systems, caching allows applications to handle more users and traffic efficiently.”