Bird
0
0

Given the URL /products/123/reviews/456, which resource does the identifier 456 represent?

medium📝 Predict Output Q13 of 15
Rest API - URL and Resource Design
Given the URL /products/123/reviews/456, which resource does the identifier 456 represent?
AProduct with ID 456
BReview with ID 456 for product 123
CProduct with ID 123
DAll reviews for product 456
Step-by-Step Solution
Solution:
  1. Step 1: Break down the URL path

    The URL has two resource names: "products" and "reviews" with IDs 123 and 456 respectively.
  2. Step 2: Understand the hierarchy

    "reviews/456" comes after "products/123", so 456 is the review ID related to product 123.
  3. Final Answer:

    Review with ID 456 for product 123 -> Option B
  4. Quick Check:

    Last ID is for last resource in URL [OK]
Quick Trick: Last ID belongs to the last resource named [OK]
Common Mistakes:
  • Mixing IDs and thinking 456 is a product ID
  • Ignoring resource hierarchy in URL
  • Assuming IDs apply to all resources

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes