C# is one of the most popular object-oriented programming languages, in this section you can find a list of common interview questions for this languaje.
Click on the question that you would like to read.
What is an API?
An API (Application Programming Interface) is a software that allows two applications to communicate with each other.
An API is generally considered as a service that basically provides us information or data from the server.
What is the difference between API and Web services?
Web Serviced | API |
---|---|
All web services are APIs. | All APIs are not web services. |
It supports XML. | Responses are formatted using Web API’s MediaTypeFormatter into XML, JSON, or any other given format. |
You need a SOAP protocol to send or receive and data over the network. Therefore it does not have light-weight architecture. | API has a light-weight architecture. |
It can be used by any client who understands XML. | It can be used by a client who understands JSON or XML. |
Web service uses three styles: REST, SOAP, and XML-RPC for communication. | API can be used for any style of communication. |
It provides supports only for the HTTP protocol. | It provides support for the HTTP/s protocol: URL Request/Response Headers, etc. |
Advantages of API Services
- API supports traditional CRUD (Create Read Update Delete) actions as it works with HTTP verbs GET, PUT, POST, and DELETE.
- API helps you to expose service data to the browser
- It is based on HTTP, which is easy to define, expose in REST-full way.
Disadvantages of API
Here are important drawbacks/cons of using API services:
- Creating API is a very time-consuming process
- A fixed scale is necessary
- Imprecise boundary delineation
- To create API, programming knowledge is necessary
- Maintenance cost is very high
- It can crash when testing API