Dataford
Interview QuestionsInterview GuidesExperiencesCoaching
New
Pricing
Get started
Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
Experiences
Practice
Mock InterviewsTimed interview simulations with feedbackCoaching1:1 coaching with people at your target companiesSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Build my plan
Retrieve Paginated JSON Movies
00:00
5 left

Retrieve Paginated JSON Movies

MediumSQL · PostgreSQL

Problem

Given a list of movie titles from a URL, retrieve all pages of JSON data and return a list of movies.

The URL requests and captured JSON responses are stored in the provided tables. Return only movies whose titles were requested, deduplicate repeated results, and retain the earliest page containing each movie.

Output

  1. One row per unique matching movie, with columns movie_title, release_year, imdb_id, and first_page.
  2. Exclude movies not present in the requested title list.
  3. Order by movie_title, release_year, and imdb_id ascending.

Schema

movie_searches
ColumnTypeDescription
search_idPKINTIdentifier for one movie search request
source_urlVARCHAR(500)URL used to retrieve the movie data
search_titles
ColumnTypeDescription
search_idINTReferences the movie search request
requested_titleVARCHAR(200)Movie title requested by the search
title_positionINTPosition of the title in the original request
api_pages
ColumnTypeDescription
search_idINTReferences the movie search request
page_numberPKINTPage number returned by the API
total_pagesINTTotal number of pages for the search
response_jsonJSONBJSON response containing a movies array
Tablesmovie_searchessearch_titlesapi_pages
Interviewer

Your question is Retrieve Paginated JSON Movies. Start with the requirements and the three tables in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePostgreSQL
Sign up free to run your codeLog inLn 1
Run your query to see results here.