Api testing interview Questions.docx2
Api testing interview Questions.docx2
1. Functional Testing
2. Load Testing
3. Security Testing
4. Validation Testing
5. Integration Testing
6. Penetration Testing
7. Error Detection
8.
Explain the difference between SOAP and REST APIs.
1. SOAP: Uses XML, is protocol-based, and provides stricter security and transaction
compliance.
2. REST: Uses JSON, XML, or other formats, is lightweight, and operates over HTTP
with more flexibility.
1. Postman
2. SoapUI
3. JMeter
4. Swagger
5. RestAssured
6. cURL
What is the difference between GET, POST, PUT, and DELETE methods
in REST API?
Use tools like Postman or cURL to send requests and validate responses.
Alternatively, use scripting languages like Python or Java for automation.
What is JSON and XML? How are they used in API testing?
Tool-Based Questions
Have you used Postman or any similar API testing tool? What features do
you like the most?
Have you heard of tools like Swagger or JMeter? What is their use in API
testing?
Use tools like Postman, RestAssured, or libraries in languages like Python (e.g.,
requests) to write automated test scripts.
Have you written any scripts for API testing using tools like Postman,
Python, or Java?
import requests
response =
requests.get("https://api.example.com/data")assert
response.status_code == 200
What is API mocking, and why is it used?
API mocking creates fake responses for APIs that are not fully developed or
unavailable, enabling testing in isolated environments.
A mock server mimics the behavior of a real API. It is used during testing
when the actual API is unavailable or incomplete. Mock servers help simulate
responses to test client applications.
What challenges have you faced (or do you think you might face) in API
testing?
Behavioral Questions
What steps do you follow to test an API from scratch?
Example:
"During API testing, I found that the API was exposing sensitive user data in
plain text. Reporting it to the development team helped secure the data and
avoid a potential breach."
Can you write a sample API request in Postman?
Answer:
POST Request Example: