Build Event Notification Engine

Read the full interview experience this question came from →

Quick Overview

This question evaluates a candidate's competency in modular software design and extensibility, algorithmic filtering and ranking, date arithmetic for birthday proximity, geospatial distance computation, and integration with notification services.

Build Event Notification Engine

Company: StubHub

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Onsite

You are implementing part of a marketing engine for an event marketplace. Assume the following data is available: - `Customer`: `id`, `city`, `birth_month`, `birth_day`, `latitude`, `longitude` - `Event`: `id`, `title`, `city`, `start_time`, `latitude`, `longitude` - `NotificationService.send(customer_id, message)` sends a notification to a customer Implement a `MarketingEngine` with a method such as `send_customer_notifications(customer, events, today)`. The engine should support multiple campaigns: 1. Notify the customer about all upcoming events in the same city as the customer. 2. Notify the customer about the single upcoming event whose date is closest to the customer's next birthday after `today`. 3. Notify the customer about the 5 upcoming events closest to the customer by geographic distance. For this interview, you may use Euclidean distance on latitude and longitude. Design the code so that new campaigns can be added without changing the core engine. Also explain how you would handle ties, fewer than 5 matching events, and notification formatting.

Overview: This question evaluates a candidate's competency in modular software design and extensibility, algorithmic filtering and ranking, date arithmetic for birthday proximity, geospatial distance computation, and integration with notification services.

Read the full StubHub Software Engineer interview experience this question came from

|Home/Coding & Algorithms/StubHub
StubHub logo
StubHub
Feb 16, 2026
mediumSoftware EngineerOnsiteCoding & Algorithms
23
0

You are implementing part of a marketing engine for an event marketplace.

Assume the following data is available:

  • Customer : id , city , birth_month , birth_day , latitude , longitude
  • Event : id , title , city , start_time , latitude , longitude
  • NotificationService.send(customer_id, message) sends a notification to a customer

Implement a MarketingEngine with a method such as send_customer_notifications(customer, events, today).

The engine should support multiple campaigns:

  1. Notify the customer about all upcoming events in the same city as the customer.
  2. Notify the customer about the single upcoming event whose date is closest to the customer's next birthday after today .
  3. Notify the customer about the 5 upcoming events closest to the customer by geographic distance. For this interview, you may use Euclidean distance on latitude and longitude.

Design the code so that new campaigns can be added without changing the core engine. Also explain how you would handle ties, fewer than 5 matching events, and notification formatting.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...