What does the TTL command return for a key that doesn't expire?
TTL
-1
-2
0
An error message
What is the key difference between a Set and a Sorted Set in Redis?
Sorted Sets allow duplicate elements, while Sets do not.
Sets allow range-based queries, while Sorted Sets do not.
Sorted Sets associate a score with each element, while Sets do not.
Sets are mutable, while Sorted Sets are immutable.
Which command is used to remove a field from a hash in Redis?
HDEL
HGET
SREM
DEL
How do you delete a key-value pair in Redis where the key is 'city'?
REMOVE city
DELETE city
ERASE city
DROP city
Which of these is NOT a common use case for Redis?
Caching
Leaderboards and real-time analytics
Storing large blobs of unstructured data
Session management
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.
The command is ignored.
An error is returned, and the original key remains unchanged.
Redis creates a new key with a unique name.
Which command is used to download and install Redis on a Debian-based Linux system?
wget redis.com
yum install redis
apt-get install redis
brew install redis
What is the default port on which the Redis server listens for connections?
6379
27017
3306
80
Which command adds a new element to the beginning of a list in Redis?
LPUSH
ZADD
RPUSH
SADD
What is the purpose of the SADD command in Redis?
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.