23. Pub/Sub and Fan-Out
Interview questions
Interview questions (with the counter-questions you'll get)
Q1. What's the difference between a message queue and pub/sub?
They're testing: the basic distinction.
Think about your answer first, then open it.
Q2. Design a news feed: fan-out on write or on read?
They're testing: the classic trade-off.
Think about your answer first, then open it.
Q3. What is the celebrity (hot key) problem in fan-out?
They're testing: awareness of skew.
Think about your answer first, then open it.
Q4. What is a consumer group?
They're testing: Kafka-style consumption.
Think about your answer first, then open it.
Q5. What is event-driven architecture, and what are its downsides?
They're testing: architectural judgement.
Think about your answer first, then open it.
Q6. Explain the transactional outbox pattern.
They're testing: reliable publishing.
Think about your answer first, then open it.
Q7. How do subscribers handle duplicate and out-of-order events?
They're testing: correctness under at-least-once.
Think about your answer first, then open it.
Q8. How do you change an event's schema without breaking subscribers?
They're testing: evolution in practice.
Think about your answer first, then open it.
Q9. A new analytics service needs all past orders as events. How?
They're testing: replay and backfill.
Think about your answer first, then open it.
Q10. Twitter-style timelines at scale: walk me through posting and reading.
They're testing: putting it together.
Think about your answer first, then open it.