0
0
Redisquery~10 mins

ZRANK and ZREVRANK for position 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 get the rank of member 'alice' in the sorted set 'players'.

Redis
ZRANK players [1]
Drag options to blanks, or click blank then click option'
Acharlie
Bbob
Calice
Ddave
Attempts:
3 left
💡 Hint
Common Mistakes
Using a member name that does not exist in the sorted set.
Confusing the sorted set name with the member name.
2fill in blank
medium

Complete the code to get the reverse rank of member 'bob' in the sorted set 'scores'.

Redis
ZREVRANK scores [1]
Drag options to blanks, or click blank then click option'
Abob
Balice
Ccharlie
Ddave
Attempts:
3 left
💡 Hint
Common Mistakes
Using ZRANK instead of ZREVRANK for reverse rank.
Using a member name not present in the sorted set.
3fill in blank
hard

Fix the error in the code to get the rank of 'charlie' in the sorted set 'leaderboard'.

Redis
ZRANK [1] charlie
Drag options to blanks, or click blank then click option'
Aplayers
Bleaderboard
Cscores
Dranking
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong sorted set name.
Swapping the member and sorted set arguments.
4fill in blank
hard

Fill both blanks to get the reverse rank of 'dave' in the sorted set 'game_scores'.

Redis
ZREVRANK [1] [2]
Drag options to blanks, or click blank then click option'
Agame_scores
Bdave
Calice
Dplayers
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping the order of sorted set and member.
Using a member not in the sorted set.
5fill in blank
hard

Fill all three blanks to get the rank of 'eve' in the sorted set 'highscores' and then get the reverse rank of 'frank' in the same set.

Redis
ZRANK [1] [2]
ZREVRANK [3] frank
Drag options to blanks, or click blank then click option'
Ahighscores
Beve
Dscores
Attempts:
3 left
💡 Hint
Common Mistakes
Using different sorted set names in the two commands.
Mixing up member names.