You have a key with an expiration time set. If you overwrite this key with a new value using SET, what happens to the expiration?
SET
The expiration time is reset to its default value.
The expiration time is retained.
The expiration time is removed, making the key persistent.
An error occurs because you cannot overwrite an expiring key.
What file extension is typically used for Redis's Append-Only File?
.redis
.aof
.rdb
.log
What happens if you try to rename a key to a name that already exists in Redis?
The existing key is overwritten with the value of the renamed key.
Redis creates a new key with a unique name.
An error is returned, and the original key remains unchanged.
The command is ignored.
Which command adds a new element to the beginning of a list in Redis?
RPUSH
SADD
LPUSH
ZADD
What is the primary difference between a Redis Set and a Redis List?
Sets do not allow duplicates, Lists allow duplicates
Sets are ordered, Lists are unordered
There is no difference
Sets allow duplicates, Lists do not
Which command is used to decrease the value of a key by 1 in Redis?
SUB
MINUS
DECR
DECREMENT
Which command would you use to retrieve the value associated with the key 'username' in Redis?
SET username
LPUSH username
HGET username
GET username
How do you set a key to expire after 20 seconds in Redis?
EXPIRE key 20
SETEX key 20 value
PERSIST key 20
TIMEOUT key 20
You want to store a list of a user's recent activity in chronological order. What Redis data type is suitable?
String
List
Hash
Set
What is the primary effect of renaming a key in Redis?
Changes the expiration time of the key.
Changes the value associated with the key.
Changes how the key is referenced.
Changes the data type of the key.