0
0
Redisquery~10 mins

Why key management matters in Redis - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set a key named 'user:1' with value 'Alice' in Redis.

Redis
SET [1] Alice
Drag options to blanks, or click blank then click option'
Auser_1
Buser:1
Cuser
Duser1
Attempts:
3 left
💡 Hint
Common Mistakes
Using keys without namespaces can cause confusion and collisions.
2fill in blank
medium

Complete the code to retrieve the value of the key 'session:1234' from Redis.

Redis
GET [1]
Drag options to blanks, or click blank then click option'
Asession1234
Bsession_1234
Csession-1234
Dsession:1234
Attempts:
3 left
💡 Hint
Common Mistakes
Using underscores or dashes instead of colons can break key patterns.
3fill in blank
hard

Fix the error in the code to delete the key 'cache:data' from Redis.

Redis
DEL [1]
Drag options to blanks, or click blank then click option'
Acache_data
Bcache-data
Ccache:data
Dcachedata
Attempts:
3 left
💡 Hint
Common Mistakes
Using underscores or dashes instead of colons causes the command to fail.
4fill in blank
hard

Fill both blanks to set a key with a namespace and an expiration time of 3600 seconds.

Redis
SET [1] 'value' EX [2]
Drag options to blanks, or click blank then click option'
Auser:1001
B3600
C300
Duser1001
Attempts:
3 left
💡 Hint
Common Mistakes
Using keys without namespaces or wrong expiration times.
5fill in blank
hard

Fill all three blanks to increment a numeric key 'counter:visits' by 1 and retrieve its new value.

Redis
INCR [1]
GET [2]
DEL [3]
Drag options to blanks, or click blank then click option'
Acounter:visits
Dcounter_visits
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing key names with underscores or missing colons.