Hackerrank get method challenge

Let me begin by saying I am not taking a test, prepearing for the ones I might take in future and this question has had me in sixes and sevens.

I will be greatly obliged if someone can explain to me how to implement this in python or java. Thank you so much.

To solve this challenge, you are required to write an HTTP GET method to retrieve information from a movie database.

Function Description Given a string substr, getMovieTitles ( static String getMovieTitles(String substr) )must perform the following tasks:

  1. Query https://jsonmock.hackerrank.com/api/movies/search/?Title=substr(replace.
  2. Initialize the titles array to store total string elements. Store the Title of each movie meeting the search criterion in the titles array.
  3. Sort titles in ascending order and return it as your answer.

The query response from the website is a JSON response with the following five fields: page : The current page.

  • per_page : The maximum number of results per page.
  • total : The total number of movies in the search result.
  • total_pages : The total number of pages which must be queried to get all the results.
  • data : An array of JSON objects containing movie information where the Title field denotes the title of the movie.

In order to get all results, you may have to make multiple page requests. To request a page by number, your query should read https://jsonmock.hackerrank.com/api/movies/search/?Title=substr&page=pageNumber , replacing substr and pageNumber.

Firstly, welcome to the forums.

While we are primarily here to help people with their Free Code Camp progress, we are open to people on other paths, too. Some of what you are asking is pretty trivial in the Free Code Camp context, so you might find that if you’re not getting the instruction and material you need in your current studies, the FCC curriculum will really help you get started. At a modest guess I’d say investing a 4-5 hours working through the curriculum here will really pay off. You can find the curriculum at https://www.freecodecamp.org/learn.

With your current questions, we don’t have enough context to know what you already know or don’t know, so it is impossible to guide you without just telling you the answer (which we won’t do).

It is pretty typical on here for people to share a codepen / repl.it / jsfiddle example of what they have tried so that anyone helping has more of an idea of what help is actually helpful.

Please provide some example of what you’ve tried and I’m sure you’ll get more help.

Happy coding :slight_smile: