This set of Computer Networks Multiple Choice Questions & Answers (MCQs) focuses on “Web Caching”.
1. What does REST stand for?
a) Represent State Transfer
b) Representational State Transfer
c) Representing State Transfer
d) Representation State Transfer
Explanation: REST stands for Representational State Transfer and is a software architecture style in which the server sends a representation of the state of the resource that it requests. It provides interoperability between the systems.
2. Which of the following protocol is used by Restful web services as a medium of communication between client and server?
Explanation: Restful web services make use of HTTP protocol as a medium of communication between client and server. The REST architecture was known as the HTTP object model back in the year 1994.
3. Which of the following is not a good practice to create a standard URI for a web service?
a) Maintain Backward Compatibility
b) Use HTTP Verb
c) Using spaces for long resource names
d) Use lowercase letters
Explanation: We must use hyphens (-) or underscores (_) instead of spaces to represent long resource names. It may lead to the resource to be less recognizable for the system if we use spaces instead.
4. Which of the following HTTP methods should be idempotent in nature?
Explanation: DELETE operation should be idempotent, means their result will always same no matter how many times these operations are invoked. Also, the PUT operation is supposed to be idempotent.
5. Which of the following directive of Cache Control Header of HTTP response indicates that resource is cachable by only client and server?
Explanation: Private directive indicates that resource is cachable by only client and server; no intermediary can cache the resource. But if we use the public directive, it indicates that the resource may be cachable by any intermediary component.
6. Which of the following HTTP Status code means CREATED, when a resource is successful created using POST or PUT request?
Explanation: HTTP Status Code 201 means CREATED, when a resource is successful created using POST or PUT request. The code 200 means success i.e. OK, code 204 means NO CONTENT, and the code 304 means NOT MODIFIED.
7. Which of the following annotation of JAX RS API is used to annotate a method used to create resource?
Explanation: @PUT is the HTTP request that is used to create resource and also define a complete resource path. @POST may also be used to create a resource but it won’t define a resource path i.e. an accessing medium.
8. Which of the following annotation of JAX RS API binds the parameter passed to method to a HTTP matrix parameter in path?
Explanation: @MatrixParam is the annotation that binds the parameter passed to method to a HTTP matrix parameter in path, while @QueryParam binds to a query parameter, @PathParam binds to a value and @HeaderParam binds to the HTTP header in the path.
9. In REST architecture, a REST Server simply provides access to resources and REST client accesses and presents the resources.
Explanation: In REST architecture, a REST Server simply provides access to resources and REST client accesses and presents the resources. It is popularly used because it makes efficient use of the bandwidth and can be cached for better performance and scalability.
10. POST operation should be idempotent.
Explanation: POST operation can cause different result so they are not idempotent. The DELETE and PUT operations are idempotent as they invoke the same result every time they are called.
Sanfoundry Global Education & Learning Series – Computer Networks.
To practice all areas of Computer Networks, here is complete set of 1000+ Multiple Choice Questions and Answers.
- Get Free Certificate of Merit in Computer Networks
- Participate in Computer Networks Certification Contest
- Become a Top Ranker in Computer Networks
- Take Computer Networks Tests
- Chapterwise Practice Tests: Chapter 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
- Chapterwise Mock Tests: Chapter 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
- Buy Computer Network Books
- Practice MCA MCQs
- Buy Computer Science Books
- Practice Computer Science MCQs
- Apply for Computer Network Internship