0% found this document useful (0 votes)
4 views

rest-api-interview-question-answers

The document explains REST (Representational State Transfer) and RESTful services, which utilize HTTP methods for CRUD operations. It outlines the architectural style for web APIs, tools for testing, differences between various web service styles, and key characteristics of REST. Additionally, it compares REST with AJAX and SOAP, discussing their functionalities and performance.

Uploaded by

anirudhan1221
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

rest-api-interview-question-answers

The document explains REST (Representational State Transfer) and RESTful services, which utilize HTTP methods for CRUD operations. It outlines the architectural style for web APIs, tools for testing, differences between various web service styles, and key characteristics of REST. Additionally, it compares REST with AJAX and SOAP, discussing their functionalities and performance.

Uploaded by

anirudhan1221
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

https://www.guru99.

com
---------------------------------------------------------------------------------------------------------------------------------------------

1) Explain what is REST and RESTFUL?

REST represents REpresentational State Transfer; it is a relatively new aspect of writing web API.

RESTFUL is referred for web services written by applying REST architectural concept are called
RESTful services, it focuses on system resources and how state of resource should be transported
over HTTP protocol to different clients written in different language. In RESTFUL web service HTTP
methods like GET, POST, PUT and DELETE can be used to perform CRUD operations.

2) Explain the architectural style for creating web API?

The architectural style for creating web api are

• HTTP for client server communication


• XML/JSON as formatting language
• Simple URI as the address for the services
• Stateless communication

3) Mention what tools are required to test your web API?

SOAPUI tool for SOAP WS and Firefox “poster” plugin for RESTFUL services.

4) Mention what are the HTTP methods supported by REST?

HTTP methods supported by REST are:

• GET: It requests a resource at the request URL. It should not contain a request body as it
will be discarded. Maybe it can be cached locally or on the server.
• POST: It submits information to the service for processing; it should typically return the
modified or new resource
• PUT: At the request URL it update the resource
• DELETE: At the request URL it removes the resource
• OPTIONS: It indicates which techniques are supported
• HEAD: About the request URL it returns meta information

5) Mention whether you can use GET request instead of PUT to create a resource?

No, you are not supposed to use POST or GET. GET operations should only have view rights

6) Mention what are resources in a REST architecture?

Resources are identified by logical URLs; it is the key element of a RESTful design. Unlike, SOAP
web services in REST, you view the product data as a resource and this resource should contain all
the required information.
https://www.guru99.com
---------------------------------------------------------------------------------------------------------------------------------------------

7) Mention what is the difference between AJAX and REST?

AJAX REST
• In Ajax, the request are sent to
the server by using
XMLHttpRequest objects. The
• REST have a URL structure and a
response is used by the
request/response pattern the
JavaScript code to dynamically
revolve around the use of
alter the current page
resources
• Ajax is a set of technology; it is a
• REST is a type of software
technique of dynamically
architecture and a method for
updating parts of UI without
users to request data or
having to reload the page
information from servers
• Ajax eliminates the interaction
• REST requires the interaction
between the customer and
between the customer and
server asynchronously
server
• REST requires the interaction
between the customer and
server

7) Mention some key characteristics of REST?

Some key characteristics of REST includes

• REST is stateless, therefore the SERVER has no state (or session data)
• With a well-applied REST API, the server could be restarted between two calls as every data
is passed to the server
• Web service mostly uses POST method to make operations, whereas REST uses GET to
access resources

8) Mention what are the different application integration styles?

The different integration styles include

• Shared database
• Batch file transfer
• Invoking remote procedure (RPC)
• Swapping asynchronous messages over a message oriented middle-ware (MOM)

9) Explain how JAXB related to RESTful web API?

JAXB stands for java arch for XML binding.


https://www.guru99.com
---------------------------------------------------------------------------------------------------------------------------------------------

10) Mention what is the difference between PUT and POST?

“PUT” puts a file or resource at a particular URI and exactly at that URI. If there is already a file or
resource at that URI, PUT changes that file or resource. If there is no resource or file there, PUT
makes one

POST sends data to a particular URI and expects the resource at that URI to deal with the request.
The web server at this point can decide what to do with the data in the context of specified
resource

PUT is idempotent meaning, invoking it any number of times will not have an impact on resources.

However, POST is not idempotent, meaning if you invoke POST multiple times it keeps creating
more resources

11) Mention which markup language can be used in restful web api?

JSON and XML are the two markup language that can be used in restful web api

12) Mention what is the difference between RPC or document style web services? How you
determine to which one to choose?

In document style web services, we can transport an XML message as part of SOAP request which
is not possible in RPC style web service. Document style web service is most appropriate in some
application where XML message behaves as document and content of that document can alter
and intention of web service does not rely on the content of XML message.

13) Mention what is JAX-WS and JAX-RS?

Both JAX-WS and JAX-RS are libraries (APIs) for doing communication in various ways in Java. JAX-
WS is a library that can be used to do SOAP communication in JAVA, and JAX-RS lets you do the
REST communication in JAVA.

14) List out the tools or API for developing or testing web api?

Testing tools for web services for REST APIs includes

• Spring REST web service using MVC


• Jersey API
• CFX
• Axis
• Restlet,
https://www.guru99.com
---------------------------------------------------------------------------------------------------------------------------------------------

15) Mention what is the difference between SOAP and REST?

SOAP REST
• Rest is a service architecture and
• SOAP is a protocol through which
design for network-based
two computer communicates by
software architectures
sharing XML document
• REST supports many different
• SOAP permits only XML
data formats
• SOAP based reads cannot be
• REST reads can be cached
cached
• A REST client is more like a
• SOAP is like custom desktop
browser; it knows how to
application, closely connected to
standardized methods and an
the server
application has to fit inside it
• SOAP is slower than REST
• REST is faster than SOAP
• It runs on HTTP but envelopes
• It uses the HTTP headers to hold
the message
meta information
https://www.guru99.com
---------------------------------------------------------------------------------------------------------------------------------------------

Guru99 Provides FREE ONLINE TUTORIAL on Various courses like

Java MIS MongoDB BigData Cassandra

Web Services SQLite JSP Informatica Accounting

SAP Training Python Excel ASP Net HBase

Project
Test Management Business Analyst Ethical Hacking PMP
Management

Live Project SoapUI Photoshop Manual Testing Mobile Testing

Data Warehouse R Tutorial Tableau DevOps AWS

Software
Jenkins Agile Testing RPA JUnit
Engineering

Selenium CCNA AngularJS NodeJS PLSQL

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy