How would you add an element 'apple' to a set named 'fruits' in Redis?
LPUSH fruits apple
SADD fruits apple
HSET fruits apple
SET fruits apple
Which command would you use to retrieve the value associated with the key 'username' in Redis?
GET username
HGET username
SET username
LPUSH username
What is the purpose of the SADD command in Redis?
SADD
Adds an element to a sorted set.
Adds an element to a set only if it doesn't already exist.
Retrieves a value from a hash.
Adds an element to the beginning of a list.
Which of these is NOT a common use case for Redis?
Storing large blobs of unstructured data
Caching
Leaderboards and real-time analytics
Session management
You need to store a leaderboard with scores for players. Which Redis data type is most appropriate?
Set
List
Hash
Sorted Set
Which command would you use to remove the key 'user:123' and its associated value from Redis?
DEL user:123
DROP user:123
DELETE user:123
REMOVE user:123
Which Redis persistence option offers a more durable approach, potentially reducing data loss?
Both are equally durable
AOF
Neither
RDB
What is the result of executing 'INCR counter' if the 'counter' key does not exist in Redis?
Null
Error: Key not found
0
1
What file extension is typically used for Redis's Append-Only File?
.redis
.aof
.log
.rdb
How do you delete a key-value pair in Redis where the key is 'city'?
DROP city
ERASE city
REMOVE city
DELETE city