Backend developer interview question · 3–5 years
Your queue delivers at least once. What does that force on every consumer?
The strongest answer
Idempotency: each message carries a key and the consumer records what it has processed, so a redelivery after a crash or a slow ack is a no-op; you design the side effects to tolerate repeats rather than hoping for exactly-once
Why it works
Right. Repeats are certain; make them harmless.
What a good answer covers
- At-least-once means duplicates.
- Consumer keeps processed keys.
- Side effects tolerate repeats.
- Do not rely on exactly-once.
Answers that fall short
- Close, but not the strongest: Nothing, if you ack quickly
A crash between work and ack redelivers. - Weak: Switching to a queue that promises exactly-once
Exactly-once across systems is a promise nobody keeps end to end. - Red flag: Deduplicating in the producer
The producer cannot see the consumer's crashes.
Who gets asked this
- Backend developer
- Full-stack developer
- DevOps / SRE / cloud
- Data engineer
- Data science / ML / AI
- Engineering manager / tech lead
- Solutions / cloud architect
- AI engineer
More Backend developer questions
- A Spring service bean keeps the current user in a field so its helper methods can read it. Under load, users…
- You are designing a Python service that fans out to many slow downstreams. What shapes the design?
- Your service calls three internal APIs and one is intermittently slow. What do you build in?
- You are asked to make a payments service active in two regions. What is the first design question?
- Product wants dashboards over the transactional database. When do you say no and build a separate analytical…
- Design multi-tenancy for a product where some tenants are regulated.
- One endpoint renders PDFs and pegs a core for about two seconds. It is stalling an otherwise healthy Node…
- Your worker cannot keep up with the producer and memory climbs. What is the right answer?