Scrivio Interview library
LeadershipPrincipal6 min read · updated 12 November 2026

Your company sends 50 million transactional emails a month from many Java applications using their own SMTP code. Would you keep this, build a central email service, or buy a provider? How do you decide?

I would not keep per-application SMTP code, because good delivery depends on sender reputation, SPF, DKIM and DMARC, bounce and complaint handling and compliance, which individual apps rarely do well. I would build a central notification service that owns templates, consent, suppression lists, audit and rate limits, and buy a provider for the actual delivery, keeping templates and consent data in our own service so we can switch providers. Data protection and provider location are part of the choice, and apps move gradually behind an internal API while we measure delivery and complaint rates.

Why this question is asked

Fifty million emails a month is about 1.7 million a day, or around 20 per second on average with peaks several times higher. At that volume, email is no longer a feature each team adds; it is infrastructure whose failures are expensive, such as password resets landing in spam or a whole domain being blocked by a large mailbox provider. Interviewers ask this to see whether we can weigh build against buy, think about compliance, and plan a migration across many teams. In this answer, we will see what delivering email well actually involves, compare the three options, design the central service, cover data protection and plan the migration with the right measurements.

1What Delivering Email Well Involves

Sending an email is easy; getting it into the inbox is the hard part. Mailbox providers such as Gmail and Outlook decide whether to accept a message based on the sender's reputation, built from the sending IP addresses and domain over time. They check authentication: SPF (Sender Policy Framework) lists which servers may send for our domain, DKIM (DomainKeys Identified Mail) signs each message with a key published in DNS, and DMARC tells receivers what to do when those checks fail and sends us reports. Large providers now require all three for bulk senders, along with low spam complaint rates.

Then there is the feedback. Hard bounces, such as an address that does not exist, must stop future sends to that address, and spam complaints must too. If 40 applications each send with their own SMTP code, each one handles this differently or not at all, so one careless application can damage the reputation of the shared domain and push every team's password resets into spam.

2Comparing the Three Options

Keeping the current setup costs nothing up front, but it spreads the problem across many teams and leaves no single place for consent, suppression or audit. Building a central service with our own SMTP infrastructure gives full control, but running high-volume mail servers means managing IP warm-up, reputation monitoring, feedback loops with providers and on-call for a system that is not our business. Buying a provider for delivery hands those problems to a company that does it at large scale.

For most companies, the best answer combines two of these: a central service that we build and own, and a delivery provider behind it. The reason is that the parts that make us unique, our templates, our consent rules and our audit, stay with us, while the commodity part, putting bytes on the wire with a good reputation, is bought.

Options for 50 million emails a month
OptionGainsCosts and risks
Keep per-app SMTP codeNo project neededInconsistent auth, bounces, consent; shared reputation risk
Central service, own SMTP serversFull controlIP warm-up, reputation work, on-call for mail infra
Central service, bought providerExpert delivery, our own dataProvider fees, integration, contract and data review
Apps call a provider directlyQuick to startLock-in spread over every app, no central policy

3Designing the Central Notification Service

Applications call one internal API, for example POST /notifications with a template id, a recipient id and the data for the template. The service checks consent and the suppression list, renders the template, applies rate limits per application and per recipient, records an audit entry and puts the message on a queue. Workers take messages from the queue and hand them to the provider's API. The provider sends webhooks back for deliveries, bounces and complaints, and the service updates the suppression list and the message status.

Notice that applications never talk to the provider. That keeps the provider replaceable: if prices rise or delivery degrades, we change the worker, not 40 applications. It also lets us run two providers, routing a share of traffic to a second one as a fallback.

Step throughSending one transactional email
ApplicationNotification serviceQueueProvider
POST /notifications {template, recipient, data}
check consent and suppression, render, audit
enqueue rendered message
202 Accepted with message id
worker sends through provider API
webhook: delivered, bounced or complained
update status and suppression list

7 messages in order. Play them, or step through them one at a time.

4Data Protection and Provider Location

Transactional emails contain personal data: names, addresses, order contents, sometimes account details. Sending them through a provider makes the provider a data processor, so we need a data processing agreement, a clear view of where the provider stores and processes data, and retention limits for message logs. For customers in the EU, provider regions and transfer rules matter, and the legal team should review them.

We also reduce what we send. An email that says "your statement is ready, sign in to view it" is safer than one that contains the statement. And we decide what the central service itself keeps, because its audit log is now a large store of personal data that needs access controls and deletion rules.

5Migrating Gradually and Measuring

We set up the domain authentication first, then move applications one at a time, starting with a high-volume, low-risk sender so the provider's reputation for our domain builds gradually. Each application replaces its SMTP code with a call to the internal API, often through a small client library we publish.

We measure delivery rate, hard bounce rate, spam complaint rate (large mailbox providers expect it to stay well below 0.3 percent), time from request to delivery, and the share of mail sent through the new service. We compare each application's numbers before and after its move, which shows leadership that the change improved inbox placement, not just that it moved code.

6Follow-up questions

Why not let each application call the provider directly?

It is faster at first, but it spreads provider lock-in across every application, and consent, suppression, audit and rate limiting would still be implemented differently in each one. The internal API is what makes the provider replaceable and the policies consistent.

Should transactional and marketing email share the same setup?

They should share the platform but not the reputation. We usually send them from different subdomains, and sometimes different IP pools, so a marketing campaign with high complaints cannot hurt the delivery of password resets and receipts.

How do you handle a provider outage?

Messages wait in our queue with retries and backoff, so nothing is lost. For critical mail such as password resets, we can configure a second provider and fail over when the first one's error rate crosses a threshold.

7Conclusion

In this answer, we saw that at 50 million emails a month, delivery depends on reputation, SPF, DKIM, DMARC, bounce and complaint handling and compliance, which scattered SMTP code handles poorly. A central notification service that owns templates, consent, suppression, audit and rate limits, with a bought provider for delivery, gives expertise without lock-in. We review data protection and provider location, move applications gradually behind the internal API, and measure delivery and complaint rates before and after each move.

What to say in the interviewAbout 80 seconds aloud

Open with

I would not keep the current setup. Fifty million emails a month is about twenty per second on average, and at that scale delivery quality depends on things individual applications rarely get right: the domain's reputation, SPF, DKIM and DMARC, processing bounces and complaints, and compliance with consent and unsubscribe rules.

Then, if they want more

One careless application can hurt the shared domain and push everyone's password resets into spam. So I would build a central notification service that applications call through one internal API. It would own templates, consent checks, the suppression list, audit, and rate limits per application.

For the actual delivery, I would buy a provider rather than run our own high-volume SMTP servers, because IP warm-up and reputation management are specialised work that is not our business.

To avoid lock-in, our templates, consent data and suppression lists stay in our service, and only a worker talks to the provider, so we could switch or add a second provider. I would review data protection with legal: a processing agreement, where the provider stores data, log retention, and keeping sensitive content out of emails.

Then I would migrate applications one by one, starting with a high-volume, low-risk sender, and track delivery rate, bounces, complaint rate and latency before and after each move.

About this answer

Last updated
12 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Official documentation
Jakarta EE specifications
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Your company sends 50 million transactional emails a month from many Java applications...": https://scrivio-interview-library.netlify.app/java/jakarta-ee-platform/001cdbed51/