Katkat

Design a Global Marketing Email Platform

StubHubSoftware Engineer · Onsite

Last updated

This problem tests your ability to design a high-throughput, fault-tolerant email delivery system that handles scheduling across time zones, manages email templates, and provides basic analytics.

Scenario

Design a global marketing email platform for a large-scale ticket marketplace. The platform must be capable of sending millions of emails daily, ensuring that users receive promotional content at an appropriate local time, supporting A/B testing for email subjects/templates, and tracking basic metrics (opens and clicks).

Requirements

Functional

  1. Schedule emails to be sent at specific local times for users in different time zones.
  2. Support dynamic content injection based on user data.
  3. Track open rates and link clicks.
  4. Provide A/B testing capabilities for different email versions.

Non-Functional

  1. High Availability: The system should not lose email requests.
  2. Scalability: Support sending 10 million emails per day, with spikes during event announcements.
  3. Low Latency: Tracking clicks should not negatively impact the user experience.

Discussion Points

  • Define the high-level architecture including the API layer, scheduling service, and delivery workers.
  • Describe the data model for storing email templates, user preferences, and tracking logs.
  • Explain how you would handle failures (e.g., third-party SMTP provider downtime) and prevent duplicate sends.
  • Detail the strategy for handling A/B test routing and analytical aggregation.

Hints

Hint 1

Consider using a distributed message queue to decouple the scheduling of an email from the actual delivery process.

Hint 2

For global time-zone scheduling, store user preferences with an offset and use a bucketing strategy to batch work for the delivery workers.

Hint 3

Use a tracking pixel or unique URL redirects to capture email opens and link clicks without burdening the primary application database.

Follow-up questions

  • How would you ensure that a user who has unsubscribed does not receive emails even if they were scheduled previously?
  • If the third-party email service provider is rate-limiting your requests during a spike, how would you implement a back-off mechanism?
  • How would you store and query the analytics data to provide a dashboard showing the effectiveness of A/B tests in real-time?