Top 25 Redis Interview Questions for Experienced Developers
Top 25 Redis Interview Questions for Experienced Developers Work through these 15 questions out loud. Open any question for the full model answer, the trap to avoid, and the follow-up a panel usually asks.
You deployed a new version but users still hit the old behavior. Why?
Check K8s rollout status — old ReplicaSet still receiving traffic. Bust cache on static assets; API GET with `Cache-Control`. Confirm image tag in running pod matches CI build....
How do you implement rate limiting for APIs?
Apply at API Gateway; in-app use Redis-backed limiter for cluster-wide counts. ```java @RateLimiter(name = "apiLimiter") @GetMapping("/users") public List<User> users() {...
API returns correct data but response time is inconsistent. Why?
Tail latency often from stop-the-world GC, connection pool contention, or cold cache. Monitor p99 separately from mean. ```yaml spring.datasource.hikari.maximum-pool-size: 10...
You enabled caching but performance did not improve. Why?
Measure hits/misses. Wrong key expression caches per wrong granularity. ```java @Cacheable(value = "users", key = "#id") public User findById(Long id) { return...
Autoscaling enabled but error rate increases. Why?
New pods accept traffic before JVM/Caffeine warm. HPA adds API pods but Postgres max connections fixed. ```yaml readinessProbe: initialDelaySeconds: 30 ``` Scale connection...
What is the difference between ArrayList and LinkedList?
ArrayList: dynamic array, great for get(i) and iteration, amortized append. LinkedList: node chain, costly random access, only wins for frequent insert/remove in middle with...
What is Spring Boot Docker Compose dev services support?
Add compose.yaml with postgres and redis services. Include spring-boot-docker-compose on runtimeOnly. Boot starts Postgres, sets JDBC URL — zero local install. CI uses...
How would you design a rate-limited REST API?
API gateway or filter applies token bucket per API key — Redis stores tokens with TTL. Exceeding limit returns 429 + Retry-After. Different tiers per plan. Log rejections for...
What is Hibernate second-level cache and when enable it?
Enable for ProductCategory, Currency — READ_ONLY, rarely changed. spring.jpa.properties.hibernate.cache.use_second_level_cache=true with Caffeine region factory. Avoid on...
What are idempotency keys and how implement them in REST APIs?
Client sends Idempotency-Key: uuid on POST /payments. Server Redis SETNX key, process, store response JSON. Retry with same key returns 201 + original body without double...
Your application memory usage keeps increasing over time. What do you suspect?
Suspect memory leak if heap used grows after GC without traffic drop. Capture heap dump on OOM (`-XX:+HeapDumpOnOutOfMemoryError`), compare dominator tree. Common in Spring:...
What is an ExecutorService and why use it?
Instead of new Thread per task, submit Runnable to fixed pool sized to CPU/IO profile. Handle Future results and exceptions. On shutdown hook call shutdown() and...
What are weak references and WeakHashMap use cases?
Attach metadata to objects without extending their lifetime — canonical mapping while object lives. When key GCs, entry drops. Do not rely on timing. For API response caching...
Redis caching patterns: cache-aside vs write-through?
@Cacheable("users") on findById — Redis cache-aside via Spring Data Redis. Update user: @CacheEvict. TTL 15m + jitter. Hot product page: lock on miss with Redisson. Do not...
Your Spring Boot app works locally but fails after deployment. What are the first 3 things you check?
First: confirm `spring.profiles.active` and required env vars exist in prod (`kubectl describe pod`, deployment manifest). Second: read startup logs and `/actuator/health` —...
Redis Interview Questions and Answers · Top 50 Redis Interview Questions and Answers (2026 Edition) · Top 40 Redis Interview Questions | Must-Prepare before interview. · Redis Interview Questions Every Fresher Must Know
All interview question lists · Interview guides · Home · Support the platform