← StubHub Interview Insights

StubHub·Software Engineer·Onsite - Coding / Algorithms·Intermediate

Intermediate
May 2026

Summary

StubHub coding round for a Software Engineer role, centered entirely on building an Event Recommendation System in Java. The core challenge was designing it without hardcoding any logic, which sounds straightforward until you're staring at a blank screen trying to figure out how to make filters composable.

Questions Asked (3)

Q1

Design an Event Recommendation System in Java where different campaign types can reuse and compose filtering behaviors (by distance, price, time, etc.) without hardcoding any conditional logic.

System DesignTechnical Trade-offsAPI & Integrations
Author's notes

This is the whole interview basically.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements and constraints, then propose a design using the Strategy pattern for individual filters and the Composite pattern to combine them. Emphasize how this approach eliminates conditional logic and allows dynamic composition of filters for different campaign types.

Pro tip: Mention that filters can be composed using a builder or factory to create complex filter trees, and discuss how this design supports easy addition of new filter types without modifying existing code, adhering to the Open/Closed principle.

1. Clarify Requirements

Ask questions to understand the scope: What are the campaign types? What filters are needed? Are filters combinable with AND/OR logic? What are performance considerations?

2. Identify Design Patterns

Propose using Strategy pattern for individual filters (e.g., DistanceFilter, PriceFilter) and Composite pattern to combine them into complex filter expressions.

3. Define Interfaces and Classes

Define a Filter interface with a method like boolean matches(Event event). Implement concrete filters and composite filters (AndFilter, OrFilter) that hold child filters.

4. Compose Filters for Campaigns

Show how different campaign types can be configured with specific filter compositions, perhaps using a builder or configuration, without hardcoding conditionals.

5. Discuss Trade-offs and Extensibility

Address performance (e.g., short-circuiting in composites), flexibility, and how to add new filters or composite types without modifying existing code.

Key Points to Mention

  • Strategy pattern for encapsulating individual filtering algorithms
  • Composite pattern for combining filters into trees
  • Open/Closed principle: new filters can be added without changing existing code
  • Elimination of conditional logic through polymorphism
  • Dynamic composition of filters per campaign using configuration or builders
  • Performance considerations: short-circuit evaluation, caching, and potential parallel execution

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

Q2

How would you support showing users events near them, using either coordinates or city as the location signal?

System DesignData Modeling
Author's notes

Part of the broader system design but they called this out specifically.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements: expected scale, latency, and whether location is user-provided or inferred. Then propose a hybrid data model that supports both coordinate-based radius queries and city-based filtering, using a geospatial index and a denormalized city field. Finally, discuss trade-offs and how to handle edge cases like missing location or ambiguous city names.

Pro tip: Mention that city-based queries can be served from a simple key-value store or search index for speed, while coordinate queries need a geospatial index like PostGIS or Elasticsearch's geo_point. This shows you understand the performance implications of each signal.

1. Clarify Requirements

Ask about scale (number of events, queries per second), latency expectations, and whether location is always provided or can be inferred. Also clarify if 'near' means a fixed radius or a dynamic one.

2. Design Data Model

Store events with both coordinates (lat/lon) and a normalized city identifier. Use a geospatial index for coordinates and a separate index for city to enable efficient filtering.

3. Query Strategy

For coordinates, use a bounding box or radius search on the geospatial index. For city, use an exact match on the city field. Consider combining both if the user provides both signals.

4. Handle Edge Cases

Address missing location by falling back to IP-based geolocation or user profile. Handle ambiguous city names by using a canonical city ID and possibly state/country.

5. Optimize and Scale

Discuss caching frequent queries, sharding by geohash or city, and using a search engine like Elasticsearch for flexible querying. Mention trade-offs between consistency and latency.

Key Points to Mention

  • Geospatial indexing techniques (e.g., geohash, R-tree, PostGIS, Elasticsearch geo_point)
  • Denormalization of city data for fast filtering
  • Handling both location signals: coordinates for precision, city for broader reach
  • Fallback strategies for missing or imprecise location
  • Caching and sharding strategies for scalability
  • Trade-offs between accuracy and performance

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

Q3

How do you ensure users always get recommendations even when there's limited or missing signal about their preferences?

System DesignAdaptability & Ambiguity
Author's notes

Basically a fallback strategy question baked into the system design.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by acknowledging the cold-start problem and the need for fallback strategies. Then describe a tiered recommendation system that gracefully degrades from personalized to non-personalized signals, emphasizing robustness and user experience. Conclude with how you would measure success and iterate.

Pro tip: Mention that even without explicit signals, you can leverage implicit signals like time of day, location, or trending items, and always have a non-personalized fallback like popularity or editorial picks to avoid empty states.

1. Identify available signals

List all possible signals, even weak ones: user context (device, time, location), item popularity, and global trends. Acknowledge that missing signals are common, especially for new users.

2. Design a tiered fallback system

Propose a hierarchy: personalized recommendations when signals exist, then segment-based (e.g., demographics or geography), then non-personalized (popularity, trending, editorial). Ensure each tier has a clear trigger.

3. Implement graceful degradation

Explain how the system switches between tiers seamlessly, with monitoring to detect when signals are insufficient. Use caching and precomputed recommendations for low-latency fallbacks.

4. Measure and iterate

Define metrics like coverage (percentage of users receiving recommendations), engagement, and satisfaction. Use A/B testing to compare fallback strategies and improve over time.

Key Points to Mention

  • Cold-start problem and its impact on recommendations
  • Implicit signals (e.g., time, location, device) as alternatives to explicit preferences
  • Non-personalized fallbacks: popularity, trending, editorial curated lists
  • Tiered architecture with graceful degradation
  • Monitoring and alerting for missing signals
  • Metrics: coverage, CTR, user satisfaction, and business impact

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