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
View Answer
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?
a) HTTP
b) FTP
c) Gopher
d) TELNET
View Answer
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
View Answer
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?
a) OPTIONS
b) DELETE
c) POST
d) HEAD
View Answer
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?
a) Public
b) Private
c) Nocache/nostore
d) Maxage
View Answer
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?
a) 200
b) 201
c) 204
d) 304
View Answer
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?
a) @Path
b) @GET
c) @PUT
d) @POST
View Answer
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?
a) @PathParam
b) @QueryParam
c) @MatrixParam
d) @HeaderParam
View Answer
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.
a) False
b) True
View Answer
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.
a) True
b) False
View Answer
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.
- Check Computer Science Books
- Check Computer Network Books
- Practice Computer Science MCQs
- Practice MCA MCQs
- Apply for Computer Science Internship