← StubHub Interview Insights

StubHub·Backend Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

StubHub backend interview focused on a single design problem: building a filterable event recommendation engine from scratch. Pretty interesting problem for a ticketing company, made sense contextually. The discussion went deep into data structures and composability.

Questions Asked (1)

Q1

Design a simple event recommendation engine where events have a location, date, and price. Implement filter primitives for distance, date/date range, radius, and price range, and support combining them into a single query. Walk through your data structures, how filters compose, and the time complexity of each.

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

This took me a minute to fully parse.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scale, then propose a clean interface for filter primitives that each expose a predicate and can be composed with AND/OR. Discuss data structures like sorted arrays, interval trees, or geohashes for efficient filtering, and analyze time complexity for each filter and the combined query.

Pro tip: Mention that you would push filters down to the data store (e.g., using database indexes or geospatial indexes) for scalability, and discuss trade-offs between in-memory filtering and database-level filtering.

1. Clarify requirements and constraints

Ask about expected scale (number of events, queries per second), latency requirements, and whether filters need to be combined with AND/OR logic. This shows you think about real-world constraints before diving into design.

2. Define filter primitives and composition

Propose a common interface for filters (e.g., a method that takes an event and returns a boolean) and show how they can be combined using logical operators. Emphasize that each filter is independent and composable.

3. Choose data structures for efficient filtering

For each filter type, suggest appropriate data structures: e.g., sorted array or B-tree for date and price ranges, geohash or R-tree for distance/radius. Explain how these structures enable faster queries than linear scans.

4. Analyze time complexity

Walk through the time complexity of applying each filter individually and the combined query. Discuss best-case and worst-case scenarios, and how composition affects performance (e.g., ordering filters by selectivity).

5. Discuss scalability and trade-offs

Mention how the design would scale (e.g., using database indexes, caching, or distributed systems) and trade-offs between simplicity and performance. This demonstrates awareness of production concerns.

Key Points to Mention

  • Filter interface design: each filter as a predicate function or class with an apply method.
  • Composition patterns: using composite pattern or functional composition to combine filters with AND/OR.
  • Data structures: sorted arrays for date/price, geohash or R-tree for location, and how they support range queries.
  • Time complexity: O(log n) for binary search on sorted arrays, O(k) for range queries, and how combining filters affects overall complexity.
  • Optimization: ordering filters by selectivity to reduce the candidate set early.
  • Scalability: pushing filters to the database using indexes (e.g., B-tree for price, geospatial index for location) and caching frequent queries.

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