Bird
0
0

Given the nested URL /users/10/orders/3, what resource does this URL represent?

medium📝 Predict Output Q13 of 15
Rest API - URL and Resource Design
Given the nested URL /users/10/orders/3, what resource does this URL represent?
AOrder with ID 3 belonging to user with ID 10
BUser with ID 3 who placed order 10
CAll orders of user 10 and order 3 combined
DUser 10's profile and order 3 details merged
Step-by-Step Solution
Solution:
  1. Step 1: Analyze URL segments

    The URL shows 'users' with ID 10, then 'orders' with ID 3 nested inside.
  2. Step 2: Understand resource relationship

    This means order 3 belongs to user 10, so the URL points to that specific order.
  3. Final Answer:

    Order with ID 3 belonging to user with ID 10 -> Option A
  4. Quick Check:

    Nested resource = child inside parent [OK]
Quick Trick: Read URL left to right: parent then child with IDs [OK]
Common Mistakes:
MISTAKES
  • Mixing up which ID belongs to user or order
  • Thinking URL shows combined or merged data
  • Ignoring the order of resources in URL

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes