REST API Interview Questions and Answers - PLM Developer

Here are the few commonly asked Interview Questions and Answers on RESTful web services. 


REST API Interview Questions:


Q. What is REST and RESTful web service?

A. REST stands for Representational state transfer which is an architectural style for creating web service using HTTP (or) HTTPS protocol.

RESTful is referred to as a web service written by applying REST architectural concepts. In RESTful web service, HTTP methods GET, POST, PUT and DELETE are used to perform CRUD operations.


Q. What are the HTTP methods supported by REST?

GET: It requests resources at the request URL. This is a read-only operation.

POST: This operation is used to create a new resource or update an existing resource.

PUT: It requests for updating or modify the resource.

DELETE: This request is used to delete the resource on the server.

OPTIONS: This request fetches the list of options of resources available on the server.

HEAD: This request URL returns meta information.


Q. What are the characteristics of REST?

A. Stateless - REST API is stateless which means the server doesn't maintain any state so, each request is treated as a new request.


Q. What is URI?

A. URI stands for Uniform Resource Identification. Every resource in a REST architecture is identified by its URI.

In REST web service URI is used t locate resources on the server host.


Q. What are JAX-WS and JAX-RS?

A. Both JAX-WS and JAX-RS are libraries or APIs used to provide communication in various ways in Java. 

JAX-WS is a library used to create SOAP communication in Java. JAX-RS is a library to create REST communication in Java.


Q. What are the tools used for testing Web services?

  • SOAP UI
  • Postman
  • Poster from Firefox web browser

 

Q. What is the difference between REST and SOAP?

  • SOAP stands for Simple Object Access Protocol.
  • REST stands for Representational state transfer.
  • SOAP is protocol.
  • REST is an architectural style.
  • SOAP permits the only XML.
  • REST supports many data formats such as XML, JSON, and HTML
  • SOAP slower than REST.
  • REST is faster than SOAP.


Q. What are the HTTP status codes?

A. HTTP status codes are the representation of the status of the task performed n the server which returns in the form of code. Each code has its meaning.

  • 200 - This code indicates success.
  • 201 - This code indicates the resource has been successfully created.
  • 204 - This code indicates that there is no content in the response body.
  • 404 - This code indicates that there is no such method available.

See Also:

👉Java Interview Questions & Answers 1

👉Java Interview Questions & Answers 2

👉Java Interview Questions & Answers 3



Post a Comment

0 Comments