Katkat

Design an Event Recommendation Engine

StubHubSoftware Engineer · Technical Screen

Last updated

This question evaluates object-oriented design, system extensibility, interface and responsibility definition, and integration with external services in the context of a recommendation engine.

You are building an email marketing recommendation engine for a ticketing marketplace.

The marketplace has many users and many events. The engine should select which events are relevant to each user and send recommendation emails. The design should be extensible because product managers will frequently add new recommendation rules.

Requirements:

  1. Define basic data models for User and Event.
  2. Implement an EmailMarketingEngine that takes a list of recommendation strategies and uses them to decide which users should receive which event recommendations.
  3. Implement at least the following strategies:
  • Recommend events in the same city as the user.
  • Recommend events whose ticket price is below $50.
  1. Assume event prices are retrieved through a separate PriceService rather than stored directly on the event.
  2. The design should make it easy to add future strategies, such as location distance, user interests, past purchases, event popularity, or personalized ranking.
  3. Show how the engine can be configured with multiple strategies, for example: city-based recommendation plus price-based recommendation.

Discuss the object-oriented design, interfaces, responsibilities, and how you would test the solution.