REST Interview Questions

Q.Notes on REST:

 Rest stands for Representational State Transfer. Rest is stateless, which means it does not remember any info about client.
Data sent between server and clients are called as payloads.
Rest promotes loose coupling 
Operations in Rest are as below:
GET: Retrieves resources
PUT: Creates Resources
POST: Updates Resources
DELETE: Delete Resources
PATCH: Update/Modify

Q.What is HATEOAS?

HATEOAS stands for, Hypermedia As The Engine Of Application State.
Clients interact with REST API entirely through the response by the server.
The core principle of HATEOAS is resources should be discoverable through the publication of links.
In short, HATEOAS is a standardization for documentation.

Q. Difference between SOAP and REST API?

REST API  SOAP(Simple Object Access Protocol)
This is an architectural style. This is a protocol.
A rest client is like a browser. Its a generic client who knows how to use protocol and methods. SOAP client works like a desktop application tightly coupled to the server.
It needs ACID compliance.
Rest we can use JSON, XML, text, HTML, etc SOAP uses only XML format.
It has better scalability and performance. Soap is less scalable comparatively.
The rest can be cached. SOAP can not be cached.
Rest has inbuilt error handling SOAP does not have inbuilt error handling.
Rest does not have any predefined security procedure. SOAP is used for an application that requires high security and complex transaction.

Q. Some Common REST Response Codes.

  • 200 - Success
  • 404 - Resource Not Found
  • 400 - Bad Request
  • 201 - Created
  • 401 - Unauthorized
  • 500 - Server Error
Previous
Next Post »

Pages