22. Message Queues
Interview questions
Interview questions (with the counter-questions you'll get)
Q1. Why would you put a message queue between two services?
They're testing: the core motivation.
Think about your answer first, then open it.
Q2. Explain at-most-once, at-least-once and exactly-once delivery.
They're testing: the classic guarantee question.
Think about your answer first, then open it.
Q3. How do you make a consumer idempotent?
They're testing: practical correctness.
Think about your answer first, then open it.
Q4. What is a visibility timeout, and how do you choose it?
They're testing: broker mechanics.
Think about your answer first, then open it.
Q5. What is a dead-letter queue, and what do you do with it?
They're testing: operational maturity.
Think about your answer first, then open it.
Q6. How do you guarantee message ordering?
They're testing: ordering vs parallelism.
Think about your answer first, then open it.
Q7. Kafka vs RabbitMQ (or SQS): when do you use which?
They're testing: tool judgement.
Think about your answer first, then open it.
Q8. Your queue keeps growing. What do you do?
They're testing: backpressure and scaling.
Think about your answer first, then open it.
Q9. How would you schedule "cancel the order if unpaid after 15 minutes"?
They're testing: delayed jobs.
Think about your answer first, then open it.
Q10. How do you publish a message reliably when you also update the database?
They're testing: the dual-write problem.
Think about your answer first, then open it.