NEW
Font size
WorksheetsREST API Design Best Practice Quiz
Total questions: 10
Worksheet time: 2mins
Which HTTP method is used to update partial data from a REST API?
POST
PUT
GET
PATCH
Which HTTP status code indicates success?
404
500
200
403
What should a well-designed RESTful URL be based on?
Actions
Resources
Procedures
Functions
Which of the following is a best practice for API versioning?
Place version in the header
Place version in the URI
Place version in the body
Avoid versioning altogether
What is a common practice for paginating large datasets in a REST API?
Return all data in one response.
Use headers to indicate pagination.
Break the dataset into multiple files.
Use query parameters like ?page=2&size=10.
Why is statelessness a key principle of REST?
It allows the API to remember the client's state.
It enhances scalability by not storing client data between requests.
It enables API versioning.
It reduces the need for caching.
What is the main benefit of including a requestId in the response headers?
To increase the response size.
To help track and trace logs related to a specific request.
To cache the request.
To handle rate limiting.
What is a primary security advantage of using JWT (JSON Web Tokens) in a REST API?
JWTs can be easily revoked if compromised.
JWTs allow API clients to access any endpoint without authentication.
JWTs ensure data integrity and authenticity using cryptographic signatures.
JWTs are valid indefinitely unless manually revoked.
What is a best practice for handling optional fields in REST API responses to ensure backward compatibility?
Always remove unused fields.
Add new optional fields without affecting existing responses.
Rename old fields to indicate they are deprecated.
Return 404 for missing optional fields.
If an API version is updated from 2.1.4 to 2.2.0, which of the following changes most likely occurred?
A backward-incompatible change was introduced.
A critical bug fix was applied to an endpoint.
A major architectural overhaul was implemented, breaking all previous API versions.
A new feature was added in a backward-compatible manner.
