Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

A _____ status code indicates that a request was successful and as a result, a resource has been created.

Answer»

A _____ status code INDICATES that a request was SUCCESSFUL and as a RESULT, a resource has been created.
Choose the correct option from below list
(1)200
(2)201
(3)400
(4)401

Answer:-(2)201

2.

What are the five main symptoms of Bot Attacks on APIs

Answer»

What are the five main symptoms of Bot Attacks on APIs
Below are the 5 main symptoms of Bot Attacks on APIs
(1)When got offen single REQUEST from DIFFERENT unique browser, session or a device.
(2)If suddenly below errors are increased
(i)HTTP Status Code 404
(ii)Data Validation Failures errors
(iii)Authorization Failures
(3)When usage from single IP address or API token has been Extremely high.
(4)A sudden CHANGES in API usage from large, distributed IP addresses.
(5)When ratio has been increased of GET/POST to HEAD requests for a user/session/IP address/API token compared to legitimate users.

3.

How to set only JSON output in WebApiConfig file in App_Start folder?

Answer»

How to set only JSON output in WEBAPICONFIG file in App_Start folder?
In Web API some TIME we need only JSON output we can do this by MANY method but to get only JSON DATA in browser we use below code to be APPLY in WebApiConfig file in App_Start folder.
config.Formatters.Remove(config.Formatters.XmlFormatter);

4.

Getting error in dotnet "EntityFrameworkCore does not exist in the namespace Microsoft"

Answer»

Getting error in dotnet EntityFrameworkCore does not EXIST in the namespace Microsoft.
Below are the 5 steps which may resolev this issue
(1)First do right CLICK on PROJECT in the solution explorer.
(2)Now select unload project from MENU appears on solution exploerer.
(3)Now after unloading project now click EDIT .csproj and check if there is a Package Reference to EF.
(4)Now in this step right click on project again in the solution explorer.
(5)Now we will reload the project.
Now the system will recognizes EntityFrameworkCore and there are no more build errors.

5.

Step to publish Web API on IIS Server?

Answer»

Step to publish Web API on IIS Server?
In below step first we will publish asp.net web api then will host on to the server. Below are the different steps to publish and deploy the Web API.
(1)First we will build ASP.NET web API project and solution in release mode.
(2)Now in next step we will right CLICK on Web API project and click "Publish" menu as given in below screen


WebAPI Publish
(3)In next step Publish Web PANE is opened where we NEED to click on Profile tab on left. And there is "Select or import a PUBLIC profile" in which you can either choose existing one or create new publish profile as in the below image


WebAPI Profile
after that we will click on ok and move on the connection tab in publish web.
(4)In next screen we will get below screen where we choose the File System in publish method and choose desired location in Target Location which we will used to map IIS.


WebAPI Profile2
(5)Now we choose configuration mode Release as in the following image and click on Next button.


WebAPI Configure
There are some options such as Delete all existing files prior to publish which means it delete all existing files in target location publish folder and create new files.
(6)Now we get publish preview which shows publish path and profile name.

WebAPI publish
Now click on publish button and all published files created at target location as in the following image


WebAPI publishWebAPI
Now to Host below are the three step
(1)Open IIS by click inetmgr
(2)In the IIS manager, Right click on Sites under Connections pane as in the following image


IIS Manager
(3)In last step we will put sitename,application pool and also physical path as gievne below


IIS Manager Part
Now API IS ready for test

6.

What do you mean by Rate Limiting in API?

Answer»

What do you mean by Rate Limiting in API? As we knows APIs provides FUNCTIONALITIES and some certain resources to the CLIENTS who are using API. We will take some example to understand APIs service like you SUPPOSE to book a table in restaurant from websites through the API to make reservations. Now comes Rate Limiting it is a process to restrict the user number of request for some specific RESOURCE for a certain period of time. Here service provider will offers API to clients which will have a limitation on request made by consumer within a SPECIFIED window of time. Here each unique IP/User Address/Client key will have a limit the number of requests to API endpoint.