Top 61 API Testing Interview Questions and Answers 1721572284
Top 61 API Testing Interview Questions and Answers 1721572284
com
9123820085
kasper-analytics
kasperanalytics.com
9123820085
1. What is an API?
In an API testing interview, you could be asked to give some API examples, here
are the well-known ones: Google Maps API, Amazon Advertising API, Twitter API,
YouTube API, etc.
• All Web services are APIs but not all APIs are Web services.
• Web services might not contain all the specifications and cannot perform
all the tasks that APIs would perform.
• A Web service uses only three styles of use: SOAP, REST and XML-RPC for
communication whereas API may be exposed to in multiple ways.
• A Web service always needs a network to operate while APIs don’t need a
network for operation.
Many APIs have a certain limit set up by the provider. Thus, try toestimate your
usage and understand how that will impact theoverall cost of the offering.
Whether this will be a problem depends in large part on how data is leveraged.
Getting caught by a quota and effectively cut-off because of budget limitations
will render the service (and any system or process depending on it) virtually
useless.
kasper-analytics
kasperanalytics.com
9123820085
This is one of the fundamental Web API interview questions. Bellows are four
common Web API architectural styles:
Web API can be consumed by any clients which support HTTP verbs such as GET,
PUT, DELETE, POST. Since Web API services do not require configuration, they can be
easily used by any client. In fact, even portable devices such as mobile devices
can easily use Web API, which is undoubtedly the biggest advantage of this
technology.
kasper-analytics
kasperanalytics.com
9123820085
In an API interview, they are likely to ask about the advantages of API testing. So be
prepared with the significant ones such as:
• Test for Core Functionality: API testing provides access to the application
without a user interface. The core and codelevel of functionalities of the
application will be tested and evaluated early before the GUI tests. This will
help detect the minor issues which can become bigger during the GUI
testing.
• Time Effective: API testing usually is less time consuming than functional
GUI testing. The web elements in GUI testing must be polled, which makes
the testing process slower. Particularly, API test automation requires less
code so it can provide better and faster test coverage compared to GUI
test automation. These will result in the cost saving for the testing project.
• Language-Independent: In API testing, data is exchanged using XML or
JSON. These transfer modes are completely language-independent,
allowing users to select any code language when adopting automation
testing services for the project.
• Easy Integration with GUI: API tests enable highly integrable tests, which is
particularly useful if you want to perform functional GUI tests after API
testing. For instance, simple integration would allow new user accounts to
be created within the application before a GUI test started.
Many protocols are now available to be used in API testing, such as JMS, REST,
HTTP, UDDI and SOAP.
Setting up the API’s test environment is not an easy task, so you should have a
ready answer if your API testing interview is coming. The test environment of API is
a bit complete and requires the configuration of the database and server,
kasper-analytics
kasperanalytics.com
9123820085
When the installation process is complete, API is verified for the proper operation.
Throughout the process, the API called from the original environment is set up with
different parameters to study the test results.
While there are certainly specialty tests, and no list can be asked to be
comprehensive in this realm, most tests fit broadly into these following nine
categories that you should remember before attending in an API testing interview.
1. Validation Testing
2. Functional Testing
3. UI testing
4. Load testing
5. Runtime/ Error Detection
6. Security testing
7. Penetration testing
8. Fuzz testing
9. Interoperability and WS Compliance testing
kasper-analytics
kasperanalytics.com
9123820085
During the API testing process, a request is raised to the API with the known data.
This way you can analyze the validation response. While testing an API, you should
consider:
• Accuracy of data
• Schema validation
• HTTP status codes
• Data type, validations, order and completeness
• Authorization checks
• Implementation of response timeout
• Error codes in case API returns, and
• Non-functional testing like performance and security testing
kasper-analytics
kasperanalytics.com
9123820085
Learn more: SoapUI vs Postman, Katalon Studio: A Review of Top 3 API Tools
(https://www.katalon.com/resourcescenter/blog/soapui-vs-postman-katalon-
api-tools/) (https://www.katalon.com)
16. What are differences between API Testing and Unit Testing?
kasper-analytics
kasperanalytics.com
9123820085
On the other hand, UI ( User Interface) testing refers to testing graphical interface
such as how users interact with the applications, testing application elements like
fonts, images, layouts etc. UI testing basically focuses on look and feel of an
application.
If you can overcome the challenges in API Testing, you can be confident in the API
testing interview too. They are:
• Parameter Selection
• Parameter Combination
• Call sequencing
• Output verification and validation
• Another important challenge is providing input values, which is very difficult
as GUI is not available in this case.
19. What are the testing methods that come under API testing?
One of the most common Web API testing interview questions is about the testing
methods. They are:
kasper-analytics
kasperanalytics.com
9123820085
20. Why is API testing considered as the most suitable form for Automation
testing?
API testing is now preferred over GUI testing and is considered as most suitable
because:
• It verifies all the functional paths of the system under test very effectively.
• It provides the most stable interface.
• It is easier to maintain and provides fast feedback.
Not only API fundamental questions, the interviewer also determine your
knowledge and experience by asking about the API errors in a Web API testing
interview. So the most common ones are:
kasper-analytics
kasperanalytics.com
9123820085
22. What kinds of bugs that API testing would often find?
kasper-analytics
kasperanalytics.com
9123820085
24. What are API documentation templates that are commonly used?
There are several available API documentation templates help to make the entire
process simple and straightforward, which could be answered in your API testing
interview, such as:
• Swagger
• Miredot
• Slate
• FlatDoc
• API blueprint
• RestDoc
• Web service API specification
kasper-analytics
kasperanalytics.com
9123820085
26. How often are the APIs changed and, more importantly, deprecated?
APIs, especially modern RESTful APIs, are a nice creation that can certainly simplify
and accelerate integration efforts, which makes it more likely you will benefit from
them. But APIs can and do change for various reasons, sometimes abruptly, and
hence REST APIs do not differ from traditional integration methods in this respect.
If an API call is obsolete and disappears, your procedure will interrupt and it is
important to understand how often the APIs you depend on change or are
deprecated.
In REST architecture, a REST Server provides access to resources and REST client
accesses and makes these resources available. Here, each resource is identified
by URIs or global IDs, and REST uses multiple ways to represent a resource, such as
text, JSON, and XML. XML and JSON are nowadays the most popular
representations of resources.
Mostly, there are two kinds of Web Services which should be remembered in your
next API testing interview:
kasper-analytics
kasperanalytics.com
9123820085
REST architecture treats any content as a resource, which can be either text files,
HTML pages, images, videos or dynamic business information.
REST Server gives access to resources and modifies them, where each resource is
identified by URIs/ global IDs.
REST uses different representations to define a resource like text, JSON, and XML.
Key characteristics of REST are likely asked in a Web API Testing interview. So
please get the answer ready in your mind with these 2 ones:
• REST is stateless, therefore the SERVER has no status (or session data) With
a well-applied REST API, the server could be restarted between two calls,
since all data is transferred to the server
kasper-analytics
kasperanalytics.com
9123820085
• Web service uses POST method primarily to perform operations, while REST
uses GET for accessing resources.
RESTful web services use the HTTP protocol as a communication tool between the
client and the server. The technique that when the client sends a message in the
form of an HTTP Request, the server sends back the HTTP reply is called
Messaging. These messages comprise message data and metadata, that is,
information on the message itself.
35. What are the most commonly used HTTP methods supported by REST?
• GET is only used to request data from a specified resource. Get requests
can be cached and bookmarked. It remains in the browser history and haS
length restrictions. GET requests should never be used when dealing with
sensitive data.
kasper-analytics
kasperanalytics.com
9123820085
The PUT or POST method should be used to create a resource. GET is only used to
request data from a specified resource.
PUT and POST operation are quite similar, except the terms ofthe result generated
by them.
PUT operation is idempotent, so you can cache the response while the responses
to POST operation are not cacheable, and if you retry the request N times, you will
end up having N resources with N different URIs created on server.
In a Web API Testing interview, you should give a specific example for PUT and
POST operations to make crystal clear to the interviewer. Below is an example:
Scenario: Let’s say we are designing a network application. Let’s list down few URIs
and their purpose to get to know when to use POST and when to use PUT
operations.
kasper-analytics
kasperanalytics.com
9123820085
38. Which purpose does the OPTIONS method serve for the RESTful Web
services?
The OPTIONS Method lists down all the operations of a web service supports. It
creates read-only requests to the server.
39. What is URI? What is the main purpose of REST-based web services and what
is its format?
URI stands for Uniform Resource Identifier. It is a string of characters designed for
unambiguous identification of resources and extensibility via the URI scheme.
The purpose of a URI is to locate a resource(s) on the server hosting of the web
service.
The “payload” is the data you are interested in transporting. This is differentiated
from the things that wrap the data for transport like the HTTP/S Request/Response
41. What is the upper limit for a payload to pass in the POST method?
<GET> appends data to the service URL. But, its size shouldn’t exceed the
maximum URL length. However, <POST> doesn’t have any such limit.
kasper-analytics
kasperanalytics.com
9123820085
So, theoretically, a user can pass unlimited data as the payload to POST method.
But, if we consider a real use case, then sending POST with large payload will
consume more bandwidth. It’ll take more time and present performance
Caching is just the practice of storing data in temporarily and retrieving data
a copy of the asset you requested and later accessing the cached copy instead
of the original.
kasper-analytics
kasperanalytics.com
9123820085
This is one of the fundamental Web services testing questions that you must know
the answer. The SOAP (Simple Object Access Protocol) is defined as an XML-
based protocol. It is known for designing and developing web services as well as
using various programming languages over the Internet. It is both platform and
language independent.
SOAP is used to provide a user interface that can be accessed by the client object,
and the request that it sends goes to the server, which can be accessed using the
server object. The user interface creates some files or methods consisting of
server object and the name of the interface to the server object. It also contains
other information such as the name of the interface and methods. It uses HTTP to
send the XML to the server using the POST method, which analyzes the method
and sends the result to the client. The server creates more XML consisting of
responses to the request of user interface using HTTP. The client can use any
approach to send the XML, like the SMTP server or POP3 protocol to pass the
kasper-analytics
kasperanalytics.com
9123820085
Use the SOAP API to create, retrieve, update or delete records, like accounts, leads,
and user-defined objects. With more than 20 different calls, you can also use the
SOAP API to manage passwords, perform searches, etc. by using the SOAP API in
into the web page. It receives the XML file as an argument and transports
the XML file to XML parser liaison, which reads it and inserts it into the SOAP
call as a parameter.
• GetAddress(): It is used to get a query name and gets the result that best
matches a query. The name is sent to the SOAP call in the form of text
character string.
47. What is the major obstacle users faced when using SOAP?
When using SOAP, users often see the firewall security mechanism as the biggest
obstacle. This block all the ports leaving few like HTTP port 80 and the HTTP port
used by SOAP that bypasses the firewall. The technical complaint against SOAP is
that it mixes the specification for message transport with the specification for
message structure.
kasper-analytics
kasperanalytics.com
9123820085
48. What are the various approaches available for developing SOAP based web
services?
There are two different methods available for developing SOAP based web
• Contract-first approach: the contract is first defined by XML and WSDL, and
• Contract-last approach: Java classes are first defined, and then the
contract is generated, which is normally the WSDL file from the Java class.
Envelope: It is an obligatory root element that translates the XML document and
defines the beginning and end of the message. Header: It is an optional item
which contains information about the message being sent. Body: It contains the
XML data comprising the message being sent. Fault: It provides the information on
kasper-analytics
kasperanalytics.com
9123820085
Application layer and transport layers of a network are used by SOAP; HTTP and
SMTP are the valid protocol of the application layer used as the transport for
SOAP. HTTP is more preferable, since it works well with the current Internet
infrastructure, in particular with firewalls. The SOAP requests can be sent using an
HTTP GET method while the specification only contains details about HTTP POST.
one.
• The SOAP envelope is indicated by the prefix ENV and the envelope
element.
• The optional SOAP encoding is also specified using a namespace and the
kasper-analytics
kasperanalytics.com
9123820085
53. What are the major functionalities provided by the SOAP protocol class?
The SOAP protocol is used to provide simple access methods for all the
• Call: A class which provides the main functionality for a remote method for
which a call is needed. It is used to create the call() and to specify the
encoding style of the registry that will be assigned when if necessary. This
call() function is used by the RPC call, which represents the options of the
call object.
SOAP services. It enables easy deployment without the need for other
approaches.
• DOM2 Writer: A class that serializes and uses DOM node as XML string to
• RPC Message: A class used as the base class that calls and replies to the
• Service Manager: A class that provides, lists and then outputs all SOAP
services.
54. What are the web relation functionalities provided by SOAP protocol?
HTTPUtils: This provides the functionality of the POST method to safely meet the
requirements.
Parameter: It is an argument for an RPC call used by both the client and the
server.
kasper-analytics
kasperanalytics.com
9123820085
Response: It is an object that represents an RPC reply from both client and server,
but the result will not be displayed until after the method call.
TCPTunnel: It is an object that provides the ability to listen on a specific port and
TypeConverter: It helps to convert an object of one type into another type and this
55. How does the message security model allow the creation of SOAP more
secure to use?
The security model includes the given security tokens. These tokens comprise
tokens can be used to provide the bond between authentication secrets or keys
and security identities. Security token uses the authentication protocols and an
X.509 certificate to define the relationship between the public key and identity key.
The signatures are used to verify the messages and their origin, generate
knowledge to confirm the security tokens to bind the identity of a person to the
identity of the originator. Security model prevents different attacks and can be
56. What is the difference between top down & bottom up approach in SOAP
Web services?
• Top down SOAP Web services include creating WSDL document to create a
contract between the web service and the client, with a required code as
kasper-analytics
kasperanalytics.com
9123820085
confirm the contract defined in WSDL. One of the benefits of this method is
• Bottom up SOAP web services require the code to be written first and then
and client codes must wait for WSDL from the server side to start working.
runtime environment.
• Web service can retrieve or receive a SOAP user data from a remote
of each other.
• Everything can generate XML, from Perl scripts through C++ code to J2EE
app servers.
• SOAP runs over HTTP; it eliminates firewall problems. When protocol HTTP is
an HTTP request, and the RPC response will be assigned to an HTTP reply.
kasper-analytics
kasperanalytics.com
9123820085
decentralized environment.
(https://searchmicroservices.techtarget.com/definition/middleware) standards,
around SOAP is hence required. SOAP is usually limited to pooling and not to event
notifications when HTTP is used for the transport. In addition, only one client can
use the services of one server in typical situations. If HTTP is used as the transport
protocol, firewall latency usually occurs since the firewall analyzes the HTTP
transport. This is because HTTP is also leveraged for Web browsing, and so many
firewalls do not understand the difference between using HTTP within a web
kasper-analytics
kasperanalytics.com
9123820085
SOAP REST
kasper-analytics
kasperanalytics.com
9123820085
SOAP is the heavyweight choice for Web service access. It provides the following
• SOAP is not very easy to implement and requires more bandwidth and
resources.
• WS-Security: While SOAP supports SSL (just like REST) it also supports WS-
• If the security is a major concern and the resources are not limited then we
should use SOAP web services. Like if we are creating a web service for
REST is easier to use for the most part and is more flexible. It has the following
• REST permits many different data formats whereas SOAP only permits XML.
kasper-analytics
kasperanalytics.com
9123820085
• REST allows better support for browser clients due to its support for JSON.
• REST has better performance and scalability. REST reads can be cached,
want to create an API that will be easily used by other developers publicly
• REST is commonly used in social media, web chat, mobile services and
GET.
• REST services are meant to be called by the client-side application and not
• ST in REST comes from State Transfer. You transfer the state around instead
of having the server store it, this makes REST services scalable.
61. What are the factors that help to decide which style of Web services – SOAP
or REST – to use?
kasper-analytics
kasperanalytics.com
9123820085
But you can read the following facts before opting for any of the styles.
Does the service expose data or business logic? REST is commonly used for
The requirement from clients or providers for a formal contract. SOAP can provide
since it’s XML based, requires a SOAP header. However, REST requires less
bandwidth to send requests to the server. Its messages are mostly built using
JSON.
Ease of use. REST based application is easy to implement, test, and maintain.
kasper-analytics
kasperanalytics.com
9123820085
Ready to succeed in your next Web API Testing interview API testing interview
covered. Although the above answers might not fully be used in your interview, we
do hope it somehow provides the solid understanding on Web API testing and
gets you ready for the upcoming job and project related to API testing.
Wish you confidence and luck in your testing career! If you have any suggestions
on this topic, please do not hesitate to add to here. We look forward to a better
kasper-analytics