Top Redis Interview Questions (2021) | CodeUsingJava
















Most frequently asked Redis Interview Questions


  1. What is the meaning of Redis?
  2. What are the advantages of using Redis?
  3. What data structures are supported by Redis?
  4. How can you use Redis with .Net application?
  5. What is Express.js?
  6. What is the difference between Redis and Memcached?
  7. Difference between Redis replication and sharding?
  8. List out the operation keys of Redis?
  9. What is the difference between Redis and RocksDB?
  10. How to empty a redis database?
  11. How to set value in Redis?
  12. What are the limitations of Redis?


What is the meaning of Redis?

Redis is an open source that is referred to a data structure server and it stands for Remote Dictionary Server. It helps us to operate atomic operations, like appending to a string and incrementing the value in hash.
Redis works as in memory dataset.It is the best choice for caching, session management, gaming, leaderboards, real-time analytics, etc.

What are the advantages of using Redis?

  • Allows storing key and value pairs
  • It can provide high speed
  • It offers data replication
  • It can withstand failures and provide uninterrupted service
  • Redis has got lots of client lib

What data structures are supported by Redis?

Hashes, Lists, Sets, Sorted sets with range queries, Bitmaps, Hyperloglogs and many more data structures are supported by redis.

How can you use Redis with .Net application?


Redis




What is Express.js?

Express.js is a framework that helps us to organize our web application into a MVC architecture.We can use a variety of languages like Jade, EJS, etc.

What is the difference between Redis and Memcached?

Redis
  • uses single cores
  • maximum key length is 512MB
  • easier to install
  • speed is slow
  • uses persistent data
  • supports Sharding

Memcached
  • uses multiple cores
  • maximum key length is 250 bytes
  • difficult to install
  • speed is higher than Redis
  • does not use persistent data
  • does not support any partitioning method

Difference between Redis replication and sharding?

Replication is used to copy all data for getting high availibility of reads.It is also known as mirroring.
Sharding is used to splitting the data up by key and it also increases performance by reducing memory load on any one resource.It is also known as partitioning.

List out the operation keys of Redis?

  • TYPE key
  • TTL key
  • KEYS pattern
  • EXPIRE key seconds
  • EXISTS key
  • DEL key

What is the difference between Redis and RocksDB?

Redis is efficientbut non scable.
Redis is all in -memory.
RocksDB supports multi -threading library.
RocksDB is in-memory but also uses flash storage.


How to empty a redis database?

FLUSHDB - clears active database
FLUSHALL - clears existing databases


How to set value in Redis?

$redis->set("name", "Set string");


What are the limitations of Redis?

Space is limited
Single threaded
Limited client support for consistent hashing
Significant overhead for persistence
Not deployed widely