0
0
Redisquery~10 mins

Why sorted sets combine uniqueness with ordering 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 add a member with a score to a sorted set in Redis.

Redis
ZADD myset 10 [1]
Drag options to blanks, or click blank then click option'
Amember1
BmemberX
CmemberA
DmemberZ
Attempts:
3 left
💡 Hint
Common Mistakes
Putting the member before the score.
Using a command other than ZADD.
2fill in blank
medium

Complete the code to retrieve members from the sorted set ordered by score ascending.

Redis
ZRANGE myset 0 [1]
Drag options to blanks, or click blank then click option'
A-1
B5
C10
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Using a positive number that limits the output.
Confusing the order of arguments.
3fill in blank
hard

Fix the error in the command to add a member with score 15 to the sorted set.

Redis
ZADD myset 15 [1]
Drag options to blanks, or click blank then click option'
Ascore15
Bmember15
C15
Dmember
Attempts:
3 left
💡 Hint
Common Mistakes
Putting the member before the score.
Using a number as the member name.
4fill in blank
hard

Fill both blanks to retrieve members with scores between 5 and 20 inclusive.

Redis
ZRANGEBYSCORE myset [1] [2]
Drag options to blanks, or click blank then click option'
A5
B20
C(5
D(20
Attempts:
3 left
💡 Hint
Common Mistakes
Using parentheses which exclude the boundary scores.
Swapping the min and max values.
5fill in blank
hard

Fill all three blanks to increment the score of 'memberA' by 5 in the sorted set.

Redis
ZINCRBY [1] [2] [3]
Drag options to blanks, or click blank then click option'
Amyset
B5
CmemberA
DmemberB
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping the increment and member arguments.
Using the wrong key name.