0
0
Redisquery~10 mins

Key design patterns in Redis - Interactive Code Practice

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

Complete the code to set a key with a value in Redis.

Redis
SET mykey [1]
Drag options to blanks, or click blank then click option'
AGET
Bvalue123
CDEL
DEXPIRE
Attempts:
3 left
💡 Hint
Common Mistakes
Using a command like GET or DEL instead of a value.
Leaving the value blank.
2fill in blank
medium

Complete the code to retrieve the value of a key in Redis.

Redis
[1] mykey
Drag options to blanks, or click blank then click option'
AGET
BSET
CDEL
DEXPIRE
Attempts:
3 left
💡 Hint
Common Mistakes
Using SET instead of GET.
Using DEL which deletes the key.
3fill in blank
hard

Fix the error in the code to delete a key in Redis.

Redis
[1] mykey
Drag options to blanks, or click blank then click option'
AGET
BSET
CEXPIRE
DDEL
Attempts:
3 left
💡 Hint
Common Mistakes
Using GET or SET which do not delete keys.
Using EXPIRE which only sets a timeout.
4fill in blank
hard

Fill both blanks to set a key with an expiration time of 60 seconds.

Redis
SET [1] [2] EX 60
Drag options to blanks, or click blank then click option'
Amykey
Bvalue123
Cvalue456
Dmyvalue
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping key and value positions.
Using a wrong value or key name.
5fill in blank
hard

Fill all three blanks to increment a counter key by 1 and get its new value.

Redis
[1] [2]
[3] [2]
Drag options to blanks, or click blank then click option'
AINCR
Bcounter
DGET
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong commands or missing the key name.
Trying to increment a non-integer key.