← stubhub Interview Insights

stubhub·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

StubHub software engineer interview with a design-focused coding question. Pretty much one meaty problem about building a notification system, and the real conversation was about the data structure choices underneath it.

Questions Asked (1)

Q1

Design a MarketingEngine class with a method that notifies a given customer of all events happening in their city. Walk through the domain models, your choice of internal data structure, and the complexity of each customer query.

Algorithms & Data StructuresSystem DesignTechnical Trade-offs
Author's notes

I went straight for a city-to-events dictionary built at init time, which felt right.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and defining the domain models (Customer, City, Event, Subscription). Then propose an internal data structure that maps cities to events and customers to their city, optimizing for the query 'notify customer of all events in their city'. Finally, analyze the time and space complexity of the notification operation and discuss trade-offs.

Pro tip: Mention that in a real system, you'd likely need to handle scale with sharding by city and use a pub/sub system for notifications, but for this exercise, focus on the core data structure and complexity.

1. Clarify Requirements

Ask about expected scale, whether events are static or dynamic, and if notifications are real-time or batch. Confirm that the primary operation is retrieving all events for a customer's city.

2. Define Domain Models

Identify key entities: Customer (with city), Event (with city, date, etc.), and possibly a Subscription or Notification service. Define relationships between them.

3. Choose Internal Data Structure

Propose a hash map from city to a list of events (e.g., HashMap<String, List<Event>>). Optionally, maintain a map from customer to city for quick lookup.

4. Analyze Complexity

For a customer query: O(1) to find city, O(1) to get events list, O(k) to iterate and notify, where k is number of events in that city. Discuss space complexity O(E + C) where E is events and C is customers.

5. Discuss Trade-offs and Extensions

Consider alternatives like indexing by city and date, or using a graph. Mention scalability concerns (e.g., sharding, caching) and how to handle updates.

Key Points to Mention

  • Use a hash map to index events by city for O(1) lookup.
  • Store customer's city to avoid scanning all customers.
  • Time complexity of notification is O(k) where k is number of events in the city.
  • Space complexity is O(E + C) where E is total events and C is total customers.
  • Consider concurrency and real-time updates if events change frequently.
  • Mention potential need for pagination or filtering if k is large.

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