Redis Coding Interview Questions
25 Redis coding interview problems with full optimal solutions — 8 easy, 12 medium, 5 hard. Every problem ships with multiple approaches (brute-force first, then the optimal), complexity tables for each, company-specific tips on what an Redis interviewer values, and a FAQ section.
Showing 5 problems of 25
- #15hardfoundational
15. LFU Cache
Implement a Least-Frequently-Used cache with O(1) get and put; Redis loves it because LFU eviction (allkeys-lfu) is one of its native maxmemory policies.
- #22hardfoundational
22. Find Median from Data Stream
Maintain a running median over a stream of numbers; Redis interviewers love it because two-heap balancing mirrors how Redis Streams hold per-consumer-group offsets.
- #23hardfoundational
23. Sliding Window Maximum
Find the max of every window of size k as it slides across an array; Redis uses it to probe deque/monotonic intuition that mirrors LPUSH/RPOP patterns on Redis Lists.
- #24hardfoundational
24. All O`one Data Structure
Design a data structure supporting inc, dec, getMaxKey and getMinKey all in O(1); Redis loves this because it is the exact LFU-counter primitive used internally for eviction sampling.
- #25hardfoundational
25. Design Skiplist
Implement a probabilistic skiplist supporting search, add and erase in O(log n) average; Redis loves it because the skiplist is the storage layer behind every ZSET in the engine.