0
0
Redisquery~20 mins

TYPE command for key type check in Redis - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Redis TYPE Command Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
query_result
intermediate
1:00remaining
Check the type of a string key
Given a Redis database where the key user:1000 holds the value "Alice" as a string, what will be the output of the command TYPE user:1000?
Redis
TYPE user:1000
A"list"
B"string"
C"set"
D"none"
Attempts:
2 left
💡 Hint
Remember that Redis stores simple text values as strings.
query_result
intermediate
1:00remaining
Check type of a non-existing key
What will the command TYPE session:9999 return if the key session:9999 does not exist in the Redis database?
Redis
TYPE session:9999
A"empty"
B"null"
C"error"
D"none"
Attempts:
2 left
💡 Hint
Think about what Redis returns when a key is missing.
query_result
advanced
1:30remaining
Identify the type of a sorted set key
If the key leaderboard contains a sorted set of player scores, what will TYPE leaderboard return?
Redis
TYPE leaderboard
A"zset"
B"set"
C"hash"
D"list"
Attempts:
2 left
💡 Hint
Sorted sets have a special type name in Redis.
query_result
advanced
1:30remaining
Detect type of a hash key
What is the output of TYPE user:profile if user:profile is a hash storing user attributes?
Redis
TYPE user:profile
A"hash"
B"string"
C"list"
D"none"
Attempts:
2 left
💡 Hint
Hashes store field-value pairs in Redis.
🧠 Conceptual
expert
2:00remaining
Understanding TYPE command behavior with expired keys
If a key temp:data is set with an expiration and expires before the TYPE temp:data command is run, what will the TYPE command return?
A"expired"
B"string"
C"none"
D"error"
Attempts:
2 left
💡 Hint
Expired keys are automatically removed from Redis.