Engineering Decisions · Junior · Question 10 of 12
Sign-up sends a welcome email through a provider that sometimes takes 10 seconds. Sign-up itself must stay fast, and the email may arrive a minute later. What do you do?
- 1Send it from the browser after sign-up succeeds
- 2Put the email on a queue for a background worker
- 3Send it inside the request and await the provider
Show the answer
Correct answer: Put the email on a queue for a background worker
Explanation
A queue returns the response at once, and a worker can retry if the provider fails, which suits a delay of a minute. Sending inside the request fits rare actions where the user must see the result of delivery, but here it ties sign-up speed to the provider. Sending from the browser exposes credentials and is lost if the tab closes, so it only fits a public, keyless client API.