Tuesday, July 17, 2018

Top 10 common API testing interview questions (for Beginner and Intermediate level)


API testing has been considered an indispensable part of the software testing in recent years. It was reported by many testers that the REST API testing interview questions and SOAP API questions could be a huge challenge for them while applying for a test professional position.
Below are the collection of top 10 popular interview questions and answers which will be useful for your upcoming interviews.

1. What and why is API testing?
This is normally the very first and the most basic questions that an interviewer will provide before any other SOAP API questions or REST API testing interview questions.
API testing is a kind of software testing which focuses on deciding whether the built APIs meet expectations about the functionality, performance, security, and reliability for an application.
API testing provides a lot of benefits, particularly in four main aspects:
-       Test for core functionality:
-       Time effective
-       Language-independent
-       Easy integration with GUI

2. Which principles need to be considered when creating an API test design?
-       Setup: Create objects, start services, and initialize the data
-       Execution: Steps to apply API or the scenario, including logging
-       Verification: Oracles to evaluate the result of the execution
-       Reporting: Pass, failed or blocked
-       Clean up: Pre-test state

3. How many types of API testing?
There is no exact number for this API testing interview question, but you can list out the nine main categories below as it almost covers the API testing:
-       Validation Testing
-       Functional Testing
-       UI testing
-       Load testing
-       Runtime/ Error Detection
-       Security testing
-       Penetration testing
-       Fuzz testing
-       Interoperability and WS Compliance testing

4. Name some of the API testing tools
The more API testing is popular, the more tools are available in the market. You can refer to this list for the reference. Generally, there are some common tools that can be your safe answer for the API testing interview question: Postman, Katalon Studio, SoapUI, Tricentis Tosca.

5. Describe the difference between API testing and UI testing
API testing enables the communication between the two separate software systems, where one system implementing an API contains functions or subroutines that may be executed by another software system.
UI  testing is mainly about testing the graphical interface, for example: how users interact with application, testing application elements like fonts, images, layouts etc. In other words, UI testing focuses more on look and feel of an application.

6. What are some common API errors?
In the list of API interview questions, this seems to be more advanced question. Here are some suggested answers:
-       Missing module errors
-       Documentation errors
-       Parameter validation errors
-       Some other standard error expectations:  if the result is not so predicted then the occurrence of errors can be seen and for the same warnings are specified in the form of a message. There can be one or more warnings within an individual module.

7. What is an API documentation:
API documentation refers to complete and accurate technical instructions on how to effectively use and integrate with an API. It includes all the information needed to work with the API, and helps project members understand all the API testing questions including details on functions, classes, return types, arguments, and also examples and tutorials.

8. How to write a good API documentation?
You can refer to some templates which are considered simple to use: Swagger, Miredot, Slate, FlatDoc, RestDoc, so on.
When writing an API document, it is also essential to consider some of the below items:
-       Source of the content
-       Document plan or sketch
-       Delivery layout
-       Information needed for every function in the document
-       Automatic document creation programs

9. Describe your understanding about RESTful web service?
RESTful web service is one of the two types of website besides SOAP. RESTful web services use the 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 like JSON and a set of HTTP methods.
REST contains some major characteristics:
-       The SERVER has no status (or session data) because REST is stateless. With a well-applied REST API, the server could be restarted between two calls, since all data is transferred to the server
-       Web service uses POST method primarily to perform operations, while REST uses GET for accessing resources.
You can get more detailed questions about REST API testing interview questions  here.

10.  Define the SOAP Web service and when to apply it?
The SOAP (Simple Object Access Protocol) refers to an XML-based protocol. It is specialized for designing and developing web services together with enabling communication between applications developed on different platforms using various programming languages over the Internet. It is both platform and language independent.
SOAP API can be used to create, retrieve, update or delete records, like accounts, leads, and user-defined objects. With more than 20 different calls, people can also use the SOAP API to manage passwords, perform searches, etc. by using the SOAP API in any language that supports web services.

More SOAP interview questions are available here for the deep learning about this area.

I hope the 10 questions above could provide you a overview picture about what will happen at the API section of the interview. Of course, it is just the beginning! Try to learn more and prepare yourself with as many SOAP and REST API interview questions as possible. Last but not least, good luck, and do not forget to suggest me with any interesting piece of information collected from your testing journey!