API Interview Questions Flashcards
(42 cards)
What is an API
(Application Programming Interface)
A software intermediary that enables two applications to communicate with each other. It comprises a number of subroutine definitions, logs, and tools for creating application software.
What are the main differences between API and Web Service
- All web services are APIs but not all APIs are Web services
- Web services cannot perform all the tasks that APIs would perform
- Web service uses only three stles: SOAP, REST and XML-RPC while and API may be exposed to in multiple ways.
- Web service always needs a network to operate while APIs don’t need a network for operation.
What are the Limits of API Usage
Limitations can be set up by the provider. This, try to estimate your usage and understand how that will impact the overall cost of the offering.
What are some architectural styles for creating a Web API
- HTTP for client-server communication
- xml/json as formatting language
- Simple Uri as the address for the services
- stateless communication
Who can use a 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, the can be easily used by any client.
What is API testing
kind of software testing that determines if the developed APIs meet expectations regarding the functionality, reliabilitym performance and security of the application.
What are advantages of API Testing
- Test for Core Functionality
- Time effective
- Language-independent
- Easy integration with GUI
What is an API test for core functionality
The core and code-level 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
What is an API test for Time Effective
How quickly can the process respond and how much workload it can handle
What is an API test for Language-Indepenpendent
Data is exchanged using XML or JSON. These transfer modes are completely language-independent.
What is an API test for Easy Integration with GUI
and example would be a simple integration would allow new user account to be created within the application before a GUI test started
What are some common protocols used in API testing
JMS, REST, HTTP, UDDI and SOAP
What is the test environment of API?
Requires the configuration of the database and server. The api is then called from the orfiginal environment with different parameters to study the test results
What are principles of an API test design
- Setup: create objects, start services, initialize data, etc
- Execution: ssteps to apply API or the scenario, including logging
- Verification: to evaluate the result of the execution
- Reporting: Pass, failed or blocked
- Clean up: Pre-test state
What are common API testing types
- Validation Testing
- Functional Testing
- UI testing
- load testing
- runtime/ error Detection
- Security testing
- penetration testing
- fuzz testing
- interoperability and WS compliance testing
What is API documentation
The API documentation is a complete, accurate technical writing giving instructions on how to effectively use and integrate with an API. It is a compact reference manual that has all the information needed to work with the API, and helps you answer all the API testing questions with details on functions, classes, return types, arguments, and also examples and tutorials
What are some common API documentation templates used
Swagger
slate
restDoc
FlatDoc
Miredot
What must be considered
- Source of the content
- document plan or sketch
- Delivery layout
- information needed for every function in the document
- Automatic document creation prgrams
How often are the APIs changed and, more importantly deprecated
APIs can and do change for various reasons, sometimes abruptly, and hence Rest APIs do not differ from traditonal integration methods in this respoect. 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.
What is REST
(Representational State Transfer). an architectural style for developing web services which exploit the ubiquity of HTTP protocol and uses HTTP method to define actions. It revolves around resource where every component being a resource that can be accessed through a shared interface using standard HTTP methods.
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 the most popular.
What is a Resource in REST
REST architecture treats any content as a resource, Which can be either text files, HTML pages, images, videos or dynamic business information
Which protocol is used by RESTful Web services?
HTTP protocol
What are some key characteristics of REST
- Rest is stateless, which means the server hs no status ( or session data)
- Web service uses POST method primarily to perform operations, while REST uses GET for accessing resources
What is messaging in RESTful Web services
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