Which data type would you use to implement a leaderboard where scores are constantly updated?
List
Hash
Sorted Set
Set
How do you retrieve the value associated with the key 'mykey' in redis-py?
r.fetch('mykey')
r.read('mykey')
r.retrieve('mykey')
r.get('mykey')
What data type does Redis primarily use to store values?
Boolean
Float
String
Integer
How would you add an element 'apple' to a set named 'fruits' in Redis?
SADD fruits apple
LPUSH fruits apple
HSET fruits apple
SET fruits apple
What is the correct way to set a key-value pair named 'mykey' with the value 'myvalue' using redis-py?
r.set('mykey', 'myvalue')
r.put('mykey', 'myvalue')
r.assign('mykey', 'myvalue')
r.insert('mykey', 'myvalue')
How do you delete a key-value pair in Redis where the key is 'city'?
DROP city
ERASE city
DELETE city
REMOVE city
What is the result of executing 'INCR counter' if the 'counter' key does not exist in Redis?
1
Null
0
Error: Key not found
Which Redis configuration setting controls the interval (in seconds) for saving RDB snapshots?
rdb_save_seconds
snapshot_frequency
save_interval
rdb_snapshot_time
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
An error occurs because you cannot overwrite an expiring key.
The expiration time is retained.
The expiration time is reset to its default value.
The expiration time is removed, making the key persistent.
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.
An error is returned, and the original key remains unchanged.
The command is ignored.
Redis creates a new key with a unique name.