Are you an expert at handling web related protocols? Do you want to go to the next phase in career? Wisdom jobs provide you with various choices to choose from and help you to greatly increase your capabilities. Restful Web service is a uniform interface that is implemented on web services to increase performance and work at its best. To be eligible to Restful Web service jobs, one must be experienced in JAVA, Oracle, SOAP, REST API, and SQL, excellent knowledge of data structures, algorithms and web services. Wisdomjobs.com has a team of professionals always working to produce the best Restful Web Service job interview questions and answers page in order to help the candidates enhance their skills and go towards a successful interview.
Question 1. What Rest Stands For?
Answer :
REST stands for REpresentational State Transfer.
Answer :
REST is web standards based architecture and uses HTTP Protocol for data communication. It revolves around resource where every component is a resource and a resource is accessed by a common interface using HTTP standard methods. REST was first introduced by Roy Fielding in 2000.
In REST architecture, a REST Server simply provides access to resources and REST client accesses and presents the resources. Here each resource is identified by URIs/ global IDs. REST uses various representations to represent a resource like text, JSON and XML. Now a days JSON is the most popular format being used in web services.
Question 3. Name Some Of The Commonly Used Http Methods Used In Rest Based Architecture?
Answer :
Following well known HTTP methods are commonly used in REST based architecture:−
Question 4. What Are Web Services?
Answer :
A web service is a collection of open protocols and standards used for exchanging data between applications or systems. Software applications written in various programming languages and running on various platforms can use web services to exchange data over computer networks like the Internet in a manner similar to inter-process communication on a single computer.
Question 5. What Are Restful Web Services?
Answer :
Web services based on REST Architecture are known as RESTful web services. These web services use HTTP methods to implement the concept of REST architecture. A RESTful web service usually defines a URI, Uniform Resource Identifier a service, provides resource representation such as JSON and set of HTTP Methods.
Question 6. What Is A Resource In Rest?
Answer :
REST architecture treats every content as a resource. These resources can be text files, html pages, images, videos or dynamic business data. REST Server simply provides access to resources and REST client accesses and modifies the resources. Here each resource is identified by URIs/ global IDs.
Question 7. How To Represent A Resource In Rest?
Answer :
REST uses various representations to represent a resource where text, JSON, XML. XML and JSON are the most popular representations of resources.
Question 8. What Are The Best Practices To Design A Resource Representation?
Answer :
Following are important points to be considered while designing a representation format of a resource in a RESTful web services:
Question 9. Which Protocol Is Used By Restful Web Services?
Answer :
RESTful web services make use of HTTP protocol as a medium of communication between client and server.
Question 10. What Is Messaging In Restful Web Services?
Answer :
A client sends a message in form of a HTTP Request and server responds in form of a HTTP Response. This technique is termed as Messaging. These messages contain message data and metadata i.e. information about message itself.
Question 11. What Are The Core Components Of A Http Request?
Answer :
A HTTP Request has five major parts :
Question 12. What Are The Core Components Of A Http Response?
Answer :
A HTTP Response has four major parts:-
Question 13. What Is Addressing In Restful Web Services?
Answer :
Addressing refers to locating a resource or multiple resources lying on the server. It is analogous to locate a postal address of a person.
Answer :
URI stands for Uniform Resource Identifier. Each resource in REST architecture is identified by its URI.
Question 15. What Is Purpose Of A Uri In Rest Based Web Services?
Answer :
Purpose of an URI is to locate a resource(s) on the server hosting the web service.
Question 16. What Is Format Of A Uri In Rest Architecture?
Answer :
A URI is of following format:−
<protocol>://<service-name>/<ResourceType>/<ResourceID>
Question 17. What Is The Purpose Of Http Verb In Rest Based Web Services?
Answer :
VERB identifies the operation to be performed on the resource.
Question 18. What Are The Best Practices To Create A Standard Uri For A Web Service?
Answer :
Following are important points to be considered while designing a URI −
Question 19. What Is Statelessness In Restful Web Services?
Answer :
As per REST architecture, a RESTful web service should not keep a client state on server. This restriction is called statelessness. It is responsibility of the client to pass its context to server and then server can store this context to process client's further request. For example, session maintained by server is identified by session identifier passed by the client.
Question 20. What Are The Advantages Of Statelessness In Restful Web Services?
Answer :
Following are the benefits of statelessness in RESTful web services:
Question 21. What Are The Disadvantages Of Statelessness In Restful Web Services?
Answer :
Following is the disadvantage of statelessness in RESTful web services:-
Web services need to get extra information in each request and then interpret to get the client's state in case client interactions are to be taken care of.
Question 22. What Do You Mean By Idempotent Operation?
Answer :
Idempotent operations means their result will always same no matter how many times these operations are invoked.
Question 23. Which Type Of Web Services Methods Are To Be Idempotent?
Answer :
PUT and DELETE operations are idempotent.
Question 24. Which Type Of Web Services Methods Are To Be Read Only?
Answer :
GET operations are read only and are safe.
Question 25. What Is The Difference Between Put And Post Operations?
Answer :
PUT and POST operation are nearly same with the difference lying only in the result where PUT operation is idempotent and POST operation can cause different result.
Question 26. What Should Be The Purpose Of Options Method Of Restful Web Services?
Answer :
It should list down the supported operations in a web service and should be read only.
Question 27. What Should Be The Purpose Of Head Method Of Restful Web Services?
Answer :
It should return only HTTP Header, no Body and should be read only.
Answer :
Caching refers to storing server response in client itself so that a client needs not to make server request for same resource again and again. A server response should have information about how a caching is to be done so that a client caches response for a period of time or never caches the server response.
Answer :
Date header provides the date and time of the resource when it was created.
Answer :
Last Modified header provides the date and time of the resource when it was last modified.
Question 31. Which Header Of Http Response Provides Control Over Caching?
Answer :
Cache-Control is the primary header to control caching.
Question 32. Which Header Of Http Response Sets Expiration Date And Time Of Caching?
Answer :
Expires header sets expiration date and time of caching.
Answer :
Public directive indicates that resource is cacheable by any component.
Answer :
Private directive indicates that resource is cachable by only client and server, no intermediary can cache the resource.
Answer :
no-cache/no-store directive indicates that resource is not cacheable.
Answer :
max-age directive indicates that the caching is valid up to max-age in seconds. After this, client has to make another request.
Answer :
must-revalidate directive provides indication to server to revalidate resource if max-age has passed.
Question 38. What Are The Best Practices For Caching?
Answer :
Always keep static contents like images, css, JavaScript cacheable, with expiration date of 2 to 3 days. Never keep expiry date too high.
Dynamic contents should be cached for few hours only.
Answer :
As RESTful web services work with HTTP URLs Paths so it is very important to safeguard a RESTful web service in the same manner as a website is be secured. Following are the best practices to be followed while designing a RESTful web service:
Question 40. What Is The Purpose Of Http Status Code?
Answer :
HTTP Status code are standard codes and refers to predefined status of task done at server. For example, HTTP Status 404 states that requested resource is not present on server.
Question 41. What Http Status Code 200 States?
Answer :
It means, OK, shows success.
Question 42. What Http Status Code 201 States?
Answer :
It means, CREATED, when a resource is successful created using POST or PUT request. Return link to newly created resource using location header.
Question 43. What Http Status Code 204 States?
Answer :
It means, NO CONTENT, when response body is empty for example, a DELETE request.
Question 44. What Http Status Code 304 States?
Answer :
It means, NOT MODIFIED, used to reduce network bandwidth usage in case of conditional GET requests. Response body should be empty. Headers should have date, location etc.
Question 45. What Http Status Code 400 States?
Answer :
It means, BAD REQUEST, states that invalid input is provided e.g. validation error, missing data.
Question 46. What Http Status Code 401 States?
Answer :
It means, FORBIDDEN, states that user is not having access to method being used for example, delete access without admin rights.
Question 47. What Http Status Code 404 States?
Answer :
It means, NOT FOUND, states that method is not available.
Question 48. What Http Status Code 409 States?
Answer :
It means, CONFLICT, states conflict situation while executing the method for example, adding duplicate entry.
Question 49. What Http Status Code 500 States?
Answer :
It means, INTERNAL SERVER ERROR, states that server has thrown some exception while executing the method.
Answer :
JAX-RS stands for JAVA API for RESTful Web Services. JAX-RS is a JAVA based programming language API and specification to provide support for created RESTful Webservices. Its 2.0 version was released in 24 May 2013. JAX-RS makes heavy use of annotations available from Java SE 5 to simplify development of JAVA based web services creation and deployment. It also provides supports for creating clients for RESTful web services.
Restful web service Related Tutorials |
|
---|---|
Web Service Testing Tutorial | Web Services Tutorial |
Core Java Tutorial | Java-Springs Tutorial |
CSS Tutorial | Restful web service Tutorial |
Spring MVC Framework Tutorial |
Restful web service Related Practice Tests |
|
---|---|
Web Services Practice Tests | Core Java Practice Tests |
Java-Springs Practice Tests | CSS Practice Tests |
Amazon Web Services (AWS) Practice Tests | Spring MVC Framework Practice Tests |
All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.