D
DevPrepSystematic Prep
DEVPREP CODEX · #21

Redis Interview Questions

45 curated questions graded from Foundations (Easy) to Practical Patterns (Medium) and Internals & Architecture (Hard).

TOTAL QUESTIONS

45

THEORY QUESTIONS

45

IMPLEMENTATION FOLIOS

0

FREE QUESTIONS

5 / Level

Easy Level·15 Questions Total

Foundations & Core Concepts

Open Full Easy List
Q1What is Redis and what is it used for?
  • In-memory data structure store (key-value with rich types) usable as cache, message broker, and lightweight database.
  • Common uses: caching, sessions, rate limiting, leaderboards, queues, pub/sub, distributed locks.
  • Single-threaded command execution (mostly) → atomic per-command, predictable latency; persistence optional (RDB/AOF).

Q2What data types does Redis provide?
  • STRING (counters, tokens), LIST (queues via LPUSH/BRPOP), SET (unique members, set ops), HASH (objects), ZSET (sorted sets — leaderboards/ranges).
  • Plus specialized: Streams (event logs/consumer groups), Bitmaps (presence flags), HyperLogLog (cardinality estimates), Geospatial. Choosing the right type unlocks atomic server-side operations instead of client-side read-modify-write.

Q3What is TTL / key expiration?
  • EXPIRE key seconds or SET with EX option; TTL auto-deletes keys — the backbone of caching semantics.
  • TTL returns remaining seconds (-1 no expiry, -2 missing); PERSIST removes expiry.
  • Expiration is lazy (checked on access) + active sampling cycle — expired-but-uncached keys may linger briefly in memory.

Q4What is the difference between RDB and AOF persistence?
  • RDB: point-in-time binary snapshots on interval — compact, fast restarts, risk of losing recent writes.
  • AOF: append-only log of every write — configurable fsync policy (always/everysec/no), better durability, larger files + rewrite compaction.
  • Hybrid (aof-use-rdb-preamble default modern): fast load + durability. Choose per loss-tolerance budget.

Q5What is a cache hit/miss and how do you compute ratio?
  • Hit = served from redis; miss = fell through to origin DB.
  • Ratio = hits/(hits+misses) via INFO stats keyspace metrics.
  • Low ratios signal wrong TTLs, poor key design, or genuinely uncachable data — investigate before scaling hardware.

10 More Easy Questions Locked

Unlock the complete Redis Easy question bank

Get instant access to all 15 questions, in-depth model answers, code sandboxes, and all 27+ technologies for a single one-time payment.

Unlock All — One-time payment · Lifetime access
DEDICATED LEVEL PAGES

Browse All Redis Questions by Difficulty

INTERNAL LINKING & DEPENDENCIES

Related Technologies to Redis

CAREER PATHWAYS

Redis is a key requirement for these engineering roles:

Redis Interview Questions — Easy, Medium & Hard | DevPrep | DevPrep