Skip to main content
All Questions

Find the highest-rated TV series in a genre using a paginated REST API.

Unlock detailed company stats for this questionUpgrade

Use HTTP GET on https://jsonmock.hackerrank.com/api//tvseries to find all shows in a given genre. Results are paginated; add ?page={num} to the URL to access more pages. The response is a JSON object with page, per_page, total, total_pages and data (an array of TV series records with name, runtime_of_series, certificate, runtime_of_episodes, genre, imdb_rating, overview, no_of_votes, id). Write bestInGenre(String genre) that returns the name of the show with the highest IMDb rating in that genre; on a tie, return the alphabetically lower name.

Community answers

No answers contributed by the community yet.

Related courses

Course

Software Engineering Interview Prep

Land your dream software engineering role at Google, Amazon, Microsoft, Meta, Apple, and other top companies. Learn from mock interviews, frameworks, and advice from senior candidates—practice data structures, algorithms, system design, people management, behavioral interviews, and more.

Course

System Design Interviews

Learn how to answer the latest system design questions across product, infrastructure, and AI domains. Features in-depth video examples, written breakdowns, and helpful reference patterns. Watch senior engineers and managers answer these questions in mock interview videos.