0
0
Redisquery~10 mins

INCR and DECR for counters 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 increase the value of the counter by 1.

Redis
INCR [1]
Drag options to blanks, or click blank then click option'
Acounter
Bdecr
Cset
Dget
Attempts:
3 left
💡 Hint
Common Mistakes
Using the command name as the key.
Using commands like SET or GET instead of the key name.
2fill in blank
medium

Complete the code to decrease the value of the counter by 1.

Redis
DECR [1]
Drag options to blanks, or click blank then click option'
Avalue
Bnumber
Ccounter
Dincrease
Attempts:
3 left
💡 Hint
Common Mistakes
Using a command name instead of the key.
Using a wrong key name that does not exist.
3fill in blank
hard

Fix the error in the code to correctly increase the counter.

Redis
INCR [1]
Drag options to blanks, or click blank then click option'
Aincr
Bcounter_value
Cdecr
Dcounter
Attempts:
3 left
💡 Hint
Common Mistakes
Using command names like INCR or DECR as the key.
Using a different key name than the one initialized.
4fill in blank
hard

Fill both blanks to increase and then decrease the counter.

Redis
INCR [1]
DECR [2]
Drag options to blanks, or click blank then click option'
Acounter
Bvalue
Ccount
Dnumber
Attempts:
3 left
💡 Hint
Common Mistakes
Using different key names for INCR and DECR.
Using keys that do not exist.
5fill in blank
hard

Fill all three blanks to set a counter, increase it, and then get its value.

Redis
SET [1] 10
INCR [2]
GET [3]
Drag options to blanks, or click blank then click option'
Acounter
Dvalue
Attempts:
3 left
💡 Hint
Common Mistakes
Using different key names in SET, INCR, and GET.
Using a key name that was not set.