Which Redis data structure is particularly well-suited for implementing a real-time leaderboard with ranked scores?
String
Set
Sorted Set
List
What is the primary purpose of using a Redis Cluster?
To enhance data security with built-in encryption.
To distribute data and handle larger datasets than a single Redis instance can manage.
To enable efficient message queuing and pub/sub functionality.
To improve the performance of complex sorted set operations.
Can you use WATCH inside a MULTI/EXEC block in Redis?
WATCH
MULTI
EXEC
No, WATCH must be used before starting a transaction with MULTI.
Yes, you can use WATCH inside a MULTI/EXEC block to add keys to the watch list during a transaction.
Yes, but only if the keys being watched are the same as those being modified within the transaction.
No, WATCH is not compatible with transactions and must be used separately.
When a transaction is executed with EXEC, and a watched key has been modified, what is the expected return value?
An empty list ([]).
[]
The integer 0.
0
The integer 1.
1
The string "OK".
When integrating Redis as a cache layer with a database, what strategy ensures data consistency between the cache and the database?
Read-through cache
Write-through cache
All of the above
Cache-aside pattern
How are distances between geospatial points calculated in Redis?
Distances are not calculated; only relative positions are stored.
Using Manhattan distance.
Using the Haversine formula, accounting for Earth's curvature.
Using simple Euclidean distance.
In what scenarios would optimistic locking using WATCH be preferred over traditional locking in Redis?
When minimizing latency and maximizing concurrency are crucial.
When data consistency is not a major concern, and some data loss is acceptable.
When the likelihood of concurrent modifications is very high.
When the operations within the transaction are very time-consuming.
You have a key named 'temp:data' with an expiration time set. How would you remove the expiration time and make the key persist indefinitely?
There is no way to remove the expiration time once set
TTL temp:data -1
EXPIRE temp:data 0
PERSIST temp:data
Which of the following best describes the relationship between publishers and subscribers in Redis Pub/Sub?
One-to-many, with one publisher broadcasting to multiple subscribers.
All of the above are possible scenarios.
Many-to-one, with multiple publishers sending messages to a single subscriber.
One-to-one, with each publisher dedicated to a single subscriber.
A Redis key 'product:567' has a TTL of 60 seconds. What will be the TTL of this key after executing the command PERSIST product:567?
PERSIST product:567
None of the above
-1
60