0
0
Redisquery~10 mins

LPUSH and RPUSH for insertion 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 add an element to the start of a Redis list.

Redis
LPUSH mylist [1]
Drag options to blanks, or click blank then click option'
A"banana"
B"cherry"
C"apple"
D"date"
Attempts:
3 left
💡 Hint
Common Mistakes
Using RPUSH instead of LPUSH when adding to the start.
Forgetting to put quotes around the element.
2fill in blank
medium

Complete the code to add an element to the end of a Redis list.

Redis
RPUSH mylist [1]
Drag options to blanks, or click blank then click option'
A"honeydew"
B"grape"
C"egg"
D"fig"
Attempts:
3 left
💡 Hint
Common Mistakes
Using LPUSH instead of RPUSH when adding to the end.
Not quoting the element string.
3fill in blank
hard

Fix the error in the command to add "kiwi" to the start of the list.

Redis
LPUSH mylist [1]
Drag options to blanks, or click blank then click option'
Akiwi"
Bkiwi
C'kiwi'
D"kiwi"
Attempts:
3 left
💡 Hint
Common Mistakes
Not quoting the string element.
Using mismatched or incomplete quotes.
4fill in blank
hard

Fill both blanks to add "lemon" to the start and "mango" to the end of the list.

Redis
LPUSH mylist [1]
RPUSH mylist [2]
Drag options to blanks, or click blank then click option'
A"lemon"
B"melon"
C"mango"
D"lime"
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping the elements between LPUSH and RPUSH.
Forgetting quotes around the elements.
5fill in blank
hard

Fill all three blanks to add "orange" to the start, "pear" to the end, and "plum" to the start again.

Redis
LPUSH mylist [1]
RPUSH mylist [2]
LPUSH mylist [3]
Drag options to blanks, or click blank then click option'
A"orange"
B"pear"
C"plum"
D"peach"
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up the order of elements.
Using RPUSH when LPUSH is needed and vice versa.