Bird
0
0

Given this REST API response sorted by rating in descending order, what is the first item's rating?

medium📝 Predict Output Q13 of 15
Rest API - Query Parameters and Filtering

Given this REST API response sorted by rating in descending order, what is the first item's rating?

GET https://api.example.com/movies?sort=rating&direction=desc

Response:
[
  {"title": "Movie A", "rating": 9.5},
  {"title": "Movie B", "rating": 8.7},
  {"title": "Movie C", "rating": 7.9}
]
A7.9
B8.7
C9.5
DCannot determine
Step-by-Step Solution
Solution:
  1. Step 1: Understand descending order sorting

    Descending order means highest values come first.
  2. Step 2: Check the first item in the response

    The first item has rating 9.5, which is the highest rating.
  3. Final Answer:

    9.5 -> Option C
  4. Quick Check:

    Descending sort puts 9.5 first [OK]
Quick Trick: Descending means highest value is first in list [OK]
Common Mistakes:
  • Picking the last item's rating instead of first
  • Confusing ascending with descending order
  • Choosing 'Cannot determine' without checking response

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes