API Interview Questions Flashcards

1
Q

What is an API

A

(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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the main differences between API and Web Service

A
  • 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.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the Limits of API Usage

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are some architectural styles for creating a Web API

A
  • HTTP for client-server communication
  • xml/json as formatting language
  • Simple Uri as the address for the services
  • stateless communication
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Who can use a Web API

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is API testing

A

kind of software testing that determines if the developed APIs meet expectations regarding the functionality, reliabilitym performance and security of the application.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are advantages of API Testing

A
  • Test for Core Functionality
  • Time effective
  • Language-independent
  • Easy integration with GUI
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is an API test for core functionality

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is an API test for Time Effective

A

How quickly can the process respond and how much workload it can handle

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is an API test for Language-Indepenpendent

A

Data is exchanged using XML or JSON. These transfer modes are completely language-independent.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is an API test for Easy Integration with GUI

A

and example would be a simple integration would allow new user account to be created within the application before a GUI test started

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are some common protocols used in API testing

A

JMS, REST, HTTP, UDDI and SOAP

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the test environment of API?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are principles of an API test design

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are common API testing types

A
  • Validation Testing
  • Functional Testing
  • UI testing
  • load testing
  • runtime/ error Detection
  • Security testing
  • penetration testing
  • fuzz testing
  • interoperability and WS compliance testing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is API documentation

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What are some common API documentation templates used

A

Swagger
slate
restDoc
FlatDoc
Miredot

18
Q

What must be considered

A
  • Source of the content
  • document plan or sketch
  • Delivery layout
  • information needed for every function in the document
  • Automatic document creation prgrams
19
Q

How often are the APIs changed and, more importantly deprecated

A

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.

20
Q

What is REST

A

(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.

21
Q

What is a Resource in REST

A

REST architecture treats any content as a resource, Which can be either text files, HTML pages, images, videos or dynamic business information

22
Q

Which protocol is used by RESTful Web services?

A

HTTP protocol

23
Q

What are some key characteristics of REST

A
  • 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
24
Q

What is messaging in RESTful Web services

A

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

25
Q

What are the core components of an HTTP Request

A
  1. action showing HTTP methods like GET, PUT, POST, DELETE
  2. URI (Uniform Resource Identifier, which is the identifier for the resource on the server.
  3. HTTP Version, which indicates HTTP version, for example-HTTP v1.1.
    4.Request Header, Which carriers metadata (as key-value pairs) metadata coud be a client (or browser) type, format supported by the client, format of a message body format, cache settings, and so on.
  4. Request Body, which indictes the message content or resource representation
26
Q

What is a GET method

A

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. should never be used when dealing with sensitive data

27
Q

What is a POST method

A

Is uesed to send data to a server to create/update a resource. POST requests are never cached and bookmarked and do not remain in the browser history.

28
Q

What is a PUT method

A

replaces all current representations of the target resource with the request payload.

29
Q

what is a DELETE method

A

removes the specified resource

30
Q

OPTIONS

A

is used to descrine the communication options for the target resource.

31
Q

HEAD

A

asks for a response identical to that of a GET request, but without the response body

32
Q

What is URI and main purpose of REST-bases web services

A

URI stands for Uniform Resource Identifier. It is a string of characters desined for unambiguous identification of resources and extensibility via the URI scheme.

Tje prupose of URI is to locate a resource on the server hosting of the web service

33
Q

What is the URI format

A

<protocol>://<service-name>/<ResourceType>/<ResourceID>.
</ResourceID></ResourceType></service-name></protocol>

34
Q

What is the upper limit for a payload to pass in the POST nmethod

A

Doesn’t have any such limit but large payloads can have performance issues

35
Q

What is the upper limit for a payload to pass in the Get method

A

appends data to the service URL meaning its size shouldn’t exceed the maximum URL length

36
Q

What is the caching mechanism

A

Cashing is just the practice of storing data in temporarily and retrieving data from high-performance store (usually memory) either explicitly or implicitly.

When a caching mechanism is in place, it helps improve delivery speed by storing a copy of the asset you requested and later accessing the cached copy instead of the original

37
Q

What is SOAP Web services

A

(Simple Object Access Protocol) is defined as an XML-based protocol. It is known for designing and developing web services as well as enabling communication between applications developed on different platforms using various programming languages over the Internet.
it is platform and language independent

38
Q

How does SOAP work

A

used to provide a user interface that can be accessed by the client object, the request that it sends goes to the server, which can be accessed using the server object.
It uses http to send the XML to the server using the POST method

39
Q

When to use SOAP API?

A

Use the SOAP API to create, retrieve, update or delete records. you can also use SOAP API to manage paswords, perform searches.

40
Q

What is the major obstacle users faced when using SOAP

A

The firewall security mechanism as the biggest obstacle. This blocks all the ports leaving few HTTP ports like port 80 and the HTTP port used by SOAP that bypasses the firewall. It mixes the specification for message transport with the specification for message structure

41
Q

What are the advantages of SOAP

A
  • platform and language independent
  • separates the encoding and communications protocol from the runtime environment
  • Web service can retrive or recieve a SOAP user data from a remote service.
  • Everything can generate XNL
  • uses standard internet HTTP protocol.
  • eliminates firewall problems
  • relatively easy to uses
42
Q

what are the disadvantages of SOAP

A
  • Usually limited to pooling and not to event notifications when HTTP is used for the tranport
  • typically slower than other types of middleware
  • there is usually firewall latency
  • SOAP in python is not as powerful as it is in Java and .NET