Are you a candidate looking to sharpen your skills? Try our practice tests or view sample interview questions & Get hired by the best. Click Here×

Online ASP .NET Web API Test

Topics Covered

  • Message Handlers
  • Web API Controller
  • Query Validation Methods
  • Custom Handlers
  • Cookies and Client Request

Useful for hiring

  • .Net Web API Developer (0-3 yrs of experience) 
  • ASP .Net Web API Developer 

Start hiring job-fit candidates using this assessment

GET A DEMO

"We realized that to acquire quality talent, our recruitment process was in dire need of automation. Too many of our technicalteam were simply wasting hours conducting interviews that did not yield the desired results. For us the foremost criteria were to finda recruitment partner who could tick all the right boxes"

Rehana Nisar, Gartner,
Global Product & Services Recruitment Head
Question

What will happen when you execute the following code? 

using (var client = new HttpClient())
// New code:
client.BaseAddress = new Uri ("http://localhost:9000/");
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new
MediaTypeWithQualityHeaderValue ("application/json"));

Note: There can be multiple correct answers to this question.

Answer
    • This code will set the base URI for HTTP requests, and set the Accept header to "application/json", which tells the server to receive data in JSON format.

    • It will throw an error due to incorrect request

    • Will receive data only in JSON format

    • This code will set the base URI for HTTP requests, and set the Accept header to "application/json", which tells the server to send data in JSON format.

Question

On the server side, the Web API pipeline uses which of the following built-in message handlers?

Note: There can be multiple correct answers to this question.

Answer
    • it uses only client-side handlers HttpRoutingDispatcher only

    • HttpServer

    • HttpRoutingDispatcher

    • HttpControllerDispatcher

Question

What will happen if ReadAsAsync is called with no parameters?

Note: There can be multiple correct answers to this question.

Answer
    • In debug mode, exception will occur

    • Method uses the default set of media type formatters to read the response body

    • Method will display null as a result

Good News! You can customize this test as per your requirement

  • Choose and add questions from Interview Mocha question libraries

  • Add your own set of questions

  • Customize test settings like duration, number of questions, passing score, web proctoring and much more

  • Mail us at support@interviewmocha.com to create a custom test

Looking for a tailor-made test, to suit your assessment needs?

Get in touch

Global companies using Mocha assessments

  • altran
  • credit suisse
  • sephora
  • nielsen
  • capgemini
  • akamai

How Mocha assessments are brewed

Speed up your IT recruitment with Interview Mocha

  • 500+ IT skill tests
  • 20+ coding languages
  • 50+ domain knowledge tests
  • 100+ digital 2.0 skill tests
  • Customer focus aptitude tests
  • Enterprise ready features & more...
GET A DEMO

Why hiring managers and recruiters across the globe love Interview Mocha

Take your first step to hire job fit candidates

GET A DEMO