FastPrepBest TV Show in a Genre
Problems/Best TV Show in a Genre

Best TV Show in a Genre

Adyen logoAdyen● MediumFULLTIMEOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The report leaves out how the function gets its input, how genres are cleaned up (such as upper and lower case), and the input limits. We chose those.

Our version is about 90% the same as the reported question.

A paginated TV-series service has already been fetched for you. The outer index of each matrix is a page in increasing page-number order. For every page and record index, namesByPage[page][i], genresByPage[page][i], and ratingsByPage[page][i] describe the same show.

Each genre string is a comma-separated list. A show matches genre when one trimmed genre token equals the requested genre ignoring letter case. Ratings are represented as integer tenths, so 93 means 9.3.

Return the matching show's name with the highest rating across all pages. If several matching shows have the same highest rating, return the lexicographically smallest name.

Function

bestShowInGenre(genre: String, namesByPage: String[][], genresByPage: String[][], ratingsByPage: int[][]) → String

Examples

Example 1

genre = "Action"namesByPage = [["Game of Thrones","Breaking Bad"],["Band of Brothers"]]genresByPage = [["Action, Adventure, Drama","Crime, Drama, Thriller"],["Action, Drama, History"]]ratingsByPage = [[93,95],[92]]return = "Game of Thrones"

Two shows match Action. Game of Thrones has the higher rating, so it is returned even though another page is scanned later.

Example 2

genre = "Animation"namesByPage = [["Rick and Morty"],["Avatar: The Last Airbender"]]genresByPage = [["Animation, Adventure, Comedy"],["Animation, Action, Adventure"]]ratingsByPage = [[92],[92]]return = "Avatar: The Last Airbender"

The two matching shows tie at 9.2, so the lexicographically smaller name is returned.

Example 3

genre = "drama"namesByPage = [["North","South"],["East","West"]]genresByPage = [["Drama","Comedy"],["Crime, DRAMA","Drama, Mystery"]]ratingsByPage = [[80,99],[91,88]]return = "East"

Genre matching ignores case but compares complete comma-delimited tokens. East has the highest matching rating.

Constraints

  • 1 <= namesByPage.length == genresByPage.length == ratingsByPage.length <= 8
  • All three rows on a page have equal length, and each page contains at most 32 records.
  • The snapshot contains between 1 and 256 records in total.
  • 1 <= genre.length <= 40, and the requested genre has no leading or trailing whitespace.
  • 1 <= namesByPage[page][i].length <= 100
  • 0 <= ratingsByPage[page][i] <= 100; a value is the IMDB rating multiplied by ten.
  • At least one record contains a genre token matching genre.

More Adyen interview questions

  • Count Perfect PairsOA · Seen Aug 2026
  • Maximize Strength with Disjoint Adjacent SwapsOA · Seen Aug 2026
  • Search and Format ContactsPHONE SCREEN · Seen Nov 2026
  • Find the Tree DiameterONSITE INTERVIEW · Seen Aug 2026
  • Planets Queries from Planet OnePHONE SCREEN · Seen May 2026

Similar questions at other companies

  • Compress Editor Actions into Operational Transform OperationsReplit · OA · PHONE SCREEN · ONSITE INTERVIEW
  • Cheating CodemakerJane Street · OAJane Street interview questions
  • Correct Apartment Bedroom CountsRamp · OARamp interview questions
  • Reflow and Fully Justify Text LinesIntuit · OAIntuit interview questions
  • Cumulative Typosquatting DetectionPalantir · OAPalantir interview questions
  • Incident MonitorStripe · OAStripe interview questions
  • REST API: Highest International StudentsRippling · OARippling interview questions
  • Count Invalid Log GroupsIBM · OAIBM interview questions
  • Compare Character Arrays with BackspacesOdoo · OAOdoo interview questions
  • Slowest Key PressRoblox · OARoblox interview questions

Adyen interview experiences

  • Adyen Kotlin Backend Engineer Live Coding: 1 Experience
All Adyen interview questionsSee Adyen hiring insights
Saved
class Solution {
    public String bestShowInGenre(String genre, String[][] namesByPage, String[][] genresByPage, int[][] ratingsByPage) {
        // write your code here
    }
}
Checking account…