0
0
Redisquery~20 mins

SISMEMBER for membership check in Redis - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Redis SISMEMBER Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
query_result
intermediate
1:30remaining
Check if a member exists in a Redis set
Given a Redis set named fruits containing apple, banana, and cherry, what is the output of SISMEMBER fruits banana?
Redis
SISMEMBER fruits banana
A0
B1
Cnil
Derror
Attempts:
2 left
💡 Hint
SISMEMBER returns 1 if the element is in the set, otherwise 0.
query_result
intermediate
1:30remaining
Check membership of a non-existing element
What is the output of SISMEMBER fruits orange if the set fruits contains apple, banana, and cherry?
Redis
SISMEMBER fruits orange
A1
Berror
Cnil
D0
Attempts:
2 left
💡 Hint
SISMEMBER returns 0 if the element is not in the set.
📝 Syntax
advanced
2:00remaining
Identify the syntax error in SISMEMBER usage
Which option shows an incorrect syntax for the SISMEMBER command?
ASISMEMBER fruits
BSISMEMBER fruits cherry
CSISMEMBER fruits orange
DSISMEMBER fruits banana
Attempts:
2 left
💡 Hint
SISMEMBER requires exactly two arguments: the set key and the member to check.
query_result
advanced
1:30remaining
Check membership on a non-existing set
What is the output of SISMEMBER colors red if the set colors does not exist in Redis?
Redis
SISMEMBER colors red
A1
Bnil
C0
Derror
Attempts:
2 left
💡 Hint
SISMEMBER returns 0 if the set does not exist.
🧠 Conceptual
expert
2:30remaining
Understanding SISMEMBER return values
Which statement correctly describes the return values of the Redis SISMEMBER command?
AReturns 1 if the member exists, 0 if not, and 0 if the set does not exist
BReturns true if the member exists, false if not, and error if the set does not exist
CReturns 1 if the member exists in the set, 0 if not, and nil if the set does not exist
DReturns the member value if it exists, otherwise returns nil
Attempts:
2 left
💡 Hint
Think about how Redis treats non-existing sets for membership checks.