https://api.example.com/users/42/orders/7, what resource does this URL most likely represent?Look at the order of segments in the URL path.
The URL path segments are hierarchical. /users/42/orders/7 means order 7 belonging to user 42.
Think about how URLs help users and developers understand the API.
REST APIs use URLs to represent resources and their relationships, so a clear URL structure helps communicate what data or action is involved.
Consider which resource is the parent and which is the child.
Option B reverses the natural hierarchy. Orders belong to users, so users should come before orders in the URL.
Single resource URLs usually have the resource name plural followed by the ID.
Option C uses the plural resource name and the ID directly, which is the standard RESTful pattern.
https://api.example.com/companies/5/departments/3/employees/42. How many distinct resource types does this URL represent?Count each resource type in the path segments.
The URL shows three resource types: companies, departments, and employees.