0
0
Redisquery~10 mins

LREM for element removal in Redis - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to remove all occurrences of 'apple' from the list 'fruits'.

Redis
LREM fruits 0 [1]
Drag options to blanks, or click blank then click option'
A"apple"
Bapple
C'apple'
Dapple"
Attempts:
3 left
💡 Hint
Common Mistakes
Not using quotes around the element.
Using mismatched or missing quotes.
2fill in blank
medium

Complete the code to remove only the first occurrence of 'banana' from the list 'fruits'.

Redis
LREM fruits [1] "banana"
Drag options to blanks, or click blank then click option'
A-1
B0
C2
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Using 0 removes all occurrences, not just the first.
Using negative numbers removes from tail to head.
3fill in blank
hard

Fix the error in the code to remove the last occurrence of 'orange' from the list 'fruits'.

Redis
LREM fruits [1] "orange"
Drag options to blanks, or click blank then click option'
A-1
B0
C1
D2
Attempts:
3 left
💡 Hint
Common Mistakes
Using 1 removes the first occurrence, not the last.
Using 0 removes all occurrences.
4fill in blank
hard

Fill both blanks to remove two occurrences of 'grape' starting from the tail in the list 'fruits'.

Redis
LREM fruits [1] [2]
Drag options to blanks, or click blank then click option'
A-2
B2
C"grape"
D"apple"
Attempts:
3 left
💡 Hint
Common Mistakes
Using positive count removes from head, not tail.
Using wrong element name.
5fill in blank
hard

Fill all three blanks to remove three occurrences of 'melon' starting from the head in the list 'fruits'.

Redis
LREM [1] [2] [3]
Drag options to blanks, or click blank then click option'
Afruits
B3
C"melon"
D"banana"
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong list name.
Using negative count to remove from tail.
Using wrong element name.