0
0
Redisquery~10 mins

Geo-proximity with sorted sets 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 add a location with longitude and latitude to a sorted set.

Redis
GEOADD locations 13.361389 38.115556 [1]
Drag options to blanks, or click blank then click option'
ASicily
BSicilyKey
CSicilyLocation
DSicilySet
Attempts:
3 left
💡 Hint
Common Mistakes
Using the key name instead of the member name.
Confusing longitude and latitude order.
2fill in blank
medium

Complete the code to find locations within 100 km radius from given coordinates.

Redis
GEORADIUS locations 15 37 [1] km
Drag options to blanks, or click blank then click option'
A150
B100
C50
D200
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong radius value.
Confusing meters and kilometers.
3fill in blank
hard

Fix the error in the command to get the distance between two locations.

Redis
GEODIST locations Sicily [1] km
Drag options to blanks, or click blank then click option'
APalermo
BPalermoLocation
CPalermoKey
DPalermoSet
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect member names.
Adding extra suffixes to member names.
4fill in blank
hard

Fill both blanks to get locations within 50 km and sort results by distance.

Redis
GEORADIUS locations 15 37 [1] km [2]
Drag options to blanks, or click blank then click option'
A50
BASC
CDESC
D100
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong radius value.
Using DESC instead of ASC for sorting.
5fill in blank
hard

Fill all three blanks to get locations within 100 km, sorted ascending, and include distances in output.

Redis
GEORADIUS locations 15 37 [1] km [2] WITHDIST [3]
Drag options to blanks, or click blank then click option'
AASC
BDESC
CCOUNT 5
D100
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up ASC and DESC.
Forgetting to include WITHDIST for distances.