Skip to main content
All Questions

Top-rated movie of a genre from an API.

Unlock detailed company stats for this questionUpgrade

Write a function that takes a genre and returns the highest-rated movie title of that genre by calling a paginated REST API, returning the lexicographically smallest title on ties. The URL is http://api.notrealwebsite.xyz/movies/page/{page}. Each response has currentPage, totalResults, totalPages and a data array of up to 10 items with movietitle, genre (possibly several) and rating. Imports are pre-given with no instructions, and a try/catch is required.

Community answers

No answers contributed by the community yet.

Related courses

Course

AI Engineering Interview Prep

Ace the AI engineering interview at top companies like Google, Anthropic, Meta, and OpenAI. Learn from detailed frameworks, example questions, and mock interviews with senior engineers. Practice system design, AI/ML concepts, AI-assisted coding, and behavioral rounds.

Course

Generative AI Interviews

Ace your interviews at AI-first and AI-powered companies. Learn to explain how Gen AI really works, where it fails, and how to use it responsibly. Understand how top tech companies build and deploy AI products and how generative AI works in production, from LLMs and RAG systems to real-world deployment.