0
0
Redisquery~20 mins

MULTI command to start in Redis - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Redis Transaction Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
query_result
intermediate
1:30remaining
What is the output after starting a transaction with MULTI?
You run the command MULTI in Redis to start a transaction. What is the immediate output you receive?
Redis
MULTI
A:1
B+OK
C-ERR wrong number of arguments for 'multi' command
D$-1
Attempts:
2 left
💡 Hint
Think about what Redis replies when a command is accepted successfully.
🧠 Conceptual
intermediate
1:30remaining
What happens to commands after MULTI is called?
After you run MULTI, what happens to the commands you send before calling EXEC?
ACommands are queued and not executed immediately.
BCommands execute immediately and their results are returned.
CCommands are discarded until EXEC is called.
DCommands cause an error until EXEC is called.
Attempts:
2 left
💡 Hint
Think about how transactions work in Redis.
📝 Syntax
advanced
2:00remaining
Which command sequence correctly starts and executes a transaction?
Choose the correct sequence of Redis commands to start a transaction, set a key, and execute the transaction.
A
MULTI
SET key1 value1
EXEC
B
EXEC
MULTI
SET key1 value1
C
SET key1 value1
MULTI
EXEC
D
MULTI
EXEC
SET key1 value1
Attempts:
2 left
💡 Hint
MULTI must come before queuing commands, and EXEC must come last.
🔧 Debug
advanced
2:00remaining
Why does this transaction fail to execute commands?
You run these commands: MULTI EXEC SET key1 value1 What is the problem?
AMULTI command was not recognized.
BEXEC must be called before MULTI.
CSET command syntax is incorrect.
DSET command is sent after EXEC, so it is not queued or executed in the transaction.
Attempts:
2 left
💡 Hint
Consider the order commands must be sent in a transaction.
optimization
expert
2:30remaining
How does using MULTI improve Redis command execution?
What is a key benefit of wrapping multiple commands inside MULTI/EXEC in Redis?
AImproves network speed by compressing commands.
BAutomatically retries commands on failure.
CEnsures all commands execute atomically without interference from other clients.
DAllows commands to execute in parallel on multiple threads.
Attempts:
2 left
💡 Hint
Think about what atomicity means in transactions.