prn221

0.0(0)
studied byStudied by 11 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/125

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

126 Terms

1
New cards
b
Which of the following methods of the JsonSerialization class can be used to convert a value of the speciêed type into a JSON string,encoded as UTF-8 bytes?
a. None of the others
b. SerializeToUtf8Bytes()
c. Serialize8Bytes()
d. SerializeToUTF8()
2
New cards
c
Which of the following methods of the XmlSerializer class returns an object used to read the XML document to be serialized?
a. CreateObject()
b. GetReader()
c. CreateReader()
d. GetObjectReader()
3
New cards
c
Choose the incorrect statement about Uniform Resource Identifi er (URI)
a. The Uri class in the System namespace performs just this division, exposing a property for each element
b. A URI (Uniform Resource Identifi er) is a specially formatted string that describes a resource on the internet or a LAN, such as a
web page, fi le, or email address
c. URI is a subset of Uniform Resource Location (URL) that describes the network address or location where the source is available
d. A URI can be broken up into a series of elements—typically, scheme, authority, and path
4
New cards
b
Choose the correct statement about PresentationFramework.dll assembly in the WPF Architecture
a. It provides basic types like UIElement and Visual. The UIElement defi nes the actions and element layout properties and provides
classes to override them if required
b. It provides the basic types to build a WPF application, such as windows, controls, shapes, media, documents, animation, data bindings, style, etc
c. None of the others
d. It holds the WPF basic types like DependencyProperty, DependencyObject, DispatcherObject, and other types
5
New cards
a
What is Windows Presentation Foundation (WPF)?
a. WPF is a UI framework that creates desktop client applications
b. WPF is a UI framework that creates web applications
c. WPF is a UI framework that creates mobile applications
d. WPF is a UI framework that creates API.
6
New cards
c
Choose the correct statement about Windows Presentation Foundation (WPF)
a. The WPF is only supported by the .NET Core
b. The WPF is only supported by the both .NET Framework and .NET Core
c. The WPF supports a broad set of application development features, including an application model, resources, controls, graphics,
layout, data binding, documents, and security
d. WPF uses the Extensible Markup Language (XML) to provide a declarative model for application programming
7
New cards
a
Which of the following commands can be used to create a WPF application named MyApp by .NET CLI tool?
a. dotnet new wpf -n MyApp
b. dotnet create wpf -n MyApp
c. dotnet new wpf MyApp
d. dotnet create wpf -l MyApp
8
New cards
a
Which of the following is one of the serialization engines in .NET?
a. XmlSerializer
b. ObjectSerializer
c. StreamSerializer
d. DataSerializer
9
New cards
a
U04-Q003 Which of the following is one of the basic procedures to distribute tasks in systems with multiple processors?
a. Symmetrical multiprocessing (SMP)
b. Asynchronous multiprocessing (AMP)
c. All of the others
d. Synchronous multiprocessing (SNP)
e. None of the others
10
New cards
c
Choose the main purpose of the Razor Pages PageModel class.
a. To provide the easy way to reduce the code for the UI components.
b. To provide the easy way to understand the UI components with processing code logic for the page.
c. To provide clear separation between the UI layer (the .cshtml view fi le) and processing logic for the page.
d. To provide clear separation between the UI layer (the .cshtml.cs view fi le) and processing logic for the page.
11
New cards
c
Which of the following statements related to the Single Responsibility Principle is True?
a. A class should be inherited from many other classes
b. A class should be implemented from multiple interfaces
c. A class should have only a single responsibility
d. None of the others
12
New cards
b
Suppose that you want to configure the root folder for Razor Pages to be something other than the default. What the following code should you put in ConfigureServices method of Startup.cs file?

a.
public void ConfigureServices(IServiceCollection services)
{
services.AddRazorPages();
}

b.
public void ConfigureServices(IServiceCollection services)
{
services.AddRazorPages().AddRazorPagesOptions(options \=\> {
options.RootDirectory \= "/Content";
});
}

c.
public void ConfigureServices(IServiceCollection services)
{
services.AddRazorPages().AddRazorPagesOptions("/Content");
}

d.
public void ConfigureServices(IServiceCollection services)
{
services.AddRazorPages().AddRazorPagesRootDirectory(options \=\> {
options.RootDirectory \= "/Content";
});
}
Clear my choice
13
New cards
d
What is the Deserialization process?
a. Deserialization is the reverse process where the binary stream is used to recreate the actual data in the application
b. Deserialization is the act of taking data from XML or JSON and convert to bytes stream
c. Deserialization works in reverse, taking a data stream and reconstituting it into in-memory objects and stored on client-side
d. Deserialization works in reverse, taking a data stream and reconstituting it into an in-memory object or object graph
14
New cards
d
Choose the correct answer with Server-side validation in Razor Pages.
a. if (!ModelState.IsCorrect)
{
return Page();
}
b. if (!ModelState.IsTrue)
{
return Page();
}
c. if (!ModelState().IsValid())
{
return Page();
}
d. if (!ModelState.IsValid)
{
return Page();
}
15
New cards
d
The scaffolding tool features a number of generators including ones for producing MVC areas, controllers and views, and Razor Pages. Choose the templates exist for Razor Pages.
a. Empty, Create, Edit, Delete, Details, ListAll
b. Empty, AddNew, Edit, Delete, Details, ListAll
c. Empty, New, Edit, Delete, Details, List
d. Empty, Create, Edit, Delete, Details, List
16
New cards
c
Choose the correct anwser for Symmetrical multiprocessing (SMP).
a. None of the others
b. Usually, one processor acts as the main processor. It works as a manager and is in charge of distributing the tasks to the other
available processors, using diff erent kinds of algorithms for this purpose
c. Any available processor or core can execute tasks. The most used and effi cient one is n-way symmetrical multiprocessing,
where n is the number of installed processors. With this procedure, each processor can execute a task isolated from the rest
and also when a particular software is not optimized for multiprocessing systems
d. All of the others
17
New cards
c
What is not a role of System.Threading.Tasks Namespace in Parallel Programming?
a. Provides types that simplify the work of writing concurrent and asynchronous code
b. All of the others
c. None of the others
d. The main types are Task which represents an asynchronous operation that can be waited on and cancelled, and
Task
18
New cards
d
Which of the following methods of the HttpClient Class can be used to send a GET request to the specifi ed Uri as an asynchronous
operation?
a. GetDataAsync(String)
b. GetStringAsync(String)
c. None of the others
d. GetAsync(String)
19
New cards
c
Choose the correct answer about ASP.NET SignalR.
a. SignalR also provides a very simple, high-level API for doing server to client RPC in your ASP.NET application, as well as adding
useful hooks for connection management, for example connect/disconnect events, grouping connections, authorization.
b. ASP.NET SignalR is a new library for ASP.NET developers that makes it incredibly simple to add real-time web functionality to
your applications.
c. All of the others.
d. SignalR can be used to add any sort of "real-time" web functionality to your ASP.NET application.
20
New cards
c
What is not property of the System.Threading.Tasks.Task class
a. IsCompleted
b. IsCanceled
c. IsCorrected
d. Status
e. CompletedTask
21
New cards
c
Choose the correct statement related to the WebResponse Class
a. The WebResponse class is the abstract base class from which protocol-specifi c response classes are derived
b. Applications can participate in request and response transactions in a protocol-agnostic manner using instances of the
WebResponse class
c. All of the others
d. Client applications do not create WebResponse objects directly, they are created by calling the GetResponse method on a
WebRequest instance
22
New cards
b
SignalR provides two models for communicate between clients and severs: Persistent Connections, Hubs. Choose the correct
information about Persistent Connections.
a. Persistent Connections provide a High-level API for the client and server to call each other's method. It will be very familiar to
those developers who have worked on remote invocation APIs.
b. Persistent Connections provide direct access to a low-level communication protocol that signalR provides. Each client
connection to a server is identifi ed by a connectionID.
c. None of the others.
d. If you have multiple types of messages that you want to send between a server and a client then it is recommended to use
Persistent Connections so you do not need to do your own dispatching.
23
New cards
d
Choose the correct option to create hub fi lters.
a. None of the others
b. Create a fi lter by declaring a class that inherits from Hub
24
New cards
d
Which of the following properties of the WebRequest class can be used to get the URI of the Internet resource associated with the
request?
a. RequestParam
b. None of the others
c. RequestURL
d. RequestUri
25
New cards
a
Which of the following ways can be used to create a task using Task class in .NET?
a. All of the others
b. Using lambda expressions syntax
c. Using the Action delegate
d. Using delegate
26
New cards
d
Which of the following statements related to the Hyper-Threading (HT) is True?
a. Hyper-threading (HT) enabled single processor chips to run with sixteen virtual (logical) cores and are capable of executing
sixteen tasks at a time
b. None of the others
c. All of the others
d. In Hyper-threading (HT) technology, each of these logical cores is called a hardware thread and can be scheduled separately by
the operating system (OS) scheduler
e. Hyper-threading (HT) technology is a proprietary technology that was developed by Intel that improves the sequential
processing of computations
27
New cards
b
In the case working ASP.NET SignalR with JavaScript client library, which the following code to create and start a connection?
a. var connection \= new signalR.HubBuilder()
.withUrl("/chatHub")
.build();
connection.start();
b. var connection \= new signalR.HubConnectionBuilder()
.withUrl("/chatHub")
.build();
connection.start();
c. var connection \= new signalR.ConnectionBuilder()
.withUrl("/chatHub")
.build();
connection.start();
d. var connection \= new signalR.HubConnectionBuilder()
.withUrl("/chatHub")
.create();
connection.start()
28
New cards
b
Which of the following statements related to Protocol is True?
a. TCP (Transmission Control Protocol) is a connection-based protocol (only one connecting line only) that provides a reliable flow
of data between two computers based on the acknowledged mechanism
b. All of the others
c. UDP (User Datagram Protocol) is a protocol that sends independent packets of data, called datagrams, from one computer to
another with no guarantees about the arrival
d. The protocol is set rules for packaging data of a network communication because client and server can be working in diff erent
platform
29
New cards
c
Which of the following properties of the HttpClient Class can be used to get or set the base address of Uniform Resource Identifi er
(URI) of the Internet resource used when sending requests?
a. ContentURI
b. BaseURI
c. BaseAddress
d. GetAddress
30
New cards
c
Which of the following statements related to Worker Service .NET is False?
Statement 1: A worker service is a .NET project built using a template which supplies a few useful features that turn a regular console
application into something more powerful
Statement 2: A worker service runs on bottom of the concept of a host, which maintains the lifetime of the application. The host also
makes available some familiar features, such as dependency injection, logging, and configuration
a. Statement 2
b. Statement 1
c. None of the others
d. Statement 1 and 2
31
New cards
c
Which of the following methods of the WebResponse Class that returns the data stream from the Internet resource?
a. CreateResponseStream()
b. GetStream()
c. GetResponseStream()
d. GetResponse()
32
New cards
a
Choose the correct statement related to Mono-Processor Systems
a. The mono-processor systems use old-fashioned, classic computer architecture and were developed by the outstanding
mathematician, John von Neumann
b. The microprocessor receives data from fi le streams, executes the necessary processes, and sends the results in an output fi le
c. The mono-processor system works with many users and many tasks running
33
New cards
b
Choose the correct statement about key components of the System.Net.* Namespaces
a. WebRequest and WebResponse classes for high-level control over client-side TCP or UDP operations
b. A WebClient facade class for simple download/upload operations via HTTP or FTP
c. HttpServer for consuming HTTP web APIs and RESTful services
d. All of the others
34
New cards
c
Which of the following statements related to Task Parallel Library (TPL) is False?
a. None of the others
b. All of the others
c. The Task Parallel Library (TPL) is a set of public types and APIs in the System.TPL and System.Threading.Tasks namespaces
d. By using TPL, we can maximize the performance of our code while focusing on the work that our program is designed to
accomplish
35
New cards
b
To enable SignalR in the specifi c application, call the AddSignalR extension method to confi gure the IoC container with services
required by SignalR. Choose following code to add to Confi gureServices method (Startup.cs).
a. public void Confi gureServices (IServiceCollection services)
{
// ...
services.AddSignalR().Start();
}
public void Confi gure(IApplicationBuilder app, HostingEnvironment env)
{
// ...
app.UseAuthentication();
app.UseMvc();
app.UseSignalR (builder \=\>
{
builder.MapHub< ChatHubClass \>("/chat").Start();
});
}
b. public void Confi gureServices (IServiceCollection services)
{
// ...
services.AddSignalR();
}
public void Confi gure(IApplicationBuilder app, HostingEnvironment env)
{
// ...
app.UseAuthentication();
app.UseMvc();
app.UseSignalR (builder \=\>
{
builder.MapHub
36
New cards
d
A hub is a class that serves as a high-level pipeline that handles client-server communication. Create a SignalR for your application by
adding a class named ChatHub that inherits from Microsoft.AspNetCore.SignalR.Hub
a. public class ChatHub : IHubContext
{
public async Task SendMessage(string user, string message)
{
await Clients.All.SendAsync("ReceiveMessage", user, message);
}
}
b. public class Hub : ChatHub
{
public async Task SendMessage(string user, string message)
{
await Clients.All.SendAsync("ReceiveMessage", user, message);
}
}
c. public class ChatHub : IHub
{
public async Task SendMessage(string user, string message)
{
await Clients.All.SendAsync("ReceiveMessage", user, message);
}
}
d. public class ChatHub : Hub
{
public async Task SendMessage(string user, string message)
{
await Clients.All.SendAsync("ReceiveMessage", user, message);
}
}
37
New cards
b
ASP.NET Core SignalR supports two protocols for encoding messages. Each protocol has serialization confi guration options. Please
choose the correct protocols.
a. BSON and MessagePack
b. JSON and MessagePack
c. JSON and BSON
d. JSON and XML
38
New cards
b
Choose the correct statement related to the HttpClient Class
a. HttpClient was written in response to the growth of TCP-based web APIs and TCP services to provide a better experience than
the WebClient class
b. HttpClient provides another layer on top of HttpWebRequest and HttpWeb Response
c. None of the others
d. HttpClient is a newer API for working with TCP Service and is designed to work well with libraries, REST-based services, and
custom authentication schemes
39
New cards
bd
Choose the incorrect statement related to Networking Definitions
a. IP address includes IPv4 (4-byte) and IPv6 (6-byte)
b. IP address (Internet Protocol): unsigned integer helps to identify a network element(computer, router, etc)
c. None of the others
d. Port: unsigned 4-byte integer helps operating system diff erentiating a network communicating process
40
New cards
c
Which of the following applications that Worker Services will generally be long-running services, performing some regularly occurring
workload?
a. Aggregating data from a data store
b. Processing messages/events from a queue, service bus, or event stream
c. All of the others
d. None of the others
e. Reacting to fi le changes in an object/fi le store
41
New cards
c
To confi gure a custom number of reconnect attempts before disconnecting or change the reconnect timing, the
withAutomaticReconnect accepts an array of numbers representing the delay in milliseconds to wait before starting each reconnect
attempt. Choose the correct option for making automatically reconnect.
a. const connection \= new signalR.HubConnectionBuilder()
.withUrl("/chathub")
.withAutomaticReconnect([0], [0], [10000])
.build();
b. const connection \= new signalR.HubConnectionBuilder()
.withUrl("/chathub")
.withAutomaticReconnect(0, 0, 10000)
.create();
c. const connection \= new signalR.HubConnectionBuilder()
.withUrl("/chathub")
.withAutomaticReconnect([0, 0, 10000])
.build();
d. const connection \= new signalR.HubConnectionBuilder()
.withUrl("/chathub")
.withAutomaticReconnect([0, 0, 10000])
.create();
42
New cards
a
Which of the following classes of the System.Threading.Tasks Namespace provides support for creating and scheduling Task objects?
a. TaskFactory
b. TaskInit
c. None of the others
d. Task
e. TaskScheduler
43
New cards
b
Which of the following is a valid JSON Document to store an array of objects?
a. {
"employees":[
{'fi rstName'\=John; 'lastName'\=Doe},
{'fi rstName'\=Anna; 'lastName'\=Smith}
]
}
b. {
"employees":[
{"fi rstName":"John", "lastName":"Doe"},
{"fi rstName":"Anna", "lastName":"Smith"}
]
}
c. [
"employees":{
\["fi rstName":"John", "lastName":"Doe"],
\["fi rstName":"Anna", "lastName":"Smith"]
}
]
d. [
"employees":{
{"fi rstName":"John", "lastName":"Doe"},
{"fi rstName":"Anna", "lastName":"Smith"}
}
]
44
New cards
c
Choose the correct statement(s) about Windows Presentation Foundation (WPF)
a. All of the others.
b. WPF is not include a fl exible hosting model, which makes it straightforward to host a video in a button
c. WPF version 3.0 was fi rst released as a part of .NET Framework 3.0 in the year 2006 and received its major updates and
enhancements in version 3.5 released by .NET Framework 3.5
d. None of the others
45
New cards
c
For the Uniform Resource Identifi er (URI) as follows: http://www.myweb.com:8888/info/page.html?query\#top. What is the
AbsolutePath?
a. /info/page.html?query\#top
b. /page.html?query
c. /info/page.html
d. /info/page.html?query
46
New cards
c
Which of the following statements about the JsonSerializer is True?
a. Provides functionality to serialize data or reference types to JSON and to deserialize JSON into streams
b. None of the others
c. Provides functionality to serialize objects or value types to JSON and to deserialize JSON into objects or value types
d. Provides functionality to serialize objects into text documents and deserialize them into fi le streams
47
New cards
b
Choose the correct information about JsonSerializerOptions.
a. var option \= new JsonSerializerOptions(){
Write \= true,
ReadCommentHandling \= JsonCommentHandling.Skip,
AllowTrailingCommas \= true
};
b. var option \= new JsonSerializerOptions(){
WriteIndented \= true,
ReadCommentHandling \= JsonCommentHandling.Skip,
AllowTrailingCommas \= true
};
c. var option \= new JsonSerializerOptions(){
WriteIndenting \= true
a. var option \= new JsonSerializerOptions(){
Write \= true,
ReadCommentHandling \= JsonCommentHandling.Skip,
AllowTrailingCommas \= true
};
b. var option \= new JsonSerializerOptions(){
WriteIndented \= true,
ReadCommentHandling \= JsonCommentHandling.Skip,
AllowTrailingCommas \= true
};
c. var option \= new JsonSerializerOptions(){
WriteIndenting \= true
48
New cards
e
Which of the following ways can be used to implement the Dependency Injection in the .NET application?
a. Property Injection
b. Method Injection
c. None of the others
d. Constructor Injection
e. All of the others
49
New cards
d
Which of the following data type is not supported by JSON?
a. Boolean
b. Number
c. Object
d. Byte
50
New cards
e
Which of the following statements related to the Inversion of Control (IoC) is True?
a. None of the others
b. All of the others
c. It is used to invert diff erent kinds of controls in object-oriented design to achieve high coupling
d. It makes the application diffi cult to test and maintain
e. It is a design principle
51
New cards
b
For the Uniform Resource Identifi er (URI) as follows :
http://www.domain.com:9999/info/page.html?query\#top
What is the host?
a. http://www.domain.com
b. www.domain.com
c. http://
d. www.domain.com:9999
52
New cards
b
Which of the following attributes of the JSON can be used to prevent a property from being serialized or deserialized?
a. EmptyAttribute
b. IgnoreAttribute
c. None of the others
d. PropertyAttribute
53
New cards
b
Which of the following methods of the HttpClient Class can be used to send a POST request to the specifi ed Uri as an asynchronous
operation?
a. CreatePostAsync(String, HttpContent)
b. PostAsync(String, HttpContent)
c. PostRequestAsync(String, HttpContent)
d. PutAsync(String, HttpContent)
54
New cards
a
Choose the correct statement about eXtensible Application Markup Language (XAML) in the WPF
a. All of the others
b. XAML directly represents the instantiation of objects in a specifi c set of backing types defi ned in assemblies
c. XAML is a declarative markup language. As applied to the .NET Core programming model, XAML simplifi es creating a UI for a
.NET Core app
d. XAML enables a workfl ow where separate parties can work on the UI and the logic of an app, using potentially diff erent tools
55
New cards
a
Which of the following assemblies belongs to the WPF Managed Layer in the WPF Architecture?
a. All of the others
b. WindowBase.dll
c. PresentationFramework.dll
d. PresentationCore.dll
56
New cards
b
Which of the following is one of the basic features of Dependency Injection (DI)?
a. Maintenance
b. Registration
c. Implementation
d. Deployment
57
New cards
a
Give the block of code
\[XmlRoot("Candidate")]
public class Person {
\[XmlElement("FirstName")]
public string Name { get; set; }
\[XmlElement("RoughAge")]
public int Age { get; set; }
}
class Program{
static void Main(string[] args){
Person p1 \= new Person() { Name\="David", Age\=30 };
var xs \= new XmlSerializer(typeof(Person));
using Stream s1 \= File.Create("pe.xml");
xs.Serialize(s1, p1);
s1.Close();
using Stream s2 \= File.OpenRead("person.xml");
var p2 \= (Person)xs.Deserialize(s2);
Console.WriteLine("\****Person Info\****");
Console.WriteLine($"Name: {p2.Name}, Age: {p2.Age}");
s2.Close();
Console.ReadLine();
}
}
Choose the result.
a. Throws an exception
b. \****Person Info\****





c. \****Person Info\****
Name: David, Age: 30
d. Syntax Error
58
New cards
b
Model Binding in Razor Pages is the process that takes values from HTTP requests and maps them to handler method parameters or
PageModel properties. Choose the correct way to bind the posted form values to handler method parameters.
a. [BindProperties]
public class ModelBindingDemo : PageModel
{
\[BindProperty]
public string Name { get; set; }
\[BindProperty]
public string Email { get; set; }
public void OnGet()
{
}
public void OnPost()
{
ViewData["confi rmation"] \= $"{Name}, information will be sent to {Email}";
}
}
b. public class ModelBindingDemo : PageModel
{
\[BindProperty]
public string Name { get; set; }
\[BindProperty]
public string Email { get; set; }
public void OnGet()
{
}
public void OnPost()
{
ViewData["confi rmation"] \= $"{Name}, information will be sent to {Email}";
}
}
c. public class ModelBindingDemo : PageModel
{
public void OnGet()
{
}
public void OnPost(string name, string email)
{
ViewData["confi rmation"] \= $"{name}, information will be sent to {email}";
}
}
d. [BindProperties]
public class ModelBindingDemo : PageModel
{
public void OnGet()
{
}
public void OnPost(string name, string email)
{
ViewData["confi rmation"] \= $"{name}, information will be sent to {email}";
}
}
59
New cards
b
The scaff olding tool features a number of generators including ones for producing MVC areas, controllers and views, and Razor Pages.
Choose the templates exist for Razor Pages.
a. Empty, AddNew, Edit, Delete, Details, ListAll
b. Empty, Create, Edit, Delete, Details, List
c. Empty, New, Edit, Delete, Details, List
d. Empty, Create, Edit, Delete, Details, ListAll
60
New cards
d
Which of the following statements related to Interface Segregation Principle is True?
a. All of the others
b. The applications should be designed using multiple interfaces to improve their correctness
c. Applications should be designed using multiple abstraction classes to easily extend their functionality
d. Many client-specific interfaces are better than one general-purpose interface
e. None of the others
61
New cards
c
Choose the correct statement about JSON Syntax Rules
a. Curly braces hold arrays
b. Square brackets hold objects
c. Data is in name/value pairs
d. Data is separated by an ampersand
62
New cards
c
Which of the following is a valid XML Document?
b.


c.

d.

e.

63
New cards
c
Choose the correct answer about Razor code block.
a. % {
// Code here
}
b. \# {
// Code here
}
c. @ {
// Code here
}
d. $ {
// Code here
}
64
New cards
c
Which of the following methods of the XmlSerializer class returns a writer used to serialize the object?
a. GetWriter()
b. GetObjectWriter()
c. CreateWriter()
d. CreateObjectWriter()
65
New cards
a
Which of the following properties of the WebRequest class can be used to get or set the content length of the request data being sent?
a. ContentLength
b. Credentials
c. All of the others
d. ContentType
66
New cards
b
Handler methods in Razor Pages are methods that are automatically executed as a result of a request. Choose the correct answer of
handler methods in Razor Pages.
a. None of the others.
b. All of the others.
c. The default convention works by matching the HTTP verb used for the request to the name of the method: OnGet(), OnPost(),
OnPut() etc.
d. Handler methods also have optional asynchronous equivalents: OnPostAsync(), OnGetAsync() etc.
67
New cards
c
Which of the following statements related to the XML is True?
- Statement 1. XML stands for Extensible Markup Language. It is a text-
based markup language derived from Standard Generalized Markup Language (SGML)
- Statement 2. XML tags identify the data and
are used to store and organize the data, rather than specifying how to display it like HTML tags, which are used to display the data.
Choose a correct answer:
a. Statement 1
b. Statement 2
c. Statement 1 and 2
d. None of the others
68
New cards
d
Choose the correct option for enabling session state in Razor Pages.
a. public void Confi gureServices(IServiceCollection services)
{
services.CreateSession();
services.CreateMemoryCache();
// ...
}
public void Confi gure(IApplicationBuilder app, IHostingEnvironment env)
{
app.UseStaticFiles();
app.UseSession();
// ...
}
b. public void Confi gureServices(IServiceCollection services)
{
services.AllowSession();
services.AllowMemoryCache();
// ...
}
public void Confi gure(IApplicationBuilder app, IHostingEnvironment env)
{
app.AddStaticFiles();
app.AddSession();
// ...
}
c. public void Confi gureServices(IServiceCollection services)
{
services.UseSession();
services.UseMemoryCache();
// ...
}
public void Confi gure(IApplicationBuilder app, IHostingEnvironment env)
{
app.AddStaticFiles();
app.AddSession();
// ...
}
d. public void Confi gureServices(IServiceCollection services)
{
services.AddSession();
services.AddMemoryCache();
// ...
}
public void Confi gure(IApplicationBuilder app, IHostingEnvironment env)
{
app.UseStaticFiles();
app.UseSession();
// ...
}
69
New cards
A
To enable the MessagePack Hub Protocol on the server, install the Microsoft.AspNetCore.SignalR.Protocols.MessagePack package in your app.
Choose the correct code to enable MessagePack for SignalR in Startup.ConfigureServices method.

A. services.AddSignalR().AddMessagePackProtocol();
B. services.AddMessagePackProtocol().AddSignalR();
C. services.AddSignalR().EnableMessagePackProtocol();
D. services.EnableMessagePackProtocol().AddSignalR();
70
New cards
C
public record Order{
public int OrderId { get; set; }
public string OrderDate{ get; set; }
}
//\-----------------------------------------
class Program{
static void Main(string[] args){
string orderJson \= @"[
{"OrderId":100,"OrderDate"":""1/1/2020""}
];
var orders \= JsonSerializer
.Deserialize
71
New cards
A
public record Order{
public int OrderId { get; set; }
public string OrderDate{ get; set; }
}
class Program{
static void Main(string[] args){
List Order\> orders \= new List
72
New cards
D
Which of the following statements related to the benefits of the Inversion of Control (IoC) is True?

A. The IoC principle helps in designing loosely coupled classes that make them testable, maintainable, and extensible
B. Minimizes the amount of code in our application. With IOC containers, we care about how services are created and how we get references to the ones we need
C. IOC containers support eager instantiation and lazy loading of services but containers do not provide support for instantiation of managed objects, cyclical dependencies, life cycles management
D. All of the others
73
New cards
A
Choose the correct information for two common handler methods for Razor Pages.

A. OnGet to initialize state needed for the page. OnPost to handle form submissions.
B. OnPost to initialize state needed for the page. OnPut to handle form submissions.
C. OnGet to initialize state needed for the page. OnPut to handle form submissions.
D. OnGet to get state needed for the page. OnPost to initialize form submissions.
74
New cards
A
public class Student{
\[JsonPropertyName("fullName")]
public string firstName { get; set; }
public int age{ get; set; }
}
//\-------------------
class Program{
static void Main(string[] args){
Student john \= new Student { firstName \= "john", age\=20};
var strJson \= JsonSerializer.Serialize(john);
Console.WriteLine(strJson);
Console.ReadKey();
}
}

Which one of the following is the output of the above code?
A. {"fullName":"john","age":20}
B. {"firstName":"john","age":20}
C. ("firstName":"john"}
D. ("fullName":"john"}
75
New cards
A
Choose the correct statement about ContentControl in the WPF Types

A. That is the base class for all the control that supports only single content. Control from Label, Button, Windows, etc. The appearance of the control can be enhanced using a data template
B. This is the base class for all the control that displays a list of items and includes controls like, ListBox, TreeView, Menus, Toolbar, etc
C. This is the namespace contains all the elements that help in interacting with the user
D. None of the others
76
New cards
A
Choose the correct statement about Parallel Computing

A. All of the others
B. A problem is broken into discrete parts that can be solved concurrently
C. Each part is further broken down into a series of instructions
D. Instructions from each part execute simultaneously on different processors
77
New cards
B
class Program{
static async Task Display(string message){
await Task.Delay(2000);
Console.WriteLine(message);
}
//\-----
async static Task Main(string[] args) {
Display("Hello");
Console.WriteLine("Main thread");
Console.ReadLine():
}
}

Which one of the following is the output of the above code?
A. Main thread
Hello
B. Hello
Main thread
C. Compile-time error
D. An exception will be thrown
78
New cards
A
Which of the following methods of the WebRequest Class that returns a response to an Internet request?

A. GetResponse()
B. CreateHttpResponse()
C. CreateResponse()
D. GetHttpResponse()
79
New cards
A
Which of the following statements related to the XML is True?

Statement 1. XML stands for Extensible Markup Language. It is a text-based markup language derived from Standard Generalized Markup Language (SGML)
Statement 2. XML tags identify the data and are used to store and organize the data, rather than specifying how to display it like HTML tags, which are used to display the data

Choose a correct answer:
A. Statement 1 and 2
B. Statement 1
C. Statement 2
D. None of the others
80
New cards
A
In the case working ASP.NET SignalR with JavaScript client library, which the following code to create and start a connection?

A. var connection \= new signalR.HubConnectionBuilder().withUrl("/chatHub").build();
B. var connection new signalR.Builder().withUrl("/chatHub").build();
C. var connection \= new signalR.HubConnectionBuilder().withUrl("/chatHub").create();
D. var connection \= new signalR.HubBuilder().withUrl("/chatHub").build();
81
New cards
A
A Razor PageModel class is an implementation of the page controller pattern. Choose the correct answer about page controller.

A. A page controller is "an object that handles a request for a specific page or action on a website".
B. A page controller is defined as "a controller that handles all requests for a website".
C. A page controller is "an object that handles many requests for a specific action on a website".
D. A page controller is defined as "a controller that handles all requests of a specific user".
82
New cards
A
Which of the following methods of the Background task can be triggered when the application host is ready to start?

A. StartAsync(CancellationToken)
B. BeginAsync(CancellationToken)
C. ExecuteAsync(CancellationToken)
D. None of the others
83
New cards
A
Which of the following data type is not supported by JSON?

A. Byte
B. Number
C. Boolean
D. Object
84
New cards
A
ASP.NET Core SignalR supports two protocols for encoding messages. Each protocol has serialization configuration options. Please choose the correct protocols

A. JSON and MessagePack
B. BSON and MessagePack
C. JSON and BSON
D. JSON and XML
85
New cards
A
Which of the following is one of the basic procedures to distribute tasks in systems with multiple processors?

A. Symmetrical multiprocessing (SMP)
B. Asynchronous multiprocessing (AMP)
C. Synchronous multiprocessing (SNP)
D. All of the others
86
New cards
A
Which of the following statements related to the Dependency Inversion Principle is True?

A. High-level modules should not depend on low-level modules; both should depend on abstractions. Abstractions should not depend on details. Details should depend upon abstractions.
B. Low-level modules should depend on high-level modules, both should depend on abstractions by interfaces
C. High-level modules should depend on low-level modules; both should depend on abstract classes. Abstractions should depend on details. Details should not depend upon abstractions
D. All of the others
87
New cards
A
Which of the following properties of the WebRequest class can be used to get the URI of the Internet resource associated with the request?

A. RequestUri
B. RequestParam
C. RequestURL
D. None of the others
88
New cards
A
Which of the following methods of the HttpClient Class can be used to send a POST request to the specified Uri as an asynchronous operation?

A. PostAsync(String, HttpContent)
B. PutAsync(String, HttpContent)
C. CreatePostAsync(String, HttpContent)
D. PostRequestAsync(String, HttpContent)
89
New cards
A
Choose the correct statement about UIElement in the WPF Types

A. That is a class adds the basic functionality of layout, input, focus, and events to UI elements and sets the basic foundation of the layout process
B. That is a class extends the functionality provided by the UIElement, and override the layout for framework level implementations
C. That is a class is the base class for shape elements like Line, Ellipse, Polygon, Path, etc
D. None of the others
90
New cards
C
Choose the correct statement related to processor configurations and the number of tasks that they can perform in the Hyper-threading (HT) technology

A. A single processor with a single-core chip: One task at a time
B. A single processor with an HT-enabled single-core chip: Four tasks at a time
C. A single processor with an HT-enabled dual-core chip: Eight tasks at a time
D. None of the others
91
New cards
A
Choose the correct statement about WPF Types

A. All of the others
B. DependencyObject: provide features like change notification, support data bindings, attached properties, etc
C. Visual: The Visual class defines all the properties required for rendering, clipping, transforming, bounding, and hit test
D. DispatcherObject: WPF application uses Single-Thread Affinity (STA) model and therefore every UI element is owned by a single thread
92
New cards
A
For the Uniform Resource Identifier (URI) as follows: http://www.myweb.com:8888/info/page.html?query\#top
What is the AbsolutePath?

A. /info/page.html
B. /info/page.html?query
C. /info/page.html?query\#top
D. /page.html?query
93
New cards
A
Which of the following options belongs to the service lifetimes of Dependency Injection (DI) in NET?

A. All of the others
B. Transient
C. Scoped
D. Singleton
94
New cards
A
Which of the following properties of the WebRequest class can be used to get or set the content length of the request data being sent?

A. ContentLength
B. ContentType
C. Credentials
D. All of the others
95
New cards
A
Suppose that you want to configure the root folder for Razor Pages to be something other than the default. What the following code should you put in ConfigureServices method of Startup.cs file?

A. public void ConfigureServices(IServiceCollection services)
{
services.AddRazorPages().AddRazorPagesOptions(options \=\> { options RootDirectory \= "/Content"; });
}

B. public void ConfigureServices(IServiceCollection services)
{
services.AddRazorPages().AddRazorPagesRootDirectory(options \=\> { options.RootDirectory\="/Content"; });
}

C. public void ConfigureServices(IServiceCollection services)
(
services AddRazorPages();
}

D. public void ConfigureServices(IServiceCollection services)
{
services.AddRazorPages().AddRazorPagesOptions("/Content");
}
96
New cards
A
Which of the following properties of the Task class can be used to get a value that indicates whether the task has been completed?

A. IsCompleted
B. IsFinished
C. IsTaskDone
D. IsCompletedTask
97
New cards
A
Choose the correct statement about Dependency Injection (DI)

A. The main idea of DI is to reduce the coupling between classes and move the binding of abstraction and concrete implementation out of the dependent class
B. Inversion of Control (loC) can be done using DI, but very difficult to implement
C. DI explains how to implement functions of the applications into abstract classes and interfaces through a design pattern
D. None of the others
98
New cards
A
Which of the following statements related to the JSON is True?

Statement 1. JSON stands for Java Object Notation. JSON data is written as name/value pairs
Statement 2. JSON is a lightweight format for storing and transporting data and it is often used when data is sent from a server to a web page

A. Statement 2
B. Statement 1
C. Statement 1 and 2
D. None of the others
99
New cards
A
Choose the correct answer about Razor code block.

A. @{
// Code here
}
B. \#{
// Code here
}
C. ${
// Code here
}
D. %{
// Code here
}
100
New cards
B
Choose the incorrect statement about Windows Presentation Foundation (WPF)

A. WPF applications are based on a vector graphics architecture and MVC (Model-View-Controller) pattern
B. WPF version 3.0 was first released as a part of .NET Framework 3.0 in the year 2006 and received its major updates and enhancements in version 3.5 released by .NET Framework 3.5
C. WPF also includes a flexible hosting model, which makes it straightforward to host a video in a button
D. None of the others