PRN231_FE.docx PDF
Document Details
Tags
Summary
This document is a set of questions and answers regarding RESTful APIs, the role of URIs, and resources within RESTful APIs. It also touches upon fundamental concepts of Azure Service Fabric microservices.
Full Transcript
**1.What is REST API?** A. A REST API (RESTful API) is an application programming interface that conforms to the constraints of REST architectural style and allows for interaction with RESTful web services.\ B. A REST API (RESTful API) is an application programming that allows for interaction with...
**1.What is REST API?** A. A REST API (RESTful API) is an application programming interface that conforms to the constraints of REST architectural style and allows for interaction with RESTful web services.\ B. A REST API (RESTful API) is an application programming that allows for interaction with RESTful web services without constraints.\ C. A REST API (RESTful API) is an application programming interface that conforms to the constraints of REST architectural style and does not allow for interaction with RESTful web services. D. A REST API (RESTful API) is an application programming that conforms to the constraints of REST architectural style and does not allow for interaction with RESTful web services. **2.What is the role of URI (Uniform Resource Identifier) in RESTful APIs?** A. URIs define the structure of the API\'s data model B. URIs represent the unique identifiers for each resource in the API C. URIs determine the allowed set of HTTP methods for each resource D. URIs define the security and authentication settings for the API **3.What is the significance of resources in RESTful APIs?** A. Resources represent the data entities exposed by the API B. Resources are the network endpoints of the API C. Resources refer to the methods and operations provided by the API D. Resources are the protocols used to communicate with the API **4.Which status code is typically returned when a resource is successfully created in a RESTful service?** Α. 200 (ΟΚ) B. 201 (Created) C. 204 (No Content) D. 400 (Bad Request) **5.To test your mappings with AutoMapper, you need to create a test that does the thing(s). Call your bootstrapper class to create all the mappings and call MapperConfiguration.AssertConfigurationlsValid:** A. var config = AutoMapperConfiguration.Configure();config.AssertConfigurationIsValid(); B. var config = AutoMapperConfiguration.Configure(); config.AssertConfigurationIsNotValid(); C. var config = AutoMapperConfiguration.Configure(); config.AssertAllConfigurationlsValid(); D. var config = AutoMapperConfiguration.Configure(); config.AssertConfigurationlsValid(true); 6. **Choose the correct information about Azure Service Fabric - microservice platform of Microsoft.** A. Azure Service Fabric is a distributed systems platform that makes it easy to package, deploy, and manage scalable and reliable microservices and containers. B. Azure Service Fabric is a centralization systems platform that makes it easy to package, deploy, and manage scalable and reliable microservices and containers. C. Azure Service Fabric is a localization systems platform that makes it easy to package, deploy, and manage scalable and reliable microservices and containers. D. None of the others. 7. **What is not a microservice attribute?** A. Independent deployment B. Technology adoption C. Consistency and resiliency D. Combined functionality **8. Which of the following is executed on each request in RESTful with ASP.NET Core Web API?** A. Startup B. Middlewares C. Main method D. All of the others. **9. What is the default CORS policy behavior in ASP.NET Core Web API if no policy is explicitly configured?** A. All cross-origin requests are allowed B. Only same-origin requests are allowed C. All cross-origin requests are blocked D. An exception is thrown for all cross-origin requests **10. What are static files in ASP.NET Core API Project?** A. Images B. Html files C. CSS files D. JavaScript files E. All of the others **11. Which of the following is correct?** A. jQuery is a JavaScript library for calling ASP.NET Core Web API B. jQuery is a JavaScript simple template for calling ASP.NET Core Web API C. jQuery is a JSON library for calling ASP.NET Core Web API D. jQuery is a JSON template for calling ASP.NET Core Web API **12. What is the purpose of using an AJAX JavaScript client with an ASP.NET Core Web API?** A. To handle server-side logic B. To improve the performance of the web application C. To integrate third-party APIs D. To make asynchronous HTTP requests to the Web API **13. By passing parameters in the URL of the HTTP request** A. By adding data to the body of the HTTP request B. By using query string parameters in the URL C. By adding data to the header of the HTTP request D. By passing parameters in the URL of the HTTP request **14. What is not the purpose of a Media Formatter in web development?** A. To format data into a specific media type for HTTP responses B. To format data into a specific media type for HTTP requests C. To serialize and deserialize objects for communication between client and server D. To define the data type for attribute routing **15. What is content negotiation?** A. Content negotiation is a mechanism that can be used to serve different representations of the same resource at a given URI, providing ability to their clients to decide the best suited representations. B. Content negotiation is a collection of API that can be used to serve different representations of the same resource at a given URI, providing ability to their clients to decide the best suited representations. C. Content negotiation is an application that can be used to serve different representations of the same resource at a given URI, providing ability to their clients to decide the best suited representations. **16. How to configure JSON Serialization in ASP.NET Core?** A. public void ConfigureServices (IServiceCollection services) { services.AddControllers With Views().AddJsonOptions(options =\> options.JsonSerializer.Options. PropertyNamingPolicy = null); } B. public void Configure (IServiceCollection services) { services.AddControllers With Views().AddJsonOptions(options =\> options.JsonSerializerOptions.PropertyNamingPolicy = null); } C. public void ConfigureServices (IApplicationBuilder services) { services.AddControllersWith Views().AddJsonOptions(options =\> options.JsonSerializerOptions.PropertyNamingPolicy = null); } D. public void ConfigureServices (IEnvironmentBuilder services) { services.AddControllers With Views().AddJsonOptions(options =\> options.JsonSerializerOptions.PropertyNaming Policy = null); } 17. **If an HTTP request does not include an \"Accept\" header, and the server supports both XML and JSON, what will be the server\'s default response format?** A. XML B. JSON C. HTML D. Server error **18. Which attribute can be used to specify the media type for a specific action method in ASP.NET Core Web API?** A. \[HttpPost\] B. \[AllowAnonymous\] C. \[Produces\] D. \[Route\] **19. WCF stands for what?** A. Windows Communication Framework B. Windows Communication Foundation C. Windows Connection Framework D. Windows Com Framework **20. Which utility can be used to create WSDL from WCF service?** A. Wcf.exe B. Svc.exe C. ILDASM.exe D. SvcUtil.exe **21. MessageContract can be applied to** A. Interface B. Class C. Method D. Service **22. Which WCF binding is commonly used for building RESTful services?** A. BasicHttpBinding B. NetTcpBinding C. WebHttpBinding D. WSHttpBinding **23. Which contract in WCF maps data contracts to SOAP envelopes?** A. MessageContract B. DataContract C. OperationContract D. ServiceContract **24. Authentication is the process of:** A. Verifying the identity of a user or a client B. Granting access to specific resources or actions C. Encrypting sensitive data during transmission D. Logging user activities for auditing purposes **25. What are Identity Claims in ASP.NET Core Identity?** A. Additional information associated with a user, like role membership or email B. Secret tokens used for user authentication C. Encrypted data stored in the user cookie D. User credentials used for password-based authentication **26. Which part of the JWT contains information needed to verify the signature?** A. Header B. Payload C. Signature D. Body **27. What is the purpose of an authentication handler in ASP.NET Core?** A. To validate user credentials and issue authentication tickets B. To handle encryption and decryption of data C. To handle user session management D. To enforce authorization rules on the application **28. What is ASP.NET Core Identity?** A. A middleware used for routing in ASP.NET Core B. A framework for managing user authentication and authorization C. A library for handling database operations in ASP.NET Core D. A feature for generating HTML views in ASP.NET Core **29. How do gRPC and REST differ in terms of communication protocol?** A. gRPC uses HTTP/1.1, REST uses HTTP/2 B. gRPC uses HTTP/2, REST uses HTTP/1.1 C. gRPC uses TCP, REST uses UDP D. gRPC uses WebSocket, REST uses MQTT **30. gRPC services couldn\'t hosted by which ASP.NET Core servers?** A. Kestrel B. TestServer C. IIS D. HTTP.sys E. All of the others **31.What is the serialization format used by gRPC?** A. JSON B. XML C. Protocol Buffers D. YAML **32. What is the role of Protocol Buffers in gRPC with C\#?** A. Protocol Buffers is used for data serialization and communication between client and server. B. Protocol Buffers is used for Ul rendering in C\# applications. C. Protocol Buffers is used for database management in C\# applications. D. Protocol Buffers is used for logging and monitoring in C\# applications. **33. Which one is not correct about OData protocol?** A. The OData protocol is the same with other REST-based web service approaches. B. The OData protocol is an application-level protocol for interacting with data via RESTful interfaces. C. The OData protocol improves semantic interoperability between systems and allows an ecosystem to emerge.WIGOM D. None of the others **34. How can you enable OData routing in ASP.NET Core Web API?** A. By adding the \[ODataRoute\] attribute to the controller or action method. B. By configuring the routing in the Startup class. C. By installing a third-party OData middleware. D. By using the \[ApiController\] attribute on the controller **35. What does the following OData query retrieve: /Orders?\$filter=Orderltems/all(item: item/Quantity ge 10)** A. Orders with all items having a quantity greater than or equal to 10. B. Orders with any item having a quantity greater than or equal to 10. C. Orders with all items having a quantity less than 10. D. Orders with any item having a quantity less than 10. **36. Which the OData query option that determine all attributes or properties to include in the fetched result?** A. \$select B. \$top C. \$inlinecount D. \$selectall **37. Which OData query example filters a collection of products to retrieve those with any related orders?** A. /Products?\$filter=Any(Orders) B./Products?\$filter=All(Orders) C./Products?\$filter=Any(Orders eq true) D./Products?\$filter=All(Orders eq true) **38. Which namespace needs to be imported to use the \"ControllerBase\" class?** A. System.Net B. System.Web C. Microsoft.AspNetCore.Mvc D. System.Web.Mvc **39. Which command is used to create a new ASP.NET Core Web API project using the.NET CLI?** A. dotnet new console B. dotnet new mvc C. dotnet new api D. dotnet new web **40. What is the primary role of ASP.NET Web API?** A. Serving dynamic web pages B. Handling and responding to HTTP requests and building RESTful APIs C. Server-side form validation D. Managing database connections **41. What is the role of Web API controllers?** A. Handling user authentication B. Managing database operations C. Handling HTTP requests and producing HTTP responses D. Rendering views and templates **42. Which class does \"ControllerBase\" inherit from? (Choose 2 answers)** A. System.Web.Mvc.Controller B. System.Net.Http.HttpController C. System.Web.Http.ApiController D. System.Object E. Microsoft.AspNetCore.MVC **43. Which of the following statements is true about the routing middleware in ASP.NET Core Web API?** A. Routing is only applicable for GET requests B. Routing is only applicable for POST requests C. Routing is applicable for all types of HTTP requests D. Routing is not supported in ASP.NET Core Web API **44. What happens if model validation fails in ASP.NET Core Web API?** A. The API endpoint returns a 500 Internal Server Error response B. The API endpoint returns a 404 Not Found response C. The ASP.NET Core Web API automatically handles and returns a 400 Bad Request response D. The ASP.NET Core Web API throws an exception and crashes **45. In the case the request is simple, input parameter are of type int, string, boolean, GUID, decimal, etc. and is available in the URL, then such kind of request is mapped to what model binding?** A. primitive model binding B. complex model binder C. combination model binding D. extraction model binder **46. What is complex type binding?** A. HTTP Methods like POST and PUT where you have to send the send model/entity data to the server, uses complex type binding, by default.B. POST and PUT can also use combination of primitive and complex type. In the case you want to update data, you can pass the Id in query string and the data to be updated in response body. C. Both the answers are corect D. Both the answers are incorrect **47. In Web API, how can you bind the incoming data to a model automatically?** A. By using the \[FromBody\] attribute on the API method parameter B. By using the \[FromQuery\] attribute on the API method parameter C. By using the \[FromBody\] attribute on the model class D. By using the \[FromRoute\] attribute on the API method parameter **48. Choose the correct information for validation the properties on the model** A. In ASP.NET Core Web API, developer can use attributes from the System.ComponentModel.DataAnnotations namespace to set validation rules for properties on the model B. In ASP.NET Core Web API, developer can use attributes from the System.DataManagementModel.DataAnnotations namespace to set validation rules for properties on the model. C. Both the answers are corect D. Both the answers are incorrect **49. Consider with model binding in ASP.NET Core, choose one is not the role of the model binding system.**\ A. Converts string data to.NET types.\ B. Provides the data to view using method parameters and public properties.\ C. Updates properties of complex types.\ D. Retrieves data from various sources such as route data, form fields, and query strings **50. What is a Model in ASP.NET Core Web API?**\ A. A model is a class with.cs (for C\#) as an extension having both properties and methods.\ B. Models are used only to set the data.\ C. Both the answers are corect\ D. Both the answers are incorrect **51. Choose correct information about ASP.NET Core HTTP verbs**\ A. PUT - This verb is used to update the existing resource. DELETE - This verb is used to delete the existing resource.\ GET - This verb is used to retrieve the data or information. It does not have any other effect except getting data. POST - This verb is used to generate or create the resource.\ B. PUT - This verb is used to generate or create the resource. DELETE - This verb is used to delete the existing co resource. GET - This verb is used to retrieve the data or information. It does not have any other effect except getting data. POST - This verb is used to update the existing resource.\ C. PUT - This verb is used to retrieve the data or information. It does not have any other effect except getting data.DELETE - This verb is used to delete the existing resource. GET - This verb is used to update the existing resource.POST - This verb is used to generate or create the resource.\ D. PUT - This verb is used to delete the existing resource. DELETE - This verb is used to update the existing resource.GET - This verb is used to retrieve the data or information. It does not have any other effect except getting data. POST - This verb is used to generate or create the resource. **52. Which HTTP response code represents a successful request in REST?**\ Α. 200 (ΟΚ)\ B. 300 (Multiple Choices)\ C. 400 (Bad Request)\ D. 500 (Internal Server Error) **53. What is the purpose of HTTP headers in RESTful APIs?**\ A. HTTP headers contain metadata about the request or response\ B. HTTP headers define the structure of the API\'s data models\ C. HTTP headers store the actual data being transferred in the API\ D. HTTP headers enforce security and authentication in the API **54. What does REST stand for?**\ A. Remote Encoding and State Transfer\ B. Representational State Transfer\ C. Resource Extraction and State Transportation\ D. Rapid and Efficient Service Transfer **55. What is the purpose of the HTTP POST method in a RESTful API?**\ A. To retrieve or fetch a resource from the server\ B. To update an existing resource on the server\ C. To delete a resource from the server\ D. To create a new resource on the server **56. What is a microservice?**\ A. A monolithic application\ B. A self-contained, independent service\ C. A programming language\ D. A database management system **57. Which Docker command is used to run a.NET container image?**\ A. docker build\ B. docker run\ C. docker stop\ D. docker push **58. What is the Startup class in ASP.NET Core Web API?**\ A. Startup class is the entry point of the ASP.NET Core application or Web API.\ B. It is not necessary that class name must be Startup, it can be anything, just need to configure startup class in Program class.\ C. Both the answers are corect\ D. Both the answers are incorrect **59. How can we inject the service dependency into the controller?**\ **public interface IHelloWorldService\ {\ string SaysHello();\ }\ public class HelloWorldService: IHelloWorldService\ {\ public string SaysHello()\ {\ return \"Hello \";\ }\ }\ **A. public void ConfigureServices (IServiceCollection services)\ {\ services.AddTransient\();\ }\ public class HomeController: Controller\ {\ IHelloWorldService\_helloWorldService;\ public HomeController (IHelloWorldService helloWorldService)\ {\ \_helloWorldService = helloWorldService;\ } }\ B. public configureServices (IServiceCollection services) 60. **To call the ASP.NET Core Web API with JavaScript, configure the app to serve static files and enable default file mapping. Which code is needed in the method of Startup.cs?**\ A. public void Configure(IApplication Builder app, IWebHostEnvironment env)\ {\ //app.UseDefaultFiles();app.UseStaticFiles();\ //\ } C. public void ConfigureServices (IApplication Builder app, IWebHostEnvironment env)\ {\ //app.UseDefaultFiles();\ app.UseStaticFiles();\ //\ }\ C. public void ConfigureServices (IServiceCollection app)\ {\ //app.UseDefaultFiles();\ app.UseStaticFiles();\ //\ } D. public void Configure(IServiceCollection app)\ {\ //app.UseDefaultFiles();\ app.UseStaticFiles();\ //\ } 61. **What is Content Negotiation in ASP.NET Core Web API?**\ A. The process of negotiating content prices between client and server.\ B. The process of selecting the appropriate response format based on the request\'s Accept header.\ C. The process of caching response content on the server.\ D. The process of securing content transmission between client and server. 62. **What is the default media type used by the JsonMediaTypeFormatter in Web API?**\ A. application/json\ B. text/xml\ C. application/xml\ D. application/x-www-form-urlencoded 63. **What is the role of IContentNegotiator in ASP.NET Core Web API?**\ A. It handles routing and URL mapping.\ B. It checks for authentication and authorization.\ C. It negotiates and selects the appropriate response format based on the client\'s preferences.\ D. It handles serialization and deserialization of data. 64. **What is JSON?(choose 2 answers)**\ A. JSON (JavaScript Object Notation): It is similar to HTML but is more flexible than HTML because it allows users to create their own custom tags.\ B. JSON (JavaScript Object Notation): It is especially designed to store and transport data.\ C. JSON (JavaScript Object Notation): It is used for representing structured information such as documents, data,configuration, etc.\ D. JSON (JavaScript Object Notation): It is a lightweight format designed to store and transport data. 65. **Which attribute can be used to override the default media type for a specific action or controller in ASP.NET Core Web API?**\ A. \[HttpPost\]\ B. \[AllowAnonymous\]\ C. \[Produces\]\ D. \[Route\] 66. **What is the purpose of using the \[ServiceContract\] attribute in WCF?**\ A. To define a service operation\ B. To mark a class as a data contract\ C. To specify the XML namespace for the service\ D. To mark a class as a service implementation 67. **Which type of hosting is suitable for WCF services that require high scalability and availability?**\ A. IIS Hosting\ B. Self-Hosting\ C. Windows Service Hosting\ D. WAS Hosting 68. **Which type of contract is applicable to interface in WCF?**\ A. Operation contract\ B. Message contract\ C. Service contract\ D. Data contract 69. **WCF endpoint includes which components?**\ A. Address\ B. Binding\ C. Contract\ D. All of the others 70. **What is the purpose of the authentication middleware in ASP.NET Core Web API?**\ A. To handle incoming HTTP requests and responses\ B. To enable authentication for the web application\ C. To map incoming requests to appropriate endpoint handlers\ D. To provide role-based authorization 71. **Which of the following is typically used for user authentication in a RESTful Web Service?**\ A. API keys\ B. JSON Web Tokens (JWT)\ C. OAuth2\ D. SSL/TLS certificates 72. **Authorization is the process of:**\ A. Verifying the identity of a user or a client\ **B. Granting access to specific resources or actions**\ C. Encrypting sensitive data during transmission\ D. Logging user activities for auditing purpose authorization =\> granting\ authentication =\> verifying 73. **Which parts of the JWT are typically Base64Url encoded?**\ A. Header and payload\ B. Payload and signature\ C. Header and signature\ D. All parts of the JWT are Base64Url encoded 74. **Choose the correct information to configure autoscaling for an Azure solution.**\ A. Azure App Service has built-in autoscaling. Autoscale settings apply to all of the apps within an App Service.\ B. Azure App Service has built-in autoscaling only at the role level.\ C. The connection is slow in autoscaling option with Azure App Sercive.\ D. All of the others. 75. **Protocol Buffers is used to define the Messages (data, Request and Response) and Service (Service name and RPC endpoints). Choose the correct syntax.**\ A. syntax = \"proto3\":\ service Greeter {\ rpc SayHello (HelloRequest) replies (HelloReply):\ } message HelloRequest {\ string name = 1:\ }\ message HelloReply {\ string message = 1:}\ B. syntax = \"proto3\":\ message Greeter {\ rpc SayHello (HelloRequest) replies (HelloReply):}\ service HelloRequest { string name = 1;\ }\ service HelloReply { string message = 1:\ }\ C. syntax = \"proto3\":\ service Greeter {\ rpc SayHello (HelloRequest) returns (HelloReply):}\ message HelloRequest {\ string name = 1;}\ message HelloReply {\ string message = 1;}\ D. syntax = \"proto3\":message Greeter {\ rpc SayHello (HelloRequest) returns (HelloReply):\ } service HelloRequest {\ string name = 1:\ }\ service HelloReply {\ string message = 1:} 76. **How are gRPC services registered and configured in ASP.NET Core?**\ A. In the ConfigureServices method of the Startup class\ B. By adding a configuration file named appSettings.json\ C. By modifying the Global.asax file\ D. In the ConfigureServices method of the Controller class 77. **Can Protocol Buffers be used for bidirectional streaming in gRPC with C\#?**\ A. Yes, Protocol Buffers support bidirectional streaming in gRPC with C\#.\ B. No, Protocol Buffers only support unidirectional streaming in gRPC with C\#.\ C. Bidirectional streaming is not supported by gRPC with C\#.\ D. Protocol Buffers cannot be used for streaming in gRPC with C\#. 78. **Which protocol does gRPC primarily use for communication?**\ A. HTTP/1.1\ B. HTTP/2\ C. WebSocket\ D. FTP 79. **How does OData enable clients to query and filter data?**\ A. By using custom SQL queries.\ B. By sending raw JSON data in the request payload.\ C. By using a standardized query syntax in the URL.\ D. By encoding data using a secure encryption algorithm. 80. **Choose the correct information about EnableQueryAttribute class (\[EnableQuery\] attribute)**\ A. This class defines an attribute that can be applied to an action to enable querying using the OData query syntax.\ B. This class defines both attribute and method that can be applied to an action to enable querying using the OData query syntax.\ C. This class defines a method that can be applied to an action to enable querying using the OData query syntax.GOM\ D. None of the others. 81. **What is the purpose of the Service Metadata Feature in OData?**\ A. To provide information about the available OData endpoints and entities in the Web API.\ B. To enable automatic generation of sample data for OData response. D. To allow automatic retrieval of remote OData services.\ D. To enable configuration of dynamic service routes for OData endpoints. 82. **What is the purpose of the \$filter query option in OData?**\ A. It allows clients to request a specific subset of entity properties.\ B. It enables clients to perform complex filtering operations on entity collections.\ C. It allows clients to update or modify existing entities.\ D. It provides a way to sort the returned entities based on a specified property. 83. **Choose the correct information about pagging OData.**\ A. To enable paging, just mention the page count at the \[Queryable\]\ \[EnableQuery(PageSize =5)\]\ public IActionResult GetData() =\> Ok(objService.GetObjects());\ B. To enable paging, just mention the page count at the \[Queryable\]\ \[EnableQuery(PageIndex =5)\]\ public IActionResult GetData() =\> Ok(objService.GetObjects());\ C. To enable paging, just mention the page count at the \[AllowQueryable\]\[AllowEnableQuery(PageSize =5)\]\ public IActionResult GetData() =\> Ok(objService.GetObjects()); 84. **Choose the incorrect information about Async programming with ASP.NET Web API.**\ A. Async programming is a parallel programming technique that allows the working process to run separately from the main application thread.\ B. Async programming cannot informs the main thread about the result whether it was successful or not.\ C.Using async programming, we can enhance the responsiveness of our application.\ D. Using async programming, we can avoid performance bottlenecks.\ VERFLOW/GOM. 85. **A binding source attribute defines the location at which an action parameter\'s value is found. Which one is not a binding source attribute?**\ A. \[FromServices\]\ B. \[FromHeader\]\ C. \[FromQuery\] E. \[FromRouting\] 86. **ASP.NET Core supports creating web APIs using controllers or using minimal APIs. Controllers in a Web API are classes that derive from which of the following class?**\ A. ControllerBase\ B. Controller\ C. ControllerAttribute\ D. ControllerContext 87. **Which information is true about ASP.NET Core Web API Architecture?**\ A. The ASP.NET Web API framework has been designed using the task-based asynchronous programming model from the top to the bottom.\ B. Ability to host both in IIS (or development server) and in any nonweb server process (called self-hosted).\ C. All of the others.\ D. Can customize many elements of ASP.NET Core Web API by supplying custom implementation. 88. **What is the purpose of the Primitive Model Binder in ASP.NET Core Web API?**\ A. It is used for binding complex models with nested properties\ B. It is used for binding primitive types like strings and integers\ C. It is used for validating model properties\ D. It is used for handling query string parameters 89. **Which of the following is true about the \[HttpGet\] attribute in ASP.NET Core Web API?**\ A. It specifies that the route should only handle GET requests\ B. It is used to map the route to a specific HTTP method\ C. It is not supported in Attribute Routing\ D. It is used to define the route template for the action method 90. **Where should you typically add the UseRouting middleware in the startup.cs file?**\ A. Inside the ConfigureServices method\ B. Before the UseEndpoints middleware\ C. After the UseAuthentication middleware\ D. Inside the Configure method 91. **What is the purpose of the UseRouting middleware in ASP.NET Core Web API?**\ A. To handle HTTP requests and responses\ B. To map incoming requests to appropriate endpoint handlers\ C. To enable routing for static files in the web application\ D. To provide authentication and authorization feature 92. **What is model validation in ASP.NET Core Web API?**\ A. A process to check the authenticity of the model data\ B. A way to validate that the model conforms to specified rules\ C. A technique to validate the authentication of the API user\ D. A feature to validate the structure of the model schema 93. **To force clients to set a value, make the property nullable and set the Required attribute**\ A. \[Required\]\ public decimal? Price { get; set; }\ B. \[RequireAttribute(0, 999)\]\ public decimal? Price { get; set; }\ C. \[RequiredRange(0, 999)\]\ public decimal? Price { get; set; }\ D. \[RequiredNotNull\]\ public decimal? Price { get; set; 94. **What is the purpose of a Data Transfer Object (DTO) in.NET?**\ A. To transfer data between different layers or components of an application\ B. To define the structure and behavior of database tables\ C. To encapsulate business logic within a separate class\ D. To manage user input validation in forms 95. **What is AutoMapper?**\ A. AutoMapper is an object-object mapper. Object-object mapping works by transforming an input object of one type into an output object of a different type.\ B. AutoMapper is an object-object mapper of EntityFramework Core with ASP.NET Core Web API.\ C. Object-object mapping works by transforming an input collection of one type into an output object of a different type.\ D. All of the others. 96. **What are Data Transfer Objects (DTOs)?**\ A. Data Transfer Objects (DTOs) are classes that define a Model with sometimes predefined validation in place for HTTP responses and requests.\ B. The DTOs can be known as ViewModels in MVC where you only want to expose relevant data to the View.RFLOW/GOM\ C. Both the answers are incorrect\ D. Both the answers are correct 97. **Choose the option that is not one of characteristics of a REST based network.\ **A. Client-Server\ B. Stateful\ C. Uniform interface\ D. Cache 98. **Choose the incorrect information about ASP.NET Core Web API.**\ A. ASP.NET Core Web API, from the beginning, was designed to be a service-based framework for building REpresentational State Transfer (RESTful) services.\ B. It is based on the MVC framework minus the V (view), with optimizations for creating headless services.\ C. ASP.NET Core Web API is an application can interact with a resource by knowing the resource only. D. Calls to a Web API service are based on the core HTTP verbs (Get, Put, Post, Delete) through a uniform resource identifier (URI). 99. **How Authentication and Authorization works? Choose the correct order of steps.**\ A. Step 1. The Request reaches the Authentication Middleware.\ Step 2. The Authentication Middleware checks to see if a proper credential present in the request. It will use the default authentication handler to do that. It could be a Cookies handler or JWT handler. Since it does not find any credential, it will set the User Property to an anonymous user.\ Step 3. Authorization Middleware (UseAuthorization()) checks to see if the destination page needs Authorization. If No then the user is allowed to visit the Page\ If Yes it invokes the ChallengeAsync() on the Authentication Handler. It redirects the user to Login Page.\ B. Step 1. The Authentication Middleware checks to see if a proper credential present in the request. It will use the\ default authentication handler to do that. It could be a Cookies handler or JWT handler. Since it does not find any\ credential, it will set the User Property to an anonymous user.\ Step 2. The Request reaches the Authentication Middleware.\ Step 3. Authorization Middleware (UseAuthorization()) checks to see if the destination page needs Authorization. If No then the user is allowed to visit the Page\ If Yes it invokes the ChallengeAsync() on the Authentication Handler. It redirects the user to Login Page.\ C. Step 1. The Request reaches the Authentication Middleware.\ Step 2. Authorization Middleware (UseAuthorization()) checks to see if the destination page needs Authorization. If No then the user is allowed to visit the Page\ If Yes it invokes the ChallengeAsync() on the Authentication Handler. It redirects the user to Login Page.\ Step 3. The Authentication Middleware checks to see if a proper credential present in the request. It will use the default authentication handler to do that. It could be a Cookies handler or JWT handler. Since it does not find any credential, it will set the User Property to an anonymous user.\ D. None of the others. 100. **What is a key difference between gRPC and REST in terms of payload serialization?**\ A. gRPC uses XML, REST uses JSON\ B. gRPC uses JSON, REST uses Protocol Buffers\ C. gRPC uses Protocol Buffers, REST uses XML\ D. gRPC uses JSON, REST uses XML 101. **Which of the following statements about streaming in gRPC is true?**\ A. gRPC does not support streaming\ B. gRPC only supports client-side streaming\ C. gRPC supports both client-side and server-side streaming\ D. gRPC only supports server-side streaming 102. **Which statement accurately describes the OData Versioning Feature in ASP.NET Core Web API?**\ A. It offers versioning of the OData protocol itself.\ B. It enables versioning of individual controllers and actions within the Web API project.\ C. It allows for versioning of the entire Web API project.\ D. It provides automatic versioning of response data based on the client\'s request. 103. **What is the main advantage of using Windows Communication Foundation (WCF) for building RESTful services?**\ A. Cross-platform compatibility\ B. Scalability and flexibility\ C. Improved performance\ D. Security enhancements 104. **Choose the correct information about \"multiple receivers\" communication type in microservices.**\ A. None of the others.\ B. Each request can be processed by zero to multiple receivers.\ C. Each request must be processed by exactly one receiver or service.\ D. All of the others. 105. **A WCF endpoint includes which components?**\ B A. Address\ B. All of the others\ C. Binding\ D. Contract 106. **Choose the suitable reasons for choosing.NET for Web Services.**\ A. Targeting microservices.\ B. Cross-platform.\ C. Side-by-side.NET versions per application.\ D. All of the others. 107. **A binding source attribute defines the location at which an action parameter\'s value is found. Choose the incorrect information about binding source attribute.**\ A. \[FromBody\] - Gets values from the response body.\ B. \[FromForm\] - Gets values from posted form fields.\ C. \[FromQuery\] - Gets values from the query string.\ D. \[FromRoute\] - Gets values from route data.\ E. \[FromHeader\] - Gets values from HTTP headers. 108. **Choose the correct information about Azure Service Fabric microservice platform of Microsoft.**\ A. Azure Service Fabric is a distributed systems platform that makes it easy to package, deploy, and manage scalable and reliable microservices and containers.\ B. None of the others.\ C. Azure Service Fabric is a centralization systems platform that makes it easy to package, deploy, and manage scalable and reliable microservices and containers.\ D. Azure Service Fabric is a localization systems platform that makes it easy to package, deploy, and manage scalable and reliable microservices and containers. 109. **Which component in ASP.NET Core Web API is responsible for handling Content Negotiation?**\ A. MediaTypeFormatter\ B. ApiController\ C. HttpRequestMessage\ D. HttpClient 110. **Choose the incorrect information about validation built-in attributes. The attributes can get from the System.ComponentModel.DataAnnotations namespace.**\ A. \[EmailAddress\]: Validates that the property has an email format.\ B. \[Compare\]: Validates that two properties in a model match.\ C. \[Required\]: Validates that the field is not null.\ D. \[RegularExpression\]: Validates that the property value matches a specified range. 111. **What is complex model binder?**\ A. In the case the request is complex, pass data in request body as an entity with the desired content-type, then such kind of request is mapped by complex model binder.\ B. None of the others.\ C. If the request is simple, input parameter are of type int, string, Boolean, GUID, decimal, etc. and is available in the URL, then such kind of request is mapped to complex model binder.\ D. In the case the response is complex, pass data in response body as an entity with the desired content-type, then such kind of response is mapped by complex model binder. 112. **What is the purpose of the OData Content Types feature in ASP.NET Core Web API?**\ A. It allows clients to perform both read and write operations on OData-enabled endpoints.\ B. It enables batch processing of multiple OData requests.\ C. It provides support for querying and filtering data using the OData query syntax.\ D. It allows clients to request data in different formats such as JSON or XML. 113. **What is the purpose of the \$expand query option in OData?**\ A. It allows filtering the data based on specified conditions.\ C B. It performs aggregations on the queried data.\ C. It limits the number of results returned by the query.\ D. It enables including related entities in the query results 114. **You need to configure which type of behaviour to return exception detail from WCF service?**\ A. OperationBehavior\ B. EndpointBehavior\ C. MessageBehavior\ D. ServiceBehavior 115. **What is the \$filter query option used for in OData?**\ A. To specify the requested data fields in the response.\ B. To filter the results based on specified criteria.\ C. To include related entities in the response.\ D. To order the results based on specified criteria. 116. **What is CORS in ASP.NET Core Web API?**\ A. An attribute used to enable cross-origin requests\ B. A middleware that handles Cross-Origin Resource Sharing\ C. A policy used to configure cross-origin requests\ D. A feature used for caching responses from different origins 117. **How can you enable CORS using a named policy in ASP.NET Core Web API?**\ A. By configuring the policy in the ConfigureServices method of the Startup.cs file\ B. By setting the allowed origins in the Authorization header of the request\ C. By adding the policy configuration in the appsettings.json file\ D. By applying the \[EnableCors\] attribute with the policy name 118. **gRPC services couldn\'t hosted by which ASP.NET Core servers?**\ A. Kestrel\ B. HTTP.sys\ C. TestServer\ D. IIS\ E. None of the others 119. **What is the purpose of the \[Produces Response Type\] attribute in ASP.NET Core Web API?**\ A. It specifies the HTTP status codes that the action method can return.\ B. It enables caching of the response data.\ C. It defines the response type and format for the action method.\ D. It allows anonymous access to the action method. 120. **How can you specify the returned data properties in OData?**\ A. By using the \$order query option.\ B. By using the \$select query option.\ C. By using the \$expand query option.\ D. By using the \$filter query option. 121. **Which one is not a benefit of gRPC?**\ A. Modern, high-performance, lightweight RPC framework.\ B. Supports client, server, but does not allow bi-directional streaming calls.\ C. Contract-first API development, using Protocol Buffers by default, allowing for language agnostic implementations.\ D. Tooling available for many languages to generate strongly-typed servers and clients. 122. **Which file is the application configuration file in ASP.NET Core Web Application or Web API used to store the configuration settings (database connections strings, any application scope global variables)?**\ A. Startup.cs\ B. Program.cs\ C. appsettings. Development.json\ D. appsettings.json 123. **How can you enable CORS using endpoint routing in ASP.NET Core Web API?**\ A. By using the app. UseCors() method in the Configure method of the startup.cs file\ B. By configuring the CORS options in the appsettings.json file\ C. By setting the allowed origins in the Authorization header of the request\ D. By adding the \[EnableCors\] attribute to the Startup.cs file 124. **Choose the incorrect HTTP response components.**\ A. Each Response must have a unique URL.\ B. Response Headers.\ C. HTTP Status Code.\ D. Data Response can have data return to the client. 125. **Choose the correct information about scaling RESTful web services.**\ A. None of the others.\ B. RESTful web services support only support vertical scaling in communication.\ C. RESTful web services support both vertical and horizontal scaling.\ D. RESTful web services depend on the IP address and port number of the system to get a response. 126. **What does \"Accept: application/json; q=0.8, application/xml;q=0.9\" mean in the \"Accept\" header of an HTTP Request Message?**\ A. The server should respond with either JSON or XML data, but XML is preferred over JSON.\ B. The server should respond with XML data only.\ C. The server should respond with either JSON or XML data, but JSON is preferred over XML.\ D. The server should respond with JSON data only. 127. **What is the role of Model in ASP.NET Core MVC?**\ A. The Models in ASP.NET Core MVC contains a set of classes that are used to represent the domain data or business data as well as it also contains logic to manage the domain/business data.\ B. Models are responsible for the data and these data are used on Controllers.\ C. Both A and B.\ D. Neither A nor B. 128. **Choose the correct information about using CORS.**\ A. public void ConfigureServices (IServiceCollection services)\ {\ services.AddCors(o =\> o.AddPolicy(\"AllowOrigins\", builder =\>\ {\ builder. WithOrigins(\"http://localhost:5500\")\ AllowAny Method()\ AllowAny Header():\ })):II \...\ }\ public void Configure(IApplicationBuilder app. IWebHostEnvironment env)\ {\ }\ app. UseRouting():\ app. UseCors(\"AllowOrigins\");\ app. UseAuthorization():\ B. public void ConfigureServices (IServiceCollection services)\ {\ services.AddCors Provider(o =\> o. AddPolicy(\"AllowOrigins\", builder =\>\ {\ builder. WithOrigins(\"http://localhost:5500\")\ AllowAny AllowAny Header():\ })):\ II \...\ }\ Method()\ public void Configure/Application Builder ann WahHostEnvironment any) 129. **Choose the correct information about HTTP Request Pipeline**\ A. The Request Pipeline in ASP.NET Core Web API Application can have multiple middlewares\ B. All of the others.\ C. Once the pipeline is completed, then only it navigates the request to the corresponding controller action method.\ D. Before hitting the controller action method, the request has to pass through a pipeline. 130. **What does the \[EnableCors\] attribute do in ASP.NET Core Web API?**\ A. It enables CORS for a specific API controller or action method\ B. It specifies the allowed origins for CORS requests\ C. It enables CORS for all API endpoints globally\ D. It controls the caching behavior for CORS responses 131. **What is the purpose of the app. UseAuthorization() middleware in ASP.NET Core Web API?**\ A. It logs the response status codes and exceptions.\ B. It authenticates and logs incoming requests.\ C. It checks whether the request is authorized based on the user\'s claims or roles.\ D. It processes the request body and maps it to the appropriate model. 132. **Which JavaScript object is commonly used to make AJAX requests?**\ A. Fetch API\ B. XMLHttpRequest\ C. Promise\ D. JSON 133. **Which authentication middleware is commonly used with ASP.NET Core Identity?**\ A. UseAuthentication\ B. UseRouting\ C. UseEndpoints\ D. UseAuthorization 134. **Which of the following statements is true about Format-specific Action Results in ASP.NET Core Web API?**\ A. They are responsible for serialization and deserialization of data in Web API applications.\ B. They allow you to return different response formats based on the client\'s preferred media types.\ C. They provide authentication and authorization functionalities in Web API applications.\ D. They are used for handling routing and URL mapping in Web API applications 135. **What is microservice?**\ A. None of the others.\ B. Microservice is an architectural style that structures an application as a collection of services.\ C. Microservice is a software architectural design that structures an application as a collection of services.\ D. Microservice is a hardware design that structures a hardware of an application as a collection of services. 136. **What is gRPC (Remote Procedure Calls)?**\ A. gRPC relies on Protocol Buffers for the transport mechanism and Service Definition language.\ B. gRPC is a new and modern framework for building scalable, modern and fast API.\ C. All of the others.\ D. gRPC enables programmers to write micro-services in any language they want while keeping the ability to easily create communications between these services 137. **Which HTTP verb is used to create a new resource in a RESTful service?**\ A. GET\ B. PUT\ C. POST\ D. DELETE 138. **What is.NET for Docker containers?**\ A. A runtime environment for executing.NET applications in Docker containers\ B. A containerization platform developed by Microsoft\ C. A container orchestration tool for managing Docker containers\ D. A programming language specifically designed for Docker containers 139. **Which pattern can be used alongside DTOs (Data Transfer Objects) to simplify and automate the mapping between objects?**\ A. Mapper Pattern\ B. Factory Pattern\ C. Singleton Pattern\ D. Observer Pattern 140. **Which environment variable is commonly used to specify the ASP.NET Core environment?**\ A. APP\_ENV\ B. DOTNET\_ENVIRONMENT\ C. ASPNETCORE\_ENVIRONMENT\ D. ENVIRONMENT 141. **Which attribute are used in ASP.NET Core to specify the HTTP verb for a controller action?**\ A. \[Get\]. \[Post\]. \[Put\]. \[Delete\]\ B. \[HttpGET\]. \[HttpPOST\]. \[HttpPUT\]. \[HttpDELETE\]\ C. \[HttpGet\]. \[HttpPost\]. \[HttpPut\]. \[HttpDelete\]\ D. \[HttpGetAttribute\]. \[HttpPostAttribute\]. \[HttpPutAttribute\]. \[HttpDeleteAttribute\] 142. **Which method is used in \"ControllerBase\" class to redirect to another action or controller?**\ A. PartialView()\ B. RedirectToAction()\ C. View()\ D. RedirectToPageResult() 143. **Which attribute is used to mark a class as a data contract in WCF?**\ A. \[DataMember\]\ B. \[MessageContract\]\ C. \[ServiceContract\]\ D. \[DataContract\] 144. **What are authentication and authorization?**\ A. Authentication is the process of verifying who a user is, while authorization is the process of verifying what they have access to.\ B. Authorization determines whether users are who they claim to be.\ C. None of the others.\ D. Authorization is usually done before the authentication.\ E. Authentication determines what users can and cannot access.\ F. Authentication is the process of verifying what they have access to, while authorization is the process of verifying who a user is. 145. **You need to implement which interface for global exception handling in WCF?**\ A. IExceptionHandler\ B. IErrorHandler\ C. IWCFException\ D. IArgumentHandler 146. **Choose the correct information about the use of XMLHttpRequest (XHR) object to call the Web API.**\ A. var xhttp = new XMLHttpRequest():\ xhttp.openurl(\"GET\", \"[https://localhost:44324/api/ApiControllerName\"](https://localhost:44324/api/ApiControllerName), true):xhttp.send():\ B. var xhttp = new XMLHttpRequest();\ xhttp.open(\"POST\", \"[https://localhost:44324/api/ApiControllerName\"](https://localhost:44324/api/ApiControllerName), true):xhttp.sendpost():\ C. var xhttp = new XMLHttpRequest():\ xhttp.openurl(\"GET\", \"[https://localhost:44324/api/ApiControllerName\"](https://localhost:44324/api/ApiControllerName), true):xhttp.sendrequest():\ D. var xhttp = new XMLHttpRequest():\ xhttp.open(\"GET\", \"[https://localhost:44324/api/ApiControllerName\"](https://localhost:44324/api/ApiControllerName), true);xhttp.send(): 147. **What is the purpose of the \[AllowAnonymous\] attribute in ASP.NET Core authentication?**\ A. To specify multiple authentication schemes for an action method\ B. To allow anonymous access to a specific controller, overriding authentication rules\ C. To allow anonymous access to an action method, overriding authentication rules\ D. To skip model validation for a specific action method 148. **How can you include route parameters in Attribute Routing?**\ A. By adding the parameter name directly in the route template\ B. By adding curly braces {} around the parameter name in the route template\ C. By using the \[RouteParam\] attribute before the parameter name in the action method\ D. By adding square brackets \[\] around the parameter name in the route template 149. **What is the main difference between \[DataContract\] and \[MessageContract\] in WCF?**\ A. \[DataContract\] is used for defining message headers, while \[MessageContract\] is used for defining message bodies.\ B. \[DataContract\] is used for defining data structures, while \[MessageContract\] is used for defining message formats.\ C. \[DataContract\] is used for request messages, while \[MessageContract\] is used for response messages.\ D. \[DataContract\] is used for contract-first development, while \[MessageContract\] is used for code-first development. 150. **Which of the following statements is true about DTOs (Data Transfer Objects)?**\ A. DTOs should closely resemble the structure of database tables\ B. DTOs should contain complex business logic and validation rules\ C. DTOs are typically mutable objects\ D. DTOs are lightweight objects used for data transfer and do not contain behavior 151. **What is the Entity Data Model (EDM) in OData ASP.NET Core Web API? Câu 42 của đề nào đó**\ A. It is a library for serializing and deserializing data in OData ASP.NET Core Web API applications.\ B. It is a model that represents the structure and relationships of the data entities in the OData API.\ C. It is a database schema used for data storage in OData ASP.NET Core Web API.\ D. It is a framework for building RESTful APIs in OData ASP.NET Core Web API. 152. **What is the purpose of an OData controller in ASP.NET Core Web API?**\ A. To expose OData endpoints and handle OData-specific queries.\ B. To serialize and deserialize data in OData format.\ C. To handle routing and URL mapping.\ D. To provide authentication and authorization functionalities. 153. **Can you have multiple \[Route\] attributes on a single action method in ASP.NET Core Web API?**\ A. No, it is not supported in Attribute Routing\ B. Yes, it allows you to define multiple routes for the same action method\ C. Yes, but only for different controller classes\ D. Yes, but only for different HTTP methods 154. **What is the purpose of the UseEndPoints middleware in ASP.NET Core Web API?**\ A. To map incoming requests to appropriate endpoint handlers\ B. To provide authentication and authorization features\ C. To enable routing for static files in the web application\ D. To handle HTTP requests and responses 155. **Which of the message exchange patterns is not supported in WCF?**\ A. Multi-way\ B. One-way\ C. Request-reply\ D. Duplex 156. **Which of the following is a benefit of using OData in ASP.NET Core Web API?**\ A. Increased performance for API requests.\ B. Simplified data access and query capabilities.\ C. Enhanced support for file uploads and downloads.\ D. Improved security for API endpoints. 157. **Which package in ASP.NET Core is commonly used for implementing JWT authentication?**\ A. Microsoft. EntityFramework Core\ B. Microsoft.AspNetCore.Http\ C. Microsoft.AspNetCore.Mvc\ D. Microsoft.AspNetCore. Authentication.JwtBearer 158. **Which is not an attribute that can be used to configure the behavior of web API controllers and action methods?**\ A. \[Binding\]\ B. \[Route\]\ C. \[HttpGet\]\ D. \[Produces\] 159. **What is the purpose of using media types (MIME types) in RESTful services?**\ A. To define the URL structure for resource endpoints\ B. To enforce security protocols in the communication\ C. To change a resource in a RESTful service\ D. To specify the format of the data being sent or received 160. **How can you pass multiple dynamic values in the route template of an ASP.NET Core Web API endpoint?**\ A. By using the \[MultipleValues\] attribute on the route parameter\ B. By passing the values as query string parameters\ C. By separating the values using commas (.)\ D. By using multiple route parameters in the route template 161. **What is the role of the \"Accept\" header in Content Negotiation?**\ A. It specifies the encoding format for the request body.\ B. It specifies the client\'s preferred media types for the response.\ C. It specifies the content type that the server should return.\ D. It specifies the authentication credentials for the request. 162. **JavaScript is a powerful programming language for calling ASP.NET Core Web API. Which object is used to call the Web API from JavaScript object?**\ A. XMLHttpResponse (XHR) object\ B. XMLHttpRequest (XHR) object\ C. XMLHttpResponseObject (XHR) object\ D. XMLHttpRequestObject (XHR) 163. **To test your mappings with AutoMapper, you need to create a test that does the thing(s). Call your bootstrapper class to create all the mappings and call MapperConfiguration.AssertConfigurationls Valid**\ A. var config = AutoMapperConfiguration. Configure():config. AssertConfigurationls NotValid():\ B. var config = AutoMapperConfiguration. Configure():config. AssertAllConfigurationlsValid():\ C. var config AutoMapperConfiguration. Configure():config. AssertConfigurationlsValid(true):\ D. var config = AutoMapperConfiguration. Configure():config. AssertConfigurationlsValid(): 164. **What types of variables can be used in a route template in ASP.NET Core Web API?**\ A. Any type of data\ B. Only integers\ C. Only predefined types like DateTime or Guid\ D. Only strings 165. **Which of the following open-source libraries is used by WEB API for JSON serialization?**\ A. Json.NET\ B. System.Data.Json.NET\ C. System.Text.Json\ D. Microsoft.Extensions.Json.NET 166. **How to add gRPC services to an ASP.NET Core application (in Startup.cs)?**\ A. public void ConfigureServices (IServiceCollection services) {\ services.AddGrpc():\ }\ B. public void ConfigureServices (IApplication Builer services)\ { services.AddGrpc():\ }\ C. public void Configure(IServiceCollection services) {\ services.AddGrpc():\ }\ D. public void Configure(IApplication Builder services)\ { services.AddGrpc()\ } 167. **What is the purpose of the NegotiateContent method in IContentNegotiator?**\ A. It negotiates and selects the appropriate response format based on the client\'s preferences.\ B. It checks for authentication and authorization.\ C. It handles routing and URL mapping.\ D. It handles serialization and deserialization of data 168. **How is a one-to-many relationship represented in OData?**\ A. By linking the parent entity to the related entities using navigation properties.\ B. By including the related entity IDs as an array within the parent entity.\ C. By embedding the related entities\' data within the parent entity.\ D. By creating separate tables for each relationship type. 169. **Which OData operator is used to perform paging of data?**\ A. \$expand\ B. \$skip\ C. \$top\ D. \$filter 170. **Use the EF Core Migrations feature to create the database. Choose the correct information.**\ A. The Migrations is a set of tools that create and update a database to match the data model.\ B. The Update Database of Migration is a set of tools that create and update a database to match the data model.\ C. The Migrations is a set of Web API component that create and update a database to match the data model.\ D. None of the others. 171. **What is the purpose of the \"route parameters\" in a RESTful service?**\ A. They control the behavior of caching in RESTful services\ B. They are used to define the response format (e.g.. JSON or XML)\ C. They allow for passing data as part of the URL to identify specific resources\ D. They are used to specify the type of HTTP verb to be used 172. **Choose the correct information about validation attributes.**\ A. Validation attributes allow to specify validation rules for model methods.\ B. Validation attributes allow to specify validation rules for model properties.\ C. Validation attributes allow to specify validation rules for both model method and model property.\ D. Validation attributes allow to specify validation rules for model properties first, then apply for model methods. 173. **Choose the correct information.**\ A. REST web services communicate over the HTTP specification, using HTTP vocabulary\ B. REST is an architectural pattern for developing web services as opposed to a specification\ C. REST stands for Representational State Transfer\ D. All of the others. 174. **Choose the suitable reasons for choosing.NET for Web Services.**\ A. Cross-platform.\ B. Targeting microservices.\ C. Side-by-side.NET versions per application.\ D. All of the others 175. **Which of the following is a security issue with web services?**\ A. Confidentiality\ B. Authentication\ C. Network Security\ D. Cyber Security\ E. All of the others.\ F. None of the others. 176. **What media type formatters in ASP.NET Core Web API?**\ A. Media type formatters are classes that are responsible for serialization data.\ B. The Web API cannot understand request data format in serializing request/response data and send data in a format that the client expects.\ C. XmlMediaTypeFormatter class handles HTML form URL-encoded data.\ D. JsonMediaTypeFormatter class handles both XML format and JSON format. 177. **Choose the correct information in asynchronous programming with ASP.NET Web API about the return type.**\ A. Task\, for an async method that returns a value.\ B. Task, for an async method that does not return a value.\ C. void, which we can use for an event handler.\ D. All of the others.\ E. None of the others. 178. **Which query function that the Web API is not support standard OData string?**\ A. containsIgnoreCase Sfilter=containsignorecase(name,\'(Sample)\')\ B. contains Sfilter=contains(name,\'(sample)\')\ C. endswith Sfilter=endswith(name, \'Inc.\')\ D. startswith \$filter=startswith(name,\'a\') 179. **What is an API?**\ A. An API is a set of definitions and protocols for building and integrating application software.\ B. An API is sometimes referred to as a contract between an information provider and an information user-establishing the content required from the consumer (the call) and the content required by the producer (the response).\ C. None of the others.\ D. All of the others. 180. **Web API does not automatically return an error to the client when validation fails. It is up to the controller action to check the model state and respond appropriately. Which property is using in this case?**\ A. ModelState.IsValid\ B. ModelState.IsCorrect\ C. ModelState.IsVerify\ D. ModelState.Is True 181. **Which the OData query option that ASP.NET Core Web API support the data sorting?** A. \$filter\ B. \$orderby\ C. \$expand\ D. \$skip 182. **How to create a custom formatter class in ASP.NET Core Web API?**\ A. 1. Derive the class from the appropriate base class (could be TextOutputFormatter and TextInputFormatter).\ 2. Specify valid media types and encodings in the constructor.\ 3. Override the CanReadType and CanWriteType methods.\ 4. Override the ReadRequestBodyAsync and WriteResponseBody Async methods.\ B. 1. Specify valid media types and encodings in the constructor.\ 2. Derive the class from the appropriate base class (could be TextOutputFormatter and TextInputFormatter).\ 3. Override the CanReadType and CanWriteType methods.4. Override the ReadRequestBodyAsync and WriteResponseBody Async methods.\ C. 1. Override the CanReadType and CanWriteType methods.\ 2. Override the ReadRequestBodyAsync and WriteResponseBody Async methods.\ 3. Derive the class from the appropriate base class (could be TextOutputFormatter and TextInputFormatter).\ 4. Specify valid media types and encodings in the constructor.\ D. None of these 183. **How to register the OData Endpoint?**\ A. app.UseEndpoints (endpoints =\>\ endpoints.EnableDependency Injection();\ endpoints.Select().Count().Filter(). OrderBy().MaxTop (100). SkipToken().Expand();endpoints.MapControllers();\ });\ B. app.UseEndpoints (endpoints =\>\ {\ endpoints.CreateDependency Injection();\ endpoints.Select().Count().Filter(). OrderBy().MaxTop (100). SkipToken().Expand();endpoints.EnableControllers();\ });\ C. app.CreateEndpoints (endpoints =\>{\ endpoints.EnableDependency Injection();endpoints.Select().Count(). Filter(). OrderBy().MaxTop(100). SkipToken(). Expand();endpoints.MapControllers();\ });\ D. app.CreateEndpoints (endpoints =\>{\ endpoints.CreateDependency Injection();\ endpoints.Select().Count().Filter().OrderBy().MaxTop(100). SkipToken().Expand();endpoints CreateControllers(): 184. **When the client sends a request message (HTTP request message), it can include an Accept header. The Accept header tells the server which media type(s) the client wants from the server. Choose the correct information about the following Accept header\ Accept: text/html,application/xhtml+xml,application/xml**\ A. This header of HTTP Message tells the server that the client wants either HTML, XHTML, or XML.\ B. HTTP response contains a PNG image.\ C. All of the others\ D. None of the other 185. **Which one is not communication in microservices?**\ A. Synchronous messaging\ B. Asynchronous messaging\ C. Concurrency messaging\ D. None of the others. 186. **What is model binding?**\ A. Model binding is a process of ASP.NET Core framework to extract data from HTTP Requests and provide them to the arguments of Action Method.\ B. Model binding is a process of ASP.NET Core framework to extract data from HTTP Responses and provide them to the arguments of Action Method.\ C. Model binding is a process of ASP.NET Core framework to extract data from both HTTP Responses and provide them to the arguments of Action Method.\ D. None of the others. 187. **Choose the correct information about security with RESTful Web Services.**\ A. Validation - Validate all inputs on the server. Protect your server against SQL or NoSQL injection attacks.\ B. Session Based Authentication - Use session based authentication to authenticate a user whenever a request is made to a Web Service method.\ C. No Sensitive Data in the URL - Never use username, password or session token in a URL, these values should be passed to Web Service via the POST method.\ D. All of the others.\ E. None of the others. 188. **In the case the request is simple, input parameter are of type int, string, boolean, GUID, deci available in the URL, then such kind of request is mapped to what model binding** A. primitive model binding\ B. complex model binder\ C. extraction model binder\ D. combination model binding 189. **Choose the correct information about ControllerBase class in ASP.NET Core Web API.** A. A base class for an MVC controller without view support.\ B. The context associated with the current request for a controller. C The context associated with the current session for a controller.\ D. A base class for an MVC controller without model support. 190. **JavaScript is a powerful programming language for calling ASP.NET Core Web API. Which ( call the Web API from JavaScript object?** B A. XMLHttpRequestObject (XHR)\ B. XMLHttpResponseObject (XHR) object\ C. XMLHttpRequest (XHR) object\ D. XMLHttpResponse (XHR) object 191. **What are Data Transfer Objects (DTOs)?** A. The DTOs can be known as ViewModels in MVC where you only want to expose relevant data to the View.\ B. None of the others.\ What are Data Transfer Objects (DTOs)?\ C. All of the others.\ D. Data Transfer Objects (DTOs) are classes that define a Model with sometimes predefined validation in place for HTTP responses and requests 192. A binding source attribute defines the location at which an action parameter\'s value is found.a binding source attribute? A. 193. **What is Open Web Interface for.NET (OWIN)?**\ A. All of the others.\ B. OWIN defines a standard way for middleware to be used in a pipeline to handle requests and associated responses.\ C. ASP.NET Core applications and middleware can interoperate with OWIN-based applications, servers, and middleware.OWIN allows web apps to be decoupled from web servers.\ D. None of the others. 194. **Which one is not a middleware in ASP.NET Core Web API?** A. Authorize\ B. Routing\ C. Authentication\ D. Consulting