Redis MCQ Questions And Answers
Redis MCQs : This section focuses on "Basics" of Redis. These Multiple Choice Questions (MCQ) should be practiced to improve the Redis skills required for various interviews (campus interviews, walk-in interviews, company interviews), placements, entrance exams and other competitive examinations.
1. Redis is a?
A. NoSQL database
B. Relational database
C. End-user database
D. Commercial database
View Answer
Ans : A
Explanation: Redis is a type of database that's commonly referred to as No SQL or non-relational . In Redis, there are no tables, and there's no database-defined or -enforced way of relating data in Redis with other data in Redis.
2. Redis Initial release in?
A. 2008
B. 2009
C. 2010
D. 2011
View Answer
Ans : B
Explanation: Initial release date: 10 April 2009
3. Redis Developer?
A. C. Redis
B. P. Redis
C. Redis Labs
D. Z. Redis
View Answer
Ans : C
Explanation: Developer: Redis Labs
4. Which of the following is true about Redis?
A. Redis is an open source
B. Redis advanced key-value store
C. Redis scalable web applications
D. All of the above
View Answer
Ans : D
Explanation: Redis is an open source, advanced key-value store and an apt solution for building highperformance, scalable web applications.
5. Redis is very fast and can perform about ___________ SETs per second?
A. 10000
B. 110000
C. 1000000
D. 111000
View Answer
Ans : B
Explanation: Redis is very fast and can perform about 110000 SETs per second, about 81000 GETs per second.
6. Which of the following is correct syntax of Redis CONFIG command?
A. CONFIG SET CONFIG_SETTING_NAME
B. CONFIG PUT CONFIG_SETTING_NAME
C. CONFIG GET CONFIG_SETTING_NAME
D. All of the above
View Answer
Ans : C
Explanation: The basic syntax of Redis CONFIG command : CONFIG GET CONFIG_SETTING_NAME
7. To update configuration, you can edit redis.conf file directly or you can update configurations via?
A. CONFIG update command
B. CONFIG put command
C. CONFIG alter command
D. CONFIG set command
View Answer
Ans : D
Explanation: To update configuration, you can edit redis.conf file directly or you can update configurations via CONFIG set command.
8. Which of the following file available at the root directory of Redis?
A. redis.conf
B. redis.txt
C. redis.set
D. redis.config
View Answer
Ans : A
Explanation: In Redis, there is a configuration file (redis.conf) available at the root directory of Redis.
9. How many types of data types redis supports?
A. 3
B. 4
C. 5
D. 6
View Answer
Ans : C
Explanation: Redis supports 5 types of data types : Strings, Hashes, Lists, Sets, Sorted Sets.
10. A string value can be at max ________ megabytes in length.
A. 128
B. 256
C. 512
D. 1024
View Answer
Ans : C
Explanation: A string value can be at max 512 megabytes in length.
11. Which of the following is a key in string?
SET name "letsfindcourse"
A. name
B. get
C. set
D. None of the above
View Answer
Ans : A
Explanation: SET and GET are Redis commands, name is the key used in Redis and tutorialspoint is the string value that is stored in Redis.
12. You can add elements to a Redis List on the?
A. Head
B. Tail
C. leaf
D. Both A and B
View Answer
Ans : D
Explanation: You can add elements to a Redis List on the head or on the tail.
13. What is time complexity for sets in redis?
A. O(N)
B. O(N*N)
C. O(NLOGN)
D. O(1)
View Answer
Ans : D
Explanation: In Redis, you can add, remove, and test for the existence of members in O(1) time complexity.
14. Which of the following is an unordered collection of strings?
A. Sorted Sets
B. Sets
C. Lists
D. Strings
View Answer
Ans : B
Explanation: Redis Sets are an unordered collection of strings.
15. Which of the following basic syntax of Redis client?
A. $redis-client
B. $redis cli
C. $redis-cli
D. $redis client
View Answer
Ans : C
Explanation: Following is the basic syntax of Redis client : $redis-cli
16. we connect to Redis server running on the local machine and execute a command ?
A. help
B. redis-server
C. ping
D. redis-connect
View Answer
Ans : C
Explanation: we connect to Redis server running on the local machine and execute a command PING, that checks whether the server is running or not.
17. The below command is used to?
DEL letsfindcourse
A. The command used to delete the command.
B. The command is used to delete the key.
C. The command is used to set the keys.
D. None of the above
View Answer
Ans : B
Explanation: DEL is the command, while letsfindcourse is the key. If the key is deleted, then the output of the command will be (integer) 1, otherwise it will be (integer) 0.
18. Which of the following command used to Sets the expiry of the key after the specified time?
A. EXISTS key
B. EXPIRE key seconds
C. EXPIREAT key timestamp
D. PEXPIRE key milliseconds
View Answer
Ans : B
Explanation: EXPIRE key seconds : Sets the expiry of the key after the specified time.
19. Which of the following command is used to Changes the key name?
A. RENAME key newkey
B. RANDOMKEY
C. RENAMENX key newkey
D. TYPE key
View Answer
Ans : A
Explanation: RENAME key newkey : Changes the key name.
20. Redis Sorted Sets are similar to Redis Sets, non-repeating collections of Strings
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: Redis Sorted Sets are similar to Redis Sets, non-repeating collections of Strings
Discussion