FastPrepTV Series in a Production Window

TV Series in a Production Window

Agoda logoAgoda● MediumFULLTIMEOA

Problem statement

Filter TV-series records by their production years.

The runtime_of_series value has one of four forms:

  1. (2020-2021): the first and last production years;
  2. (2020-): still in production;
  3. (2020): produced for one year; or
  4. one of those forms preceded by (I) or (II), which must be ignored.

For a finite end_year, keep shows that started in start_year or later and ended in end_year or earlier. When end_year is -1, keep shows that started in start_year or later and are still in production. Return show names in alphabetical order.

The original assessment fetched every page from a supplied HTTP endpoint. The practice runner supplies the combined API records and query window directly as tables.

Table schema

Pandas

Use the same input data with any supported language. Open the Schema tab in the editor to see the generated SQL setup or Pandas DataFrames.

tv_series

ColumnTypeNullableDescription
nameTextNo—
runtime_of_seriesTextNo—
certificateTextNo—
runtime_of_episodesTextNo—
genreTextNo—
imdb_ratingDecimalNo—
overviewTextNo—
no_of_votesIntegerNo—
idPKIntegerNo—

query_window

ColumnTypeNullableDescription
start_yearIntegerNo—
end_yearIntegerNo—

Expected result

Your query or function must return these columns.

ColumnTypeNullableDescription
nameTextNo—

Row order: must match exactly. Numeric tolerance: 0.

Constraints

  • The query_window table contains exactly one row.
  • Every runtime string follows one of the four documented forms.
  • Show names are compared case-sensitively for output ordering.

More Agoda problems

See Agoda hiring insights