20 Most asked API testing interview questions

Here are 20 Most asked API testing interview questions:

  1. What is API testing and why is it important?
  2. What are the common HTTP methods used in API testing?
  3. How do you test the authentication and authorization of an API?
  4. How do you test the performance of an API?
  5. How do you handle API testing in an Agile development environment?
  6. How do you test error handling in an API?
  7. What are the common tools used for API testing?
  8. How do you test the security of an API?
  9. How do you test the reliability of an API?
  10. How do you test for compatibility in an API?
  11. What are some common challenges in API testing?
  12. How do you test for data integrity in an API?
  13. How do you test for compliance in an API?
  14. How do you test for backward compatibility in an API?
  15. How do you test for documentation in an API?
  16. How do you test for maintainability in an API?
  17. How do you test for scalability in an API?
  18. How do you test for usability in an API?
  19. How do you test for accessibility in an API?
  20. How do you test for internationalization in an API?

Benefits of API Test Automation over UI Test Automation? – Mostly asked Interview Question

API testing has many benefits over UI testing:

  • First, API testing is much faster than UI testing. This is because API tests do not have to wait for a page to load, as they interact directly with the application’s backend.
  • Second, API tests are more reliable than UI tests. This is because UI tests are subject to the vagaries of the user interface, such as changes in the layout or position of elements. API tests, on the other hand, are not affected by such changes.
  • Third, API tests are easier to create and maintain than UI tests. This is because UI tests often require a lot of code to simulate user interactions, whereas API tests only need to make calls to the application’s API.
  • Fourth, with API testing, one can find bugs related to functionality, reliability, performance, and security early in the SDLC and hence those are cheaper to fix.

In conclusion, API testing has many advantages over UI testing, and should be used whenever possible.

Top 15 REST API Interview Questions and Answers

  1. Client/server Error Codes
  2. Success codes
  3. Use of GET, PUT, POST, PATCH, DELETE
  4. Difference between Put and Patch
  5. Difference between Put and Post
  6. How to handle authentication?
  7. Difference between webserver and API
  8. Json/xml structure format
  9. How to validate json response?
  10. Use of JsonPath
  11. How to construct json body for Put, Post, Patch request?
  12. Use of JsonObject.
  13. What’s is URI?
  14. What’s a resource?
  15. What are the common headers used?

~via Shammi Jha (WhatsApp Group)

[Tips] What must be checked when performing API testing?

Seems easy but yet a tricky interview question. Here is the answer by Katalon experts:

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:

  1. Accuracy of data
  2. Schema validation
  3. HTTP status codes
  4. Data type, validations, order and completeness
  5. Authorization checks
  6. Implementation of response timeout
  7. Error codes in case API returns, and
  8. Non-functional testing like performance and security testing

Rest- Assured API Testing Automation Interview Questions

  1. What is difference between API and WebService.
  2. What is difference between SOAP & Rest API.
  3. Can you write a sample of API(URL) and JSON.
  4. How do you handle Authentication token.
  5. How many type of Authentication in POSTMAN/ Rest-Assured.
  6. What is difference between OAuth1.0 and OAuth2.O ,When and where do you use and how. Can you write a sample code.
  7. What is baseURI in RestAssured.
  8. Can you explain RequestSpecification request = RestAssured.given();
  9. What will be returned type of response.jsonPath().getJsonObject(“XYZ”);
  10. How do you extract the values of JSON and how do you validate response.
  11. Can you write a code of save the response in a JSON file.
  12. How do you validate headers of response.
  13. What is difference between Headers and Header class.
  14. What is difference between response.header(“xyz”) and response.headers() methods.
  15. Can you extract all the headers from response at run time.
  16. What is JSONObject() , request.header(“xyz”), response.path(“lable”) , response.body().asString() , response.getBody().prettyPrint(); , RestAssured.given().queryParam(“xyz”,”abc”);
  17. What is difference between request.get(“https//dev-mode.com/api/allcustomers”) and request.request(Method.GET,"/ allcustomers ");
  18. What is difference between PUT and Patch . Have you ever used and where.
  19. What are status code(2xx ,3xx ,4xx, 5xx) in API.
  20. How do you print your response in JSON format.
  21. How do you post body in POST and how many way to post.
  22. What all are the dependency for Rest-Assured.

– Questions shared by Mr. Hari.
Happy Testing