Redis Interview Question-Answer Part – 2

Q.1 _________ is used to flush the transaction queue and exit from the transaction.

       A. Discard

       B. Multi

       C. Exec

Ans : Discard

Q.2 Which of the following does the Redis Hashes store?

       A. Key

       B. Key value pairs

       C. Length of the file

       D. Value

Ans : Key value pairs

Q.3 _____________ is a type of lock that allows you to limit the number of processes that can concurrently access a resource to some fixed number.

       A. Lock with timeouts

       B. Optimistic locking

       C. Counting semaphore

       D. Distributed locking

Ans : Counting semaphore

Q.4 In a Redis transaction, we can use ________ command to enter into the transaction and queue the transaction commands instead of executing them.

       A. Multi

       B. Discard

       C. Exec

Ans : Multi

Q.5 ZSCORE command returns the range of members in a sorted set, by score.

       A. True

       B. False

Ans : False

Q.6 Which of the following commands returns the remaining time for the key to expire?

       A. TTL

       B. EXISTS

       C. PPL

Ans : TTL

Q.7 Which of the following commands is used to post the message to the channel?

       A. PRINT

       B. PUBLISH

       C. All the options


Q.8 Which is the short structure that Redis provides for the compact representation of Sets?

       A. Intset-max

       B. intset

       C. ziplist

       D. Set-max

Ans : intset

Q.9 ________ implies the maximum allowed size of each individual element in the data structure to be encoded to ziplist short structure.

       A. max-ziplist-entries

       B. list-max-ziplist-value

       C. hash-max-ziplist-entries

       D. max-ziplist-value

Ans : max-ziplist-value

Q.10 Which among the following factors helps in calculating the number of shards in Redis?

       A. Number of keys in a single shard

       B. Number of keys in multiple shards

       C. Partition key

       D. Hash data structure

Ans : Number of keys in a single shard

Q.11 _________ is the memory policy that returns errors when the memory limit is reached, and the client is trying to execute commands that result in higher memory usage.

       A. allkeys-random

       B. noeviction

       C. allkeys-lru

Ans : noeviction

Q.12 Which configuration setting is used to specify the memory eviction policy in Redis?

       A. maxmemory-samples

       B. max-memory

       C. flushdb

       D. maxmemory-policy

Ans : maxmemory-policy

Q.13 Which among the following is a benefit of Pipelining?

       A. Less commands

       B. Data as batches

       C. Speed

       D. Primary memory

Ans : Speed

Q.14 Twemproxy is a proxy developed at Twitter for Redis protocol for automatic partitioning among multiple Redis instances and optional ejection of the node if it is not available.

       A. True

       B. False

Ans : True

Q.15 Consider an example where a range of users from 0 to 10000 goes to a Redis instance R0, and another range of users 10001 to 20000 goes to R1. This is _________ partitioning.

       A. Hash partitioning

       B. Range partitioning

       C. Client partitioning

Ans : Range partitioning

Q.16 How many commands can be sent to a server in pipelining?

       A. Multiple

       B. 2

       C. None

       D. Single

Ans : Multiple

Q.17 Which is the mechanism to enforce limits on the access of a resource when multiple threads are executed?

       A. EXPIRE

       B. Publish

       C. Locking

       D. PERSIST

Ans : Locking

Q.18 _________ is an implementation of partitioning where you can send your query to a random instance, and the instance will forward your query to the right node.

       A. Query routing

       B. Proxy assisted partitioning

       C. Client side partitioning

Ans : Query routing

Q.19 _________ is the configuration setting that tells the maximum number of items allowed in a Hash table for ziplist encoding.

       A. list-max-ziplist-entries

       B. hash-max-ziplist-entries

       C. list-max-ziplist-value

       D. hash-max-ziplist-value

Ans : hash-max-ziplist-entries

Q.20 The ____________ command is used to set a lock in string dataset.

       A. SETEX

       B. SETNX

       C. PSETEX

       D. SET


Q.21 The persistent server should be the _________ once the whole environment is started.

       A. Master Server

       B. Slave

       C. Primary memory

       D. Secondary storage

Ans : Master Server

Q.22 In-Memory database stores data in the memory.

       A. True

       B. False

Ans : True

Q.23 _________ is required in the distributed backend systems where cache state needs to be maintained uniformly across the systems.

       A. Hashing

       B. Sharding

       C. Centralized cache

Ans : Centralized cache

Q.24 ____________ is the memory eviction policy where keys are evicted by removing the less recently used keys first but only among keys that have an ‘expire’ field set, to make space for the newly added data.

       A. allkeys-lru

       B. Volatile-random

       C. Volatile-ttl

       D. Volatile-lru

Ans : Volatile-lru

Q.25 _________ is the technique of breaking down data into multiple parts.

       A. Optimizing

       B. Hashing

       C. Sharding

Ans : Sharding

Q.26 List is a sequence of ___________.

       A. Ordered element

       B. LRANGE

       C. Unordered element

       D. Linked List

Ans : Ordered element

Q.27 In a key-value pair, _________ is represented by a string.

       A. Key

       B. Data

       C. Value

       D. Text

Ans : Value

Q.28 Redis string cannot hold any value beyond a certain length. What is it?

       A. 5 GB

       B. 512 MB

       C. 1 GB

       D. 256 MB

Ans : 512 MB

Q.29 The environment continues to work even if a slave fails.

       A. True

       B. False

Ans : True

Leave a Comment

Your email address will not be published. Required fields are marked *