Actor-Director Pairs

ASKED IN INTERVIEW
2pts
Netflix

Problem Statement

Netflix production teams analyze successful collaborations to greenlight future projects. A collaboration is defined as an actor and a director working together on a single movie (identified by timestamp).

Your task is to find all pairs of actor_id and director_id that have collaborated at least three times.

Rules:

  • The same pair must appear 3 or more times in the dataset.
  • Output columns: actor_id, director_id.
  • Results must be sorted by actor_id in ascending order. If actor_id is the same, sort by director_id in ascending order.
Tests your understanding of
Grouping, Filtering and Aggregation

Input Tables

ActorDirector
actor_id(INTEGER)director_id(INTEGER)timestamp(INTEGER)
110
111
112
123
124
215
216
217
Actors
actor_id(INTEGER)actor_name(VARCHAR)
1Leonardo DiCaprio
2Robert De Niro
MovieGenres
timestamp(INTEGER)genre(VARCHAR)
0Drama
1Thriller
2Crime

Expected Output

actor_id(INTEGER)director_id(INTEGER)
11
21

Tags

EasyASKED IN INTERVIEWGroupingFilteringAggregation
10-15 min
82%

Hints