0
0
Redisquery~10 mins

Unique visitor tracking with 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 visitor ID to the set of unique visitors for today.

Redis
SADD unique_visitors:2024-06-01 [1]
Drag options to blanks, or click blank then click option'
Avisitor123
BGET
CDEL
DSET
Attempts:
3 left
💡 Hint
Common Mistakes
Using commands like GET or DEL instead of the visitor ID.
Forgetting to specify the visitor ID.
2fill in blank
medium

Complete the code to count how many unique visitors visited today.

Redis
SCARD [1]
Drag options to blanks, or click blank then click option'
Avisitors_today
Bvisitor_count
Cunique_visitors:2024-06-01
Dunique_visitors
Attempts:
3 left
💡 Hint
Common Mistakes
Using a key that does not exist or is not a set.
Confusing SCARD with other commands like GET.
3fill in blank
hard

Fix the error in the code to get the union of unique visitors from two days.

Redis
SUNION unique_visitors:2024-06-01 [1]
Drag options to blanks, or click blank then click option'
Aunique_visitors:2024-06-01
Bunique_visitors:2024-06-03
Cunique_visitors
Dunique_visitors:2024-06-02
Attempts:
3 left
💡 Hint
Common Mistakes
Using the same key twice.
Using a key that does not exist.
4fill in blank
hard

Fill both blanks to store the union of two days' unique visitors into a new set.

Redis
SUNIONSTORE [1] unique_visitors:2024-06-01 [2]
Drag options to blanks, or click blank then click option'
Aunique_visitors:2024-06-01-02
Bunique_visitors:2024-06-03
Cunique_visitors:2024-06-02
Dunique_visitors:2024-06-04
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up source and destination keys.
Using keys that do not exist.
5fill in blank
hard

Fill all three blanks to find the intersection of three days' unique visitors and store it in a new set.

Redis
SINTERSTORE [1] unique_visitors:2024-06-01 [2] [3]
Drag options to blanks, or click blank then click option'
Aunique_visitors:2024-06-01-02-03
Bunique_visitors:2024-06-02
Cunique_visitors:2024-06-03
Dunique_visitors:2024-06-04
Attempts:
3 left
💡 Hint
Common Mistakes
Using keys that do not exist.
Confusing intersection with union commands.