Loading

Quipoin Menu

Learn • Practice • Grow

spring / Caching in Spring
mcq
Direction: Choose the correct option

Q1.

What is caching in Spring?
A. A way to store frequently accessed data to improve performance
B. A database feature
C. A temporary storage
D. None
Direction: Choose the correct option

Q2.

Which annotation enables caching in Spring?
A. @EnableCaching
B. @Cacheable
C. @CacheEvict
D. @Caching
Direction: Choose the correct option

Q3.

What does @Cacheable do?
A. Indicates that the result of a method should be cached
B. Evicts cache
C. Puts data into cache
D. None
Direction: Choose the correct option

Q4.

What is the cache name in @Cacheable?
A. The name of the cache region where results are stored
B. A key
C. A value
D. None
Direction: Choose the correct option

Q5.

What does @CacheEvict do?
A. Removes entries from the cache
B. Adds entries
C. Updates entries
D. None
Direction: Choose the correct option

Q6.

What is the purpose of @CachePut?
A. Always updates the cache with method result, without interfering with method execution
B. Evicts cache
C. Disables cache
D. None
Direction: Choose the correct option

Q7.

What is the key attribute used for?
A. To specify a SpEL expression to compute the cache key
B. To define cache name
C. To define condition
D. None
Direction: Choose the correct option

Q8.

What does the condition attribute do?
A. Caches conditionally based on SpEL expression
B. Sets a condition for eviction
C. Both A and B
D. None
Direction: Choose the correct option

Q9.

What is a CacheManager in Spring?
A. Manages caches, providing access to cache instances
B. Creates caches
C. Configures caches
D. All of the above
Direction: Choose the correct option

Q10.

Which cache implementations does Spring support?
A. ConcurrentMap, Ehcache, Caffeine, Redis, etc.
B. Only ConcurrentMap
C. Only Ehcache
D. None