Challenge - 5 Problems
RESTful Resource Naming Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
What is the correct RESTful URL for accessing a single user resource?
Given a REST API that manages users, which URL correctly follows noun-based resource naming conventions to access the user with ID 42?
Attempts:
2 left
💡 Hint
Focus on using plural nouns and hierarchical paths without verbs.
✗ Incorrect
RESTful URLs use plural nouns to represent collections and IDs to access single resources. The correct format is /users/42.
❓ Predict Output
intermediate2:00remaining
Which URL correctly represents a collection of blog posts?
You want to design a REST API endpoint to retrieve all blog posts. Which URL follows noun-based resource naming best practices?
Attempts:
2 left
💡 Hint
Use plural nouns without verbs or actions in the URL path.
✗ Incorrect
RESTful URLs use plural nouns to represent collections. The correct URL is /posts.
🔧 Debug
advanced2:00remaining
Identify the error in this RESTful URL design
Which option shows a RESTful URL that violates noun-based resource naming conventions by including a verb in the path?
Attempts:
2 left
💡 Hint
RESTful URLs should avoid verbs in the path; HTTP methods indicate actions.
✗ Incorrect
Option A includes the verb delete in the URL path, which is against noun-based resource naming. Actions should be represented by HTTP methods like DELETE.
🧠 Conceptual
advanced2:00remaining
What is the best URL to access comments for a specific blog post?
You have blog posts and each post has comments. Which URL correctly uses noun-based resource naming to get comments for post with ID 10?
Attempts:
2 left
💡 Hint
Use nested resources with plural nouns in hierarchical order.
✗ Incorrect
Option B correctly nests the comments resource under the specific post resource using plural nouns.
❓ Predict Output
expert2:00remaining
How many items are in the resulting resource collection?
Assume a REST API endpoint
/products returns a JSON array of products. The response is:[{"id":1,"name":"Pen"},{"id":2,"name":"Notebook"},{"id":3,"name":"Eraser"}] How many items does this collection contain?Attempts:
2 left
💡 Hint
Count the number of objects inside the JSON array.
✗ Incorrect
The JSON array contains three objects, so the collection has 3 items.