advancedTop 30 Scenario-Based Questions
How would you implement pub/sub with Redis for real-time notifications?
Redis Pub/Sub for real-time: 1) Publisher (when order status changes): PUBLISH order-updates '{orderId:1001, status:SHIPPED, userId:42}'. 2) Subscriber (notification service): SUBSCRIBE order-updates (receives all messages on channel). 3) Pattern subscribe: PSUBSCRIBE order-* (all order channels). 4) Spring Boot: @Bean RedisMessageListenerContainer + MessageListenerAdapter. @Component with handleM
Ready to master this question?
Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.
Sign in to generate a response