0
0
Redisquery~20 mins

Redis data model (key-value) - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Redis Key-Value Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Redis Key-Value Storage

Which statement best describes how Redis stores data in its key-value model?

ARedis stores data as keys linked exclusively to JSON documents.
BRedis stores data as keys with associated string values only, no other data types.
CRedis stores data only as keys with numeric values for fast calculations.
DRedis stores data as keys associated with various data types like strings, lists, sets, hashes, and sorted sets.
Attempts:
2 left
💡 Hint

Think about the flexibility Redis offers beyond simple strings.

dax_lod_result
intermediate
2:00remaining
Calculating Unique Keys in Redis-like Model

Given a Redis-like key-value store where keys represent user IDs and values represent user roles, which DAX measure correctly counts unique user IDs?

Redis
UniqueUsers = DISTINCTCOUNT('UserRoles'[UserID])
AUniqueUsers = SUM('UserRoles'[UserID])
BUniqueUsers = DISTINCTCOUNT('UserRoles'[UserID])
CUniqueUsers = COUNT('UserRoles'[UserID])
DUniqueUsers = COUNTROWS('UserRoles')
Attempts:
2 left
💡 Hint

Counting unique keys means counting distinct user IDs.

visualization
advanced
2:00remaining
Visualizing Redis Key Expiry Distribution

You have a Redis database with keys that have different expiry times. Which visualization best shows the distribution of key expiry times to help monitor key lifetimes?

AA histogram showing the count of keys grouped by expiry time ranges.
BA line chart showing expiry times on the x-axis and number of keys on the y-axis over time.
CA pie chart showing the percentage of keys per expiry time category.
DA scatter plot showing keys on x-axis and expiry time on y-axis.
Attempts:
2 left
💡 Hint

Think about how to show frequency distribution of expiry times.

data_modeling
advanced
2:00remaining
Modeling User Sessions in Redis Key-Value Store

You want to model user sessions in Redis using key-value pairs. Each session has a unique session ID, user ID, and expiration time. Which Redis data structure and key design is best for efficient session lookup and expiry?

AUse hash keys with session ID as key and fields for user ID and expiry timestamp, setting Redis key expiry for session timeout.
BUse list keys with session IDs as list elements and separate keys for user IDs and expiry times.
CUse string keys with session ID as key and JSON string as value containing user ID and expiry timestamp.
DUse set keys with user IDs as members and session IDs stored as values in separate keys.
Attempts:
2 left
💡 Hint

Consider how Redis expiry works and how to store multiple fields per session.

🔧 Debug
expert
2:00remaining
Identifying Error in Redis Key Expiry Command Usage

Which Redis command usage will cause an error when trying to set a key with expiry?

Options:
ASET mykey "value" EX 60
BSET mykey "value" PX 60000
CSET mykey EXPIRE 60 "value"
DSETEX mykey 60 "value"
Attempts:
2 left
💡 Hint

Check the correct syntax for setting expiry with SET command.