Redis - Multiple Choice Questions (MCQ)
1. Which Redis data structure is used to store a collection of unique strings?
a. Hash
b. Set
c. List
d. Sorted Set
2. Which Redis data structure is used to store a collection of ordered strings with duplicate values allowed?
a. Hash
b. Set
c. List
d. Sorted Set
3. Which Redis data structure is used to store a collection of ordered strings with duplicate values not allowed?
a. Hash
b. Set
c. List
d. Sorted Set
4. Which Redis data structure is used to store a collection of key-value pairs?
a. Hash
b. Set
c. List
d. Sorted Set
5. Which Redis command is used to set the value of a key?
a. SET key value
b. GET key value
c. DEL key value
d. INCR key value
6. Which Redis command is used to get the value of a key?
a. SET key value
b. GET key value
c. DEL key value
d. INCR key value
7. Which Redis command is used to delete the specified key?
a. SET key value
b. GET key value
c. DEL key value
d. INCR key value
8. Which Redis command is used to increment the integer value of a key by 1?
a. SET key value
b. GET key value
c. DEL key value
d. INCR key value
9) What is the name of the Redis data type that can hold multiple values at once, like an array in other programming languages?
a. Hash
b. Set
c. List
d. Sorted Set
10) What is the name of the Redis data type that can store strings, hashes, lists, and sets as its values?
a. Sorted Set
b. Set
c. List
d. Hash
Answers:
1. B) Set
2. C) List (with duplicate values allowed)
3. D) Sorted Set (with duplicate values not allowed)
4. A) Hash
5. A) SET key value
6. B) GET key value
7. C) DEL key value
8. D) INCR key value
9. C) List
10. D) Hash (can store multiple data types as its values)