Redis Interview Keypoints
Architecture & Execution
✅ 1. Redis executes commands in a single thread “Redis uses an event loop to process all client requests sequentially, ensuring atomicity without locks.”
✅ 2. Redis uses non‑blocking I/O multiplexing “Redis leverages epoll/kqueue/select to handle thousands of concurrent connections efficiently.”
✅ 3. Redis guarantees atomic operations “Because commands are executed sequentially, Redis ensures atomicity without explicit transactions.”
✅ 4. Redis supports multiple data structures “Strings, lists, sets, sorted sets, hashes, streams, bitmaps, and hyperloglogs are natively supported.”
✅ 5. Redis optimizes small collections with encodings “Structures like lists and hashes use ziplist/intset encodings to save memory.”
✅ 6. Redis supports pub/sub messaging “Clients can publish and subscribe to channels for real‑time message distribution.”
✅ 7. Redis supports Lua scripting “Lua scripts run atomically inside Redis, enabling complex operations without race conditions.”
✅ 8. Redis supports transactions with MULTI/EXEC “Commands queued in MULTI are executed atomically when EXEC is called.”
✅ 9. Redis supports pipelines “Clients can batch multiple commands to reduce round‑trip latency.”
✅ 10. Redis supports streams for event data “Streams provide append‑only log structures with consumer groups for processing.”
Persistence
✅ 11. Redis supports RDB snapshots “RDB creates point‑in‑time dumps of the dataset into dump.rdb.”
✅ 12. Redis supports AOF logging “AOF logs every write operation into appendonly.aof for durability.”
✅ 13. Redis supports hybrid persistence “RDB + AOF can be enabled together for balance between speed and durability.”
✅ 14. Redis forks child processes for persistence “On BGSAVE or BGREWRITEAOF, Redis forks a child to handle disk writes.”
✅ 15. Redis supports configurable snapshot intervals “save 900 1 means snapshot every 900 seconds if at least 1 key changed.”
✅ 16. Redis supports appendfsync policies “Options are always, everysec, or no, balancing durability vs performance.”
✅ 17. Redis supports AOF rewrite “BGREWRITEAOF compacts the log by rewriting it in the background.”
✅ 18. Redis supports truncated AOF recovery “aof-load-truncated yes allows Redis to start even if AOF is incomplete.”
✅ 19. Redis supports stop‑writes on persistence error “stop-writes-on-bgsave-error yes prevents data loss if snapshotting fails.”
✅ 20. Redis persistence files are stored in dir “Both RDB and AOF files are written to the configured data directory.”
Replication
✅ 21. Redis supports master‑replica replication “Replicas asynchronously copy data from the master.”
✅ 22. Redis supports partial resynchronization “Replicas can catch up using replication backlog without full resync.”
✅ 23. Redis supports replica promotion “SLAVEOF NO ONE promotes a replica to master.”
✅ 24. Redis supports replica authentication “masterauth config ensures replicas authenticate to the master.”
✅ 25. Redis supports min‑replicas‑to‑write “Writes only succeed if enough replicas acknowledge them.”
✅ 26. Redis supports min‑replicas‑max‑lag “Defines maximum lag allowed before writes are stopped.”
✅ 27. Redis supports diskless replication “repl-diskless-sync yes streams data directly without temporary files.”
✅ 28. Redis supports replication backlog buffer “Backlog stores recent writes for replicas to catch up after disconnects.”
✅ 29. Redis supports chained replication “Replicas can replicate from other replicas, not just the master.”
✅ 30. Redis supports replica read‑only mode “By default, replicas serve read queries but reject writes.”
High Availability (Sentinel & Cluster)
✅ 31. Redis Sentinel monitors masters “Sentinel detects failures and promotes replicas automatically.”
✅ 32. Redis Sentinel reconfigures clients “Clients are updated with new master info after failover.”
✅ 33. Redis Sentinel supports quorum “Failover requires majority agreement among Sentinels.”
✅ 34. Redis Cluster shards data “Cluster divides 16,384 hash slots across masters.”
✅ 35. Redis Cluster supports replicas per master “Each master has replicas for redundancy.”
✅ 36. Redis Cluster supports automatic rebalancing “Slots can be migrated between nodes to balance load.”
✅ 37. Redis Cluster supports resharding “Keys can be moved between slots during scaling.”
✅ 38. Redis Cluster supports gossip protocol “Nodes exchange state info via gossip messages.”
✅ 39. Redis Cluster supports failover “Replicas are promoted if a master fails.”
✅ 40. Redis Cluster requires full slot coverage “By default, cluster stops serving if slots are missing.”
Memory Management
✅ 25. Redis supports min‑replicas‑to‑write “Writes only succeed if enough replicas acknowledge them.”
✅ 26. Redis supports min‑replicas‑max‑lag “Defines maximum lag allowed before writes are stopped.”
✅ 27. Redis supports diskless replication “repl-diskless-sync yes streams data directly without temporary files.”
✅ 28. Redis supports replication backlog buffer “Backlog stores recent writes for replicas to catch up after disconnects.”
✅ 29. Redis supports chained replication “Replicas can replicate from other replicas, not just the master.”
✅ 30. Redis supports replica read‑only mode “By default, replicas serve read queries but reject writes.”
High Availability (Sentinel & Cluster)
✅ 31. Redis Sentinel monitors masters “Sentinel detects failures and promotes replicas automatically.”
✅ 32. Redis Sentinel reconfigures clients “Clients are updated with new master info after failover.”
✅ 33. Redis Sentinel supports quorum “Failover requires majority agreement among Sentinels.”
✅ 34. Redis Cluster shards data “Cluster divides 16,384 hash slots across masters.”
✅ 35. Redis Cluster supports replicas per master “Each master has replicas for redundancy.”
✅ 36. Redis Cluster supports automatic rebalancing “Slots can be migrated between nodes to balance load.”
✅ 37. Redis Cluster supports resharding “Keys can be moved between slots during scaling.”
✅ 38. Redis Cluster supports gossip protocol “Nodes exchange state info via gossip messages.”
✅ 39. Redis Cluster supports failover “Replicas are promoted if a master fails.”
✅ 40. Redis Cluster requires full slot coverage “By default, cluster stops serving if slots are missing.”
Memory Management
✅ 41. Redis enforces maxmemory limits “maxmemory sets a hard RAM cap for the dataset.”
✅ 42. Redis supports eviction policies “Options include allkeys-lru, volatile-ttl, and noeviction.”
✅ 43. Redis supports maxmemory‑samples “Defines how many keys are sampled for eviction decisions.”
✅ 44. Redis supports memory fragmentation monitoring “INFO memory shows fragmentation ratio for tuning.”
✅ 45. Redis supports lazy freeing “lazyfree-lazy-eviction frees memory asynchronously.”
✅ 46. Redis supports memory allocator tuning “Redis can use jemalloc or libc malloc for memory management.”
✅ 47. Redis supports memory usage command “MEMORY USAGE key shows memory consumed by a key.”
✅ 48. Redis supports memory stats “MEMORY STATS provides allocator and fragmentation details.”
✅ 49. Redis supports memory doctor “MEMORY DOCTOR suggests fixes for memory fragmentation.”
✅ 50. Redis supports eviction notifications “Clients can subscribe to keyspace events for evictions.”
Performance & Monitoring
✅ 51. Redis supports INFO command “Provides runtime stats: memory, clients, persistence, replication, CPU, keyspace.”
✅ 52. Redis supports SLOWLOG “Captures queries slower than threshold for tuning.”
✅ 53. Redis supports latency monitor “Tracks operations exceeding configured latency thresholds.”
✅ 54. Redis supports MONITOR command “Streams all commands in real time for debugging.”
✅ 55. Redis supports CLIENT LIST “Shows connected clients with IP, state, and flags.”
✅ 56. Redis supports CLIENT KILL “Terminates misbehaving or unauthorized client connections.”
✅ 57. Redis supports CONFIG GET/SET “Allows runtime inspection and modification of config parameters.”
✅ 58. Redis supports DEBUG commands “DEBUG SEGFAULT or OBJECT commands help diagnose issues.”
✅ 59. Redis supports command stats “INFO commandstats shows per‑command call counts and latencies.”
✅ 60. Redis supports keyspace stats “INFO keyspace shows keys per DB and TTL distribution.”
Security
✅ 61. Redis supports requirepass “Enforces password authentication for clients.”
✅ 62. Redis supports ACLs (Redis 6+) “ACLs define users, commands, and key patterns allowed.”
✅ 63. Redis supports ACL WHOAMI “Shows which user is currently authenticated.”
✅ 64. Redis supports ACL LIST “Lists all ACL rules configured.”
✅ 65. Redis supports rename‑command “Disables or renames dangerous commands like FLUSHALL.”
✅ 46. Redis supports memory allocator tuning “Redis can use jemalloc or libc malloc for memory management.”
✅ 47. Redis supports memory usage command “MEMORY USAGE key shows memory consumed by a key.”
✅ 48. Redis supports memory stats “MEMORY STATS provides allocator and fragmentation details.”
✅ 49. Redis supports memory doctor “MEMORY DOCTOR suggests fixes for memory fragmentation.”
✅ 50. Redis supports eviction notifications “Clients can subscribe to keyspace events for evictions.”
Performance & Monitoring
✅ 51. Redis supports INFO command “Provides runtime stats: memory, clients, persistence, replication, CPU, keyspace.”
✅ 52. Redis supports SLOWLOG “Captures queries slower than threshold for tuning.”
✅ 53. Redis supports latency monitor “Tracks operations exceeding configured latency thresholds.”
✅ 54. Redis supports MONITOR command “Streams all commands in real time for debugging.”
✅ 55. Redis supports CLIENT LIST “Shows connected clients with IP, state, and flags.”
✅ 56. Redis supports CLIENT KILL “Terminates misbehaving or unauthorized client connections.”
✅ 57. Redis supports CONFIG GET/SET “Allows runtime inspection and modification of config parameters.”
✅ 58. Redis supports DEBUG commands “DEBUG SEGFAULT or OBJECT commands help diagnose issues.”
✅ 59. Redis supports command stats “INFO commandstats shows per‑command call counts and latencies.”
✅ 60. Redis supports keyspace stats “INFO keyspace shows keys per DB and TTL distribution.”
Security
✅ 61. Redis supports requirepass “Enforces password authentication for clients.”
✅ 62. Redis supports ACLs (Redis 6+) “ACLs define users, commands, and key patterns allowed.”
✅ 63. Redis supports ACL WHOAMI “Shows which user is currently authenticated.”
✅ 64. Redis supports ACL LIST “Lists all ACL rules configured.”
✅ 65. Redis supports rename‑command “Disables or renames dangerous commands like FLUSHALL.”
✅ 66. Redis supports protected‑mode “Enabled by default, prevents unsafe external access.”
✅ 67. Redis supports TLS encryption “Redis can encrypt client‑server traffic with TLS.”
✅ 68. Redis supports firewall binding “bind restricts Redis to specific IP addresses.”
✅ 69. Redis supports port configuration “Default port is 6379, configurable via port.”
✅ 70. Redis supports AUTH command “Clients authenticate with password or ACL user credentials.”
Advanced Features
✅ 71. Redis supports modules “Modules extend Redis with custom data types and commands.”
✅ 72. Redis supports GEO commands “Stores and queries geospatial data using sorted sets.”
✅ 73. Redis supports BIT operations “Bitmaps allow efficient storage and manipulation of binary data.”
✅ 74. Redis supports HyperLogLog “Provides approximate cardinality estimation with low memory usage.”
✅ 75. Redis supports Bloom filters via modules “Modules like RedisBloom add probabilistic data structures.”
✅ 76. Redis supports JSON via modules “RedisJSON allows storing and querying JSON documents.”
✅ 77. Redis supports graph data via modules “RedisGraph enables graph queries using Cypher syntax.”
✅ 78. Redis supports time series via modules “RedisTimeSeries provides efficient time series storage and queries.”
✅ 79. Redis supports search via modules “RediSearch adds full‑text search and secondary indexing.”
✅ 80. Redis supports AI inference via modules “RedisAI integrates ML models for in‑database inference.”
Operational Practices
✅ 81. Redis supports online configuration changes “CONFIG SET allows parameters to be updated at runtime without restarting the server.”
✅ 82. Redis supports runtime inspection of configs “CONFIG GET retrieves current configuration values for verification.”
✅ 83. Redis supports persistence checks “INFO persistence shows last save time, AOF status, and background save progress.”
✅ 84. Redis supports backup via file copy “Copying dump.rdb or appendonly.aof provides a consistent backup snapshot.”
✅ 85. Redis supports restore by file placement “Placing RDB/AOF files back in the data directory restores the dataset on restart.”
✅ 86. Redis supports keyspace notifications “Clients can subscribe to events like set, expire, or evict for monitoring.”
✅ 87. Redis supports database selection “SELECT <db> switches between logical databases (default is DB 0).”
✅ 88. Redis supports flushing databases “FLUSHDB clears one DB, FLUSHALL clears all DBs — dangerous in production.”
✅ 89. Redis supports migration commands “MIGRATE moves keys between instances atomically with copy or replace options.”
✅ 90. Redis supports renaming keys “RENAME changes a key’s name; RENAMENX only if new name doesn’t exist.”
Advanced Administration
✅ 91. Redis supports cluster resharding tools “redis-cli --cluster reshard moves slots between nodes during scaling.”
✅ 92. Redis supports cluster health checks “redis-cli --cluster check validates slot coverage and node states.”
✅ 93. Redis supports sentinel failover testing “SENTINEL failover <master> forces a manual failover for testing.”
✅ 94. Redis supports sentinel monitoring commands “SENTINEL masters and SENTINEL slaves list monitored nodes.”
✅ 95. Redis supports client pause “CLIENT PAUSE temporarily blocks clients for controlled failover or maintenance.”
✅ 96. Redis supports command renaming for safety “Critical commands can be renamed or disabled to prevent accidental misuse.”
✅ 97. Redis supports eviction statistics “INFO stats shows key eviction counts for monitoring memory pressure.”
✅ 98. Redis supports key expiration checks “TTL key shows remaining time before a key expires.”
✅ 99. Redis supports cluster slot mapping “CLUSTER KEYSLOT key shows which slot a key belongs to.”
✅ 100. Redis supports cluster key migration “CLUSTER GETKEYSINSLOT retrieves keys in a specific slot for migration.”
✅ 71. Redis supports modules “Modules extend Redis with custom data types and commands.”
✅ 72. Redis supports GEO commands “Stores and queries geospatial data using sorted sets.”
✅ 73. Redis supports BIT operations “Bitmaps allow efficient storage and manipulation of binary data.”
✅ 74. Redis supports HyperLogLog “Provides approximate cardinality estimation with low memory usage.”
✅ 75. Redis supports Bloom filters via modules “Modules like RedisBloom add probabilistic data structures.”
✅ 76. Redis supports JSON via modules “RedisJSON allows storing and querying JSON documents.”
✅ 77. Redis supports graph data via modules “RedisGraph enables graph queries using Cypher syntax.”
✅ 78. Redis supports time series via modules “RedisTimeSeries provides efficient time series storage and queries.”
✅ 79. Redis supports search via modules “RediSearch adds full‑text search and secondary indexing.”
✅ 80. Redis supports AI inference via modules “RedisAI integrates ML models for in‑database inference.”
Operational Practices
✅ 81. Redis supports online configuration changes “CONFIG SET allows parameters to be updated at runtime without restarting the server.”
✅ 82. Redis supports runtime inspection of configs “CONFIG GET retrieves current configuration values for verification.”
✅ 83. Redis supports persistence checks “INFO persistence shows last save time, AOF status, and background save progress.”
✅ 84. Redis supports backup via file copy “Copying dump.rdb or appendonly.aof provides a consistent backup snapshot.”
✅ 85. Redis supports restore by file placement “Placing RDB/AOF files back in the data directory restores the dataset on restart.”
✅ 86. Redis supports keyspace notifications “Clients can subscribe to events like set, expire, or evict for monitoring.”
✅ 87. Redis supports database selection “SELECT <db> switches between logical databases (default is DB 0).”
✅ 88. Redis supports flushing databases “FLUSHDB clears one DB, FLUSHALL clears all DBs — dangerous in production.”
✅ 89. Redis supports migration commands “MIGRATE moves keys between instances atomically with copy or replace options.”
✅ 90. Redis supports renaming keys “RENAME changes a key’s name; RENAMENX only if new name doesn’t exist.”
Advanced Administration
✅ 91. Redis supports cluster resharding tools “redis-cli --cluster reshard moves slots between nodes during scaling.”
✅ 92. Redis supports cluster health checks “redis-cli --cluster check validates slot coverage and node states.”
✅ 93. Redis supports sentinel failover testing “SENTINEL failover <master> forces a manual failover for testing.”
✅ 94. Redis supports sentinel monitoring commands “SENTINEL masters and SENTINEL slaves list monitored nodes.”
✅ 95. Redis supports client pause “CLIENT PAUSE temporarily blocks clients for controlled failover or maintenance.”
✅ 96. Redis supports command renaming for safety “Critical commands can be renamed or disabled to prevent accidental misuse.”
✅ 97. Redis supports eviction statistics “INFO stats shows key eviction counts for monitoring memory pressure.”
✅ 98. Redis supports key expiration checks “TTL key shows remaining time before a key expires.”
✅ 99. Redis supports cluster slot mapping “CLUSTER KEYSLOT key shows which slot a key belongs to.”
✅ 100. Redis supports cluster key migration “CLUSTER GETKEYSINSLOT retrieves keys in a specific slot for migration.”