← stubhub Interview Insights

stubhub·Software Engineer·Technical Phone Screen·Intermediate

IntermediatePrefer not to say
Jun 2026

Summary

StubHub software engineering interview that was basically one big design problem: build a marketing notification engine with multiple campaign types and make it extensible. More involved than I expected for a phone screen.

Questions Asked (2)

Q1

Design a MarketingEngine class with a method that sends notifications to customers based on multiple campaign types: events in the same city, the event closest to the customer's next birthday, and the 5 geographically closest events. The design should allow new campaigns to be added without modifying the core engine.

System DesignAlgorithms & Data StructuresTechnical Trade-offs
Author's notes

This is where I spent most of my time.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and defining the core abstractions: a Campaign interface with a method to select customers and generate notifications, and a MarketingEngine that manages a list of campaigns. Then, walk through the data structures and algorithms for each campaign type, emphasizing extensibility via the Strategy pattern. Finally, discuss trade-offs and potential optimizations.

Pro tip: Emphasize that the engine should be open for extension but closed for modification (Open/Closed Principle). Mention that campaigns can be added dynamically, and consider how to handle dependencies like event data and customer locations.

1. Clarify Requirements and Scope

Ask questions to understand constraints: expected scale, real-time vs batch, data sources, and notification channels. Confirm that new campaigns should be pluggable without changing the engine.

2. Define Core Abstractions

Introduce a Campaign interface with methods like selectCustomers and generateNotifications. The MarketingEngine holds a collection of campaigns and delegates execution to them.

3. Design Each Campaign Implementation

For each campaign type, outline the algorithm and data structures: e.g., for same-city events, filter events by city; for closest to next birthday, compute days until next birthday and find nearest event; for 5 closest events, use geospatial indexing (e.g., k-d tree or geohash) to find nearest neighbors.

4. Address Extensibility and Scalability

Explain how new campaigns can be added by implementing the Campaign interface and registering with the engine. Discuss potential performance bottlenecks and how to scale (e.g., caching, precomputation, distributed processing).

5. Discuss Trade-offs and Edge Cases

Compare approaches for geospatial search (e.g., k-d tree vs geohash), handling ties, missing data, and time zones. Mention testing strategies and how to ensure correctness.

Key Points to Mention

  • Strategy pattern for pluggable campaigns
  • Open/Closed Principle (SOLID)
  • Geospatial indexing (k-d tree, geohash, or R-tree) for proximity queries
  • Efficient date calculations for next birthday (e.g., using java.time or similar)
  • Caching and precomputation for performance
  • Handling ties and edge cases (e.g., multiple events same distance)

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

How would you handle ties, fewer than 5 matching events, and notification message formatting in this system?

System DesignTechnical Trade-offs
Author's notes

Felt like a follow-up but it was clearly planned.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements and constraints of the matching system, then systematically address each edge case (ties, fewer than 5 matches, and message formatting) with concrete strategies. Emphasize trade-offs between simplicity, correctness, and user experience, and propose a design that is scalable and maintainable.

Pro tip: Demonstrate awareness of real-world constraints by discussing how to handle ties deterministically (e.g., using a secondary sort key) and how to avoid overwhelming users with too many notifications. Mention that you would validate the solution with edge-case tests and consider monitoring for anomalies.

1. Clarify Requirements and Constraints

Ask questions to understand the system's purpose, expected scale, and what 'matching events' means. Determine if ties need a deterministic resolution and if notifications are user-facing or internal.

2. Handle Ties

Propose a deterministic tie-breaking rule, such as sorting by a secondary attribute (e.g., timestamp, ID) or using a stable sort. Discuss whether ties should be considered equal or if a priority order is needed.

3. Handle Fewer Than 5 Matches

Decide whether to return fewer results, pad with defaults, or trigger a fallback mechanism. Consider user experience: is it better to show fewer results or to relax criteria to get more?

4. Design Notification Message Formatting

Define a clear, concise message template that includes essential information (e.g., event name, match count). Ensure messages are actionable and avoid spamming users with multiple notifications for the same event.

5. Discuss Trade-offs and Scalability

Evaluate the impact of each decision on performance, complexity, and user satisfaction. Consider how the solution scales with increasing data and whether asynchronous processing is needed for notifications.

Key Points to Mention

  • Deterministic tie-breaking using secondary sort keys (e.g., timestamp, ID) to ensure consistent results.
  • Fallback strategies for fewer than 5 matches: returning partial results, relaxing criteria, or padding with recommendations.
  • Notification message formatting: concise, informative, and avoiding duplicate or excessive notifications.
  • Trade-offs between consistency, latency, and user experience in edge-case handling.
  • Testing and monitoring: unit tests for edge cases and logging for tie occurrences or low-match scenarios.
  • Scalability considerations: batch processing, rate limiting, and asynchronous notification delivery.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.