backend development for .net full stack coursera week 3 answers

WebAPI Practice Quiz

1. What does REST stand for?

  • Remote Enterprise Service Technology.
  • Relational Enterprise Service Technology.
  • Representational State Transfer.
  • Remote Environment Service Technology.

2. What is the purpose of exception handling in software development?

  • Exception handling is used to handle runtime errors and prevent program crashes.
  • Exception handling is a technique for optimizing code performance and memory usage.
  • Exception handling is a design pattern used to enforce modularity and code reusability.
  • Exception handling is a method for securing sensitive data and preventing unauthorized access.

3. What is the difference between WCF and Web API?

  • WCF is used for building RESTful web services, while Web API is used for building SOAP-based web services.
  • WCF uses HTTP as the underlying protocol, while Web API uses TCP.
  • WCF provides more features for building enterprise-level services, while Web API is a lightweight framework for building RESTful services.
  • There is no difference between WCF and Web API. They are interchangeable.

4. What is Postman?

  • A code editor for writing JavaScript.
  • A database management tool for MySQL.
  • A tool for testing and debugging web APIs.
  • A front-end framework for building responsive web applications.

CRUD Operations Practice Quiz

5. What is routing in ASP.NET?

  • A way to manage server-side data validation.
  • A way to map URLs to application resources.
  • A way to manage client-side data validation.
  • A way to manage application configuration settings.

6. What are route constraints in ASP.NET?

  • Rules that limit the types of HTTP methods that can be used with a particular route.
  • Rules that limit the types of data that can be passed as parameters in a particular route.
  • Rules that limit the number of parameters that can be passed in a particular route.
  • Rules that limit the types of responses that can be returned by a particular route.

7. What is an action result in ASP.NET?

  • A type of validation used to ensure that user input is valid before it is processed.
  • A type of HTTP response returned by a controller action.
  • A type of attribute that can be applied to controller actions.
  • A type of routing rule used to map URLs to controller actions.

8. What is content negotiation in ASP.NET?

  • The process of determining whether a request is coming from a human user or a bot.
  • The process of determining the appropriate HTTP status code to return for a particular response.
  • The process of selecting the most appropriate representation of a resource based on the client’s preferences.
  • The process of caching HTTP responses to improve application performance.

9. What are media type formatters in ASP.NET?

  • Components that handle the routing of incoming requests to the appropriate controller action.
  • Components that convert HTTP responses into different media types, such as XML, JSON, or binary.
  • Components that handle content negotiation to select the appropriate media type for a response
  • Components that handle data validation and return error responses when validation fails.

Advance WebAPI Practice Quiz

10. What is ASP.NET Web API?

  • A front-end framework for building responsive web applications.
  • An ORM framework for .NET applications.
  • A framework for building HTTP services that can be consumed by a wide range of clients.
  • A cloud-based platform for building and deploying web applications.

11. What is the purpose of the [HttpGet] attribute in ASP.NET Web API?

  • To specify the HTTP verb for an action method that responds to GET requests.
  • To specify the HTTP verb for an action method that responds to POST requests.
  • To specify the HTTP verb for an action method that responds to DELETE requests.
  • To specify the HTTP verb for an action method that responds to PUT requests.

12. What is the purpose of the IHttpActionResult interface in ASP.NET Web API?

  • To define a base class for Web API controllers.
  • To provide a way to return a standard HTTP response from an action method.
  • To handle content negotiation to select the appropriate media type for a response.
  • To provide a way to specify routing for Web API controllers.

13. What is the purpose of the [FromBody] attribute in ASP.NET Web API?

  • To specify that the parameter for an action method should be bound using the request body.
  • To specify that the parameter for an action method should be bound using the query string.
  • To specify that the parameter for an action method should be bound using the request headers.
  • To specify that the parameter for an action method should be bound using the route data.

14. What is the purpose of the HTTP GET method in ASP.NET Web API?

  • To create a new resource.
  • To read an existing resource.
  • To update an existing resource.
  • To delete an existing resource.

WebAPI Graded Quiz

15. What is ASP.NET Web API?

  • A programming language used to build web applications.
  • A tool used for testing web APIs.
  • A framework for building RESTful web APIs.
  • A database management system used for building web applications.

16. What is the difference between a web API and a web service?

  • There is no difference between a web API and a web service.
  • A web API is used for client-server communication over the web, while a web service is used for inter-process communication.
  • A web API is a RESTful service, while a web service uses SOAP.
  • A web API is designed for use by applications, while a web service is designed for use by humans.

17. What is HTTP?

  • A programming language used to build web applications.
  • A tool used for testing web APIs.
  • A protocol for communication between web servers and clients.
  • A database management system used for building web applications.

18. What is REST?

  • A programming language used to build web applications.
  • A tool used for testing web APIs.
  • A set of architectural principles for building web APIs.
  • A database management system used for building web applications.

19. What is CRUD?

  • A programming language used to build web applications.
  • A tool used for testing web APIs.
  • An acronym for Create, Read, Update, and Delete, which are the four basic operations that can be performed on data.
  • A database management system used for building web applications.

20. What is the purpose of a Web API?

  • To build user interfaces for web applications.
  • To provide programmatic access to a web application’s data and functionality.
  • To provide a graphical user interface for a web application.
  • To provide a database management system for a web application.

21. Which HTTP method is used to retrieve data from a Web API?

  • POST
  • GET
  • DELETE
  • PUT

22. Which HTTP status code is returned when a resource is successfully updated on the server?

  • 200 OK
  • 201 Created
  • 400 Bad Request
  • 204 No Content

23. What is a query string in a Web API request?

  • A string of characters that identifies the client making the request.
  • A string of characters that identifies the server processing the request.
  • A string of characters appended to the end of a URL that contains additional information about the request, such as filters or search terms.
  • A string of characters that encrypts the request data for secure transmission.

24. What is the purpose of the HTTP DELETE method in a Web API?

  • To retrieve a specific resource.
  • To create a new resource.
  • To update an existing resource.
  • To delete a specific resource.

25. What is the purpose of the HTTP PUT method in a Web API?

  • To retrieve a specific resource.
  • To create a new resource.
  • To delete an existing resource.
  • To update an existing resource.

26. What is the purpose of the HTTP POST method in a Web API?

  • To retrieve a specific resource.
  • To create a new resource.
  • To update an existing resource.
  • To delete an existing resource.

27. What is the purpose of the HTTP GET method in a Web API?

  • To retrieve a specific resource or a collection of resources.
  • To create a new resource.
  • To update an existing resource.
  • To delete an existing resource.

28. Which HTTP status code indicates that a resource could not be found on a Web API server?

  • 200 OK
  • 201 Created
  • 204 No Content
  • 404 Not Found

29. What is the purpose of a route template in ASP.NET Web API?

  • To define the layout and design of the Web API documentation.
  • To specify the HTTP method that the Web API supports.
  • To define the URI pattern that the Web API will use to match incoming requests to controller actions.
  • To define the format in which the Web API will return data to the client.

30. What is the purpose of the "ApiController" attribute in ASP.NET Web API?

  • To specify the HTTP method that the controller action will handle.
  • To define the layout and design of the Web API documentation.
  • To indicate that a controller class is a Web API controller and to enable Web API-specific behavior.
  • To define the format in which the Web API will return data to the client.

31. What is the difference between "POST" and "PUT" HTTP methods in ASP.NET Web API?

  • “POST” is used to create a new resource on the server, while “PUT” is used to update an existing resource on the server.
  • “POST” is used to update an existing resource on the server, while “PUT” is used to create a new resource on the server.
  • “POST” and “PUT” are interchangeable and can be used for the same purpose.
  • “POST” and “PUT” are used to perform the same operation on a resource, but “PUT” is a newer and more efficient method.

32. What is the purpose of the "FromBody" attribute in an ASP.NET Web API controller action?

  • To specify the HTTP method that the controller action will handle.
  • To define the layout and design of the Web API documentation.
  • To indicate that the parameter for the controller action should be bound using the request body.
  • To indicate that the parameter for the controller action should be bound using the query string in the request URL.

33. What is the purpose of the "FromQuery" attribute in an ASP.NET Web API controller action?

  • To specify the HTTP method that the controller action will handle.
  • To define the layout and design of the Web API documentation.
  • To indicate that the parameter for the controller action should be bound using the request body.
  • To indicate that the parameter for the controller action should be bound using the query string in the request URL.

Leave a Reply