Cracking the Redis Interview: Tips and Must-Know Questions

Cracking the Redis Interview: Tips and Must-Know Questions Work through these 12 questions out loud. Open any question for the full model answer, the trap to avoid, and the follow-up a panel usually asks.

  1. 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` —...

    Full answer

  2. 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....

    Full answer

  3. 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() {...

    Full answer

  4. 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...

    Full answer

  5. 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...

    Full answer

  6. 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...

    Full answer

  7. 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...

    Full answer

  8. 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...

    Full answer

  9. 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:...

    Full answer

  10. 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...

    Full answer

  11. 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...

    Full answer

  12. 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...

    Full answer

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