0
0
Redisquery~10 mins

ZRANGEBYLEX for lexicographic queries 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 all elements in the sorted set between 'a' and 'c' lexicographically.

Redis
ZRANGEBYLEX myzset [1]
Drag options to blanks, or click blank then click option'
A[a [c
B(a (c
C[a (c
D(a [c
Attempts:
3 left
💡 Hint
Common Mistakes
Using parentheses instead of square brackets causes exclusive boundaries.
Mixing inclusive and exclusive boundaries incorrectly.
2fill in blank
medium

Complete the code to get elements lexicographically greater than 'b' but less than or equal to 'd'.

Redis
ZRANGEBYLEX myzset [1]
Drag options to blanks, or click blank then click option'
A(b [d
B[b (d
C(b (d
D[b [d
Attempts:
3 left
💡 Hint
Common Mistakes
Using [b includes 'b' which is not desired here.
Using (d excludes 'd' which is not desired here.
3fill in blank
hard

Fix the error in the code to correctly get elements from 'a' inclusive to 'z' exclusive.

Redis
ZRANGEBYLEX myzset [1]
Drag options to blanks, or click blank then click option'
A(a (z
B(a [z
C[a [z
D[a (z
Attempts:
3 left
💡 Hint
Common Mistakes
Using (a excludes 'a' which is not desired.
Using [z includes 'z' which is not desired.
4fill in blank
hard

Fill both blanks to get elements lexicographically between 'm' exclusive and 't' inclusive.

Redis
ZRANGEBYLEX myzset [1] [2]
Drag options to blanks, or click blank then click option'
A(m
B[m
C[t
D(t
Attempts:
3 left
💡 Hint
Common Mistakes
Using [m includes 'm' which is not desired.
Using (t excludes 't' which is not desired.
5fill in blank
hard

Fill all three blanks to get elements from 'a' inclusive to 'z' exclusive, limiting to first 5 results.

Redis
ZRANGEBYLEX myzset [1] [2] LIMIT [3] 5
Drag options to blanks, or click blank then click option'
A[a
B(z
C0
D[z
Attempts:
3 left
💡 Hint
Common Mistakes
Using [z includes 'z' which is not desired.
Using wrong offset for LIMIT.