Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to start a Redis transaction.
Redis
redis.call('[1]')
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using EXEC to start the transaction instead of MULTI.
Using WATCH which is for monitoring keys, not starting transactions.
✗ Incorrect
The MULTI command starts a transaction block in Redis.
2fill in blank
mediumComplete the code to execute all commands in the current Redis transaction.
Redis
redis.call('[1]')
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using MULTI instead of EXEC to execute commands.
Using DISCARD which cancels the transaction.
✗ Incorrect
The EXEC command executes all commands queued in the current transaction.
3fill in blank
hardFix the error in the code to properly execute a Redis transaction.
Redis
redis.call('MULTI') redis.call('SET', 'key', 'value') redis.call('[1]')
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Calling MULTI again instead of EXEC.
Using DISCARD which cancels the transaction.
✗ Incorrect
After queuing commands with MULTI, use EXEC to execute them.
4fill in blank
hardFill both blanks to start a transaction and then cancel it.
Redis
redis.call('[1]') redis.call('[2]')
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using EXEC instead of DISCARD to cancel.
Using WATCH which does not cancel transactions.
✗ Incorrect
Use MULTI to start and DISCARD to cancel the transaction.
5fill in blank
hardFill all three blanks to watch a key, start a transaction, and execute it.
Redis
redis.call('[1]', 'mykey') redis.call('[2]') redis.call('[3]')
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using DISCARD instead of EXEC to run the transaction.
Starting transaction before watching keys.
✗ Incorrect
Use WATCH to monitor a key, MULTI to start the transaction, and EXEC to execute it.