0
0
Redisquery~10 mins

TTL-based expiry 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 TTL of 60 seconds.

Redis
SET mykey "value" EX [1]
Drag options to blanks, or click blank then click option'
A60
B600
C6
D3600
Attempts:
3 left
💡 Hint
Common Mistakes
Using milliseconds instead of seconds.
Forgetting to add the EX option.
2fill in blank
medium

Complete the command to check the remaining TTL of a key.

Redis
TTL [1]
Drag options to blanks, or click blank then click option'
Atimeout
Bvalue
Cexpire
Dmykey
Attempts:
3 left
💡 Hint
Common Mistakes
Using the value instead of the key name.
Using a wrong keyword instead of the key.
3fill in blank
hard

Fix the error in the command to remove the TTL from a key.

Redis
PERSIST [1]
Drag options to blanks, or click blank then click option'
Aexpire
Bmykey
Cvalue
Dtimeout
Attempts:
3 left
💡 Hint
Common Mistakes
Using the value instead of the key name.
Using commands like EXPIRE instead of PERSIST.
4fill in blank
hard

Fill both blanks to set a key with a TTL of 120 seconds and then check its TTL.

Redis
SET [1] "data" EX [2]
TTL [3]
Drag options to blanks, or click blank then click option'
Asession
B120
Cuser
D60
Attempts:
3 left
💡 Hint
Common Mistakes
Using different key names in SET and TTL commands.
Setting the wrong TTL value.
5fill in blank
hard

Fill all three blanks to set a key with TTL, check TTL, and then remove TTL.

Redis
SET [1] "temp" EX [2]
TTL [1]
PERSIST [3]
Drag options to blanks, or click blank then click option'
Acache
B30
Dtemp
Attempts:
3 left
💡 Hint
Common Mistakes
Using different key names in commands.
Confusing the key name with the value.