Computer Networks Questions & Answers – Web Caching

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

Answer: b
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

Answer: a
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

Answer: c
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.
advertisement
advertisement

4. Which of the following HTTP methods should be idempotent in nature?
a) OPTIONS
b) DELETE
c) POST
d) HEAD
View Answer

Answer: b
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

Answer: b
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.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

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

Answer: b
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

Answer: c
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.
advertisement

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

Answer: c
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

Answer: b
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.
advertisement

10. POST operation should be idempotent.
a) True
b) False
View Answer

Answer: b
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.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.