You need to store a leaderboard with scores for players. Which Redis data type is most appropriate?
Hash
List
Sorted Set
Set
Which AOF configuration option tells Redis to rewrite the AOF file periodically to reduce its size?
aof_rewrite_threshold
aof_optimize
aof_compact_size
aof_rewrite_frequency
Which of these is NOT a common use case for Redis?
Leaderboards and real-time analytics
Storing large blobs of unstructured data
Caching
Session management
You want to store a list of a user's recent activity in chronological order. What Redis data type is suitable?
String
What is the purpose of the SADD command in Redis?
SADD
Adds an element to a set only if it doesn't already exist.
Retrieves a value from a hash.
Adds an element to a sorted set.
Adds an element to the beginning of a list.
Which command would you use to retrieve the value associated with the key 'username' in Redis?
SET username
LPUSH username
GET username
HGET username
Which data type would you use to implement a leaderboard where scores are constantly updated?
What is the correct way to set a key-value pair named 'mykey' with the value 'myvalue' using redis-py?
r.insert('mykey', 'myvalue')
r.put('mykey', 'myvalue')
r.set('mykey', 'myvalue')
r.assign('mykey', 'myvalue')
What happens if you try to rename a key to a name that already exists in Redis?
An error is returned, and the original key remains unchanged.
The existing key is overwritten with the value of the renamed key.
The command is ignored.
Redis creates a new key with a unique name.
Which method is used to check if a key exists in a Redis database using redis-py?
r.check('mykey')
r.contains('mykey')
r.has_key('mykey')
r.exists('mykey')