Quiz Questions

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

What is the size of the small tiles that are used when Windows displays the app on the Lock Screen?

24 × 24 pixels Badges are smaller than the tiles (24 × 24 pixels) and are used when Windows displays the app on the Lock Screen. If you set a badge image for your app, you must also enable Lock Screen notifications. Badges can also be scaled, so provide all the appropriate sizes.

What applications can host WCF services? Each correct answer represents a complete solution. Choose all that apply.

Here are the applications that can host WCF services: Web applications Windows forms applications Windows services COM+ applications Console applications

Which of the following exceptions is thrown by the read() method on failure?

IOException

Which of the following members opens the file with the stream positioned at the end of the file?

Append

Which file system access class represents a physical file on disk, and has methods to manipulate this file?

FileInfo The FileInfo class represents a physical file on disk, and has methods to manipulate this file. For any reading from and writing to the file, a Stream object must be created.Answer D is incorrect. The DirectoryInfo class represents a physical directory on disk and has methods to manipulate this directory.Answer A is incorrect. The FileSystemInfo class serves as the base class for both FileInfo and DirectoryInfo, making it possible to deal with files and directories at the same time using polymorphism.Answer B is incorrect. Directory is a static utility class that exposes many static methods for moving, copying, and deleting directories.

Which of the following is a class library that can run in numerous .NET verticals without recompilation?

PCL

What do you understand by the term 'assembly' in C#?

A .dll file that is automatically generated by the compiler An assembly is a .dll file that is automatically generated by the compiler. It exposes APIs that can be utilized from other assemblies or executables.Answer B is incorrect because a branch, also referred to as forking, is a copy of an existing source code repository to start new independent development.Answer D is incorrect because a framework/library is an inclusive collection of APIs used for the creation of programs focused on a specific vertical, in the form of an assembly.Answer C is incorrect because metapackages are a group of interdependent packages but have no library or assembly of their own.

Which of the following uses the SQL database language to query and manipulate their data?

A relational database uses the SQL database language to query and manipulate their data.

Which of the following is a technology for dynamically creating web pages with server-side code?

ASP.NET

What is random access?

Accessing the file using a position byte index A FileStream instance maintains a position byte index within a file so that you can navigate through the contents of a file. Accessing a file at any point in this way is known as random access.

ASP.NET Web Forms is often considered heavy due to a feature called viewstate. What is the way to avoid this problem?

By setting the EnableViewState property to false at the Page level The correct way to avoid problems with viewstate is to disable it at the Page level by setting the EnableViewState property to false. And then if you need to maintain state on a TextBox, for example, use the following snippet to enable it specifically. <asp:TextBox EnableViewState="true" ID="Name" runat="server"/>

Which of the following statements are true about a storage container?

Contains files that are accessible from any place where an Internet connection exists Exists within a storage account A storage container exists within a storage account and contains the blobs, files, or data that are accessible from any place where an Internet connection exists.

Which of the following are used by JSON to delimit blocks of data and to delimit arrays, respectively?

Curly braces ({}) and square brackets ([])

In which of the following stream classes is data compressed automatically when writing, or uncompressed automatically when reading?

DeflateStream In the DeflateStream stream class, the data is compressed automatically when writing, or is uncompressed automatically when reading.Answer C is incorrect. FileStream represents a file that can be written to, read from, or both. This file can be written to and read from asynchronously or synchronously.Answer D is incorrect. ZipArchive represents a package of compressed files in the zip archive format.Answer B is incorrect. GZipStream represents a stream in which data is compressed automatically when writing, or uncompressed automatically when reading. Compression is achieved using the GZIP (GNU Zip) algorithm.

Which of the following are the specific group of assemblies required for a program to compile?

Dependencies

Which of the following statements are the correct ways to create a FileStream object?

FileStream aFile = new FileStream(filename, FileMode.<Member>, FileAccess.<Member>); FileStream aFile = new FileStream(filename, FileMode.<Member>);

Which of the following methods returns an array of string objects that represents the name of the files and directories in the specified directory?

GetFileSystemEntries()

In which cloud service model is a user responsible for operating system patches and third‐party dependent libraries?

IaaS In the IaaS (Infrastructure as a Service) cloud service model, a user is responsible for operating system patches and third‐party dependent libraries and is not responsible for the hardware or network infrastructure.

Which cloud service model is responsible for operating system patches and third party dependent libraries?

IaaS Infrastructure as a Service (IaaS) is responsible for operating system patches and third party dependent libraries.

Why is JSON preferred over XML?

JSON has less markup requirements and therefore is lighter than XML. JSON is preferred over XML because of the following reasons: There is limited support for JSON in the C# system libraries, but you can use a free third party JSON library to work with JSON to convert XML to JSON and vice versa, and to do other manipulations with JSON similar to the .NET classes for XML, therefore is lighter than XML. XML is much more difficult to parse than JSON. JSON is parsed into a ready-to-use JavaScript object. JSON is simple to read and write than XML. JSON is easy to learn as compared with XML. JSON doesn't provide display capabilities, but XML provides the capability to display data because it is a markup language.

Which of the following enables powerful queries on databases using the same entity framework classes to create the data?

LINQ to Entities enables powerful queries on databases using the same entity framework classes to create the data. Answer B is incorrect. LINQ to XML is an up-to-date, redesigned approach to programming with XML. It provides the in-memory document modification capabilities of the Document Object Model (DOM). Answer C is incorrect. In LINQ to SQL, the data model of a relational database is mapped to an object model expressed in the programming language of the developer. Answer D is incorrect. LINQ to Objects provides the developer with the means to conduct queries against an in-memory collection of objects.

Which implementation of LINQ refers to a component of the .NET Framework version 3.5 that provides a run-time infrastructure to manage relational data as objects?

LINQ to SQL The different implementations of LINQ are: LINQ to SQL: Refers to a component of the .NET Framework version 3.5 that provides a run-time infrastructure to manage relational data as objects LINQ to DataSet: Refers to a component that makes it easier and faster to query over data cached in a DataSet object LINQ to XML: Provides an in-memory XML programming interface LINQ to Objects: Refers to the use of LINQ queries with any IEnumerable or IEnumerable<T> collection directly, without the use of an intermediate LINQ provider or API, such as LINQ to SQL or LINQ to XML

Which of the following enables you to communicate with WCF services that are on the same machine as the calling code?

Named pipe Named pipe enables you to communicate with WCF services that are on the same machine as the calling code, but reside in a separate process.Answer B is incorrect. HTTP enables you to communicate with WCF services from anywhere, including across the Internet.Answer A is incorrect. UDP is similar to TCP in that it enables communications via the local network or Internet, but it's implemented in a subtly different way. One of the consequences of this implementation is that a service can broadcast messages to multiple clients simultaneously.Answer D is incorrect. MSMQ (Microsoft Message Queuing) is a queuing technology that enables messages sent by an application to be routed through a queue to arrive at a destination. It is a reliable messaging technology that ensures that a message sent to a queue will reach that queue.

Which of the following is a package manager for .NET that helps developers create and consume packages?

NuGet NuGet is a package manager for .NET that helps developers create and consume packages.

Which static method of the File class returns a FileStream object at the specified path?

Open() MethodDescriptionCopy() Copies a file from a source location to a target location. Create() Creates a file in the specified path. Delete() Deletes a file. Open() Returns a FileStream object at the specified path. Move() Moves a specified file to a new location. You can specify a different name for the file in the new location.

Which statement defines the query strings state type?

Passed between client and server as URL elements and are accessible only during a single request The query strings state type is valid till the resource is passed between client and server as URL elements and are accessible only during a single request.Answer C is incorrect. The session state is associated with a browser session. The session is invalidated with a configurable timeout setting.Answer B is incorrect. The TempData state type is valid until the server resource is removed, once the information is read by the applicationAnswer D is incorrect. The application state is shared among all clients. This state is valid until the server restarts.

Which XPath query will you execute to get all attributes of the current node, assuming that the current node is the <element> node in the XML document.?

The @* XPath query will return all attributes of the current node.Answer D is incorrect. The .. XPath query will return the parent value of the current node.Answer A is incorrect. The @Type XPath query will return an attribute of the current node.Answer B is incorrect. The element/text() will return one or more grandchildren of the current node.

Which of the following is an approach that is supported in the entity framework?

The Code First is an approach that is supported in the entity framework.

Why should we use routed commands instead of events? Each correct answer represents a complete solution. Choose all that apply.

The action that will cause an event to occur can be triggered from multiple locations in the application. The UI element should be accessible only under certain conditions. There are at least three reasons why you would want to use routed commands instead of events: The action that will cause an event to occur can be triggered from multiple locations in your application. The UI element should be accessible only under certain conditions, such as a Save button being disabled if there's nothing to save. You want to disconnect the code that handles the event from the code behind file.

Which of the following states is within a single page only?

The view state is within a single page only.

Which three Register() method parameters are mandatory?

Type ownerType, Type propertyType, string name

Which of the following is a feature that allows a developer to know what changes have been made and by whom in the GitHub repository?

Version control The version control is a feature that allows a developer to know what changes have been made and by whom in the GitHub repository.

Through which of the following methods is the Web App deployed to the Microsoft Azure platform?

Via a local Git or public Git repository hosted on GitHub There are various options for deploying the Web App to the Microsoft Azure platform. The most popular methods is via a local Git repository or a public Git repository hosted on GitHub. Both the local and public Git repositories provide capabilities for version control, which is a very useful feature.

Which class is able to control the display of the game?

View model A view model is a class that is able to control the display of the game.Answer A is incorrect. A domain model is the code that describes the objects of the game.Answer B is incorrect. Two independent dialog boxes, a card library and a main window provide a blank space for the game to be displayed on.

Which of the following queries selects one or more grandchildren of the current node?

element/text()

Which of the following codes shows a valid JSON object?

{"Student":[{"fname":"Peter","lname":"Mathew","id":"AB1240X85"}]} JSON stands for JavaScript Object Notation. It is a standard, though as you can tell from the name it is derived from the JavaScript language rather than C#. The valid JSON object is:

For the given set of code, what does the output represent? class Program { static void Main(string[] args) { int[] nums = { 1, -2, 3, 0, -4, 5 }; var posNums = from n in nums where n > 0 select n; int len = posNums.Count(); Console.WriteLine(len); Console.ReadLine(); } }

3 The from clause specifies the data source on which the query or sub-query will be run and a local range variable that represents each element in the source sequence. Both the range variable and the data source are strongly typed. The data source referenced in the from clause must have a type of IEnumerable, IEnumerable<T>, or a derived type such as IQueryable<T>.The given program will count the total number of elements of the array that are greater than 0. And in this program, it is 3. Therefore, the output will be 3.

What will be the output of the following C# program? class Program { static void Main(string[] args) { Expression < Func < int, int, bool >> IsFactorExp = (n, d) => (d != 0) ? (n % d) == 0 : false; Func < int, int, bool > IsFactor = IsFactorExp.Compile(); if (IsFactor(10, 5)) Console.WriteLine("5 is a factor of 10."); if (!IsFactor(343, 7)) Console.WriteLine("7 is not a factor of 10."); Console.ReadLine(); } }

5 is a factor of 10 The current program has introduced the concept of expression tree. An expression tree is a representation of a lambda expression as data.The program illustrates the two key steps in using an expression tree. First, it creates an expression tree by using the following expression: IsFactorExp = (n, d) => (d != 0) ? (n % d) == 0 : false; Second, this constructs a representation of a lambda expression in memory. Therefore, the output will be: 5 is a factor of 10

What are the correct ways to create a TextBox(player1TextBox) server side control in an ASP.NET Web Form (ASPX) file?

<asp:TextBox ID="player1TextBox" runat="server"/> @Html.TextBox("player1TextBox") To create a TextBox server side control add the following to an ASP.NET Web Form (ASPX) file: <asp:TextBox ID="player1TextBox" runat="server"/> To achieve the same using razor syntax, which was introduced in Lesson 16, use this syntax: @Html.TextBox("player1TextBox") In each case, when an HTTP request is made to the file containing those codes snippets, the code is executed, and an HTTP response is returned to the client containing an HTML representation of that control.

Which of the following queries will you execute on the DocumentElement that returns all nodes of the document? A //elements B //mass C element D .

A ) //elements The //element query will return all nodes of the document.Answer C is incorrect. The element query will return every element node in the document but leaves the element root node out.Answer B is incorrect. The //mass query will return all nodes with the name mass.Answer D is incorrect. The . query will return the current node.

What do you understand by the term 'assembly' in C#?

A .dll file that is automatically generated by the compiler. Assembly is a .dll file that is automatically generated by the compiler. It exposes APIs that can be utilized from other assemblies or executables.Answer B is incorrect. Forking, also referred to as a branch, is a copy of an existing source code repository to start new independent development.Answer D is incorrect. Framework/library is an inclusive collection of APIs used for the creation of programs focused on a specific vertical, in the form of an assembly.Answer A is incorrect. Metapackages is a group of interdependent packages but has no library or assembly of its own.

What is storage account?

A mechanism for controlling access to the containers created within it A storage account can contain an infinite number of containers. It is a mechanism for controlling access to the containers created within it.Answer B is incorrect. The throttling pattern manages the consumption of a cloud program so that SLAs can be met, and the program remains functional under high load.Answer C is incorrect. A managed disk can represent a volume assigned from a back-end storage system.Answer D is incorrect. Azure Cosmos DB is a globally distributed, multi-model database service that supports document, key-value, wide-column, and graph databases. Lesson Advanced Desktop & Basic Cloud Programming Creating an ASP.NET 4.7 Web Site that uses the Storage Container

Which of the following web applications can be deployed with Azure?

ASP.NET, WCF The web applications that can be deployed with Azure are ASP.NET and WCF. An ASP.NET Web API is based on the ASP.NET MVC (Model, View, Controller) concept, which aligns directly with the new cloud optimized stack definition. The implementation of Internet and intranet solutions became mainstream, dependencies on technologies such as web services and Windows Communication Foundation (WCF) were made.Answer C is incorrect. Eclipse IDE or VS Code was designed to be a development tool, not deployment tool. The strength of these tools lies in its ability to quickly deploy Apex code and related development artifacts.Answer A is incorrect. After Windows Presentation Foundation (WPF) applications are built, they need to be deployed. Windows and the .NET Framework include several deployment technologies. The deployment technology that is used to deploy a WPF application depends on the application type.

Which of the following features are provided by IIS and WAS for WCF services?

Activation, Object pooling, Process recycling IIS and WAS provide useful features for WCF services such as activation, process recycling, and object pooling. If you use either of the other two hosting options, a WCF service is said to be self hosted. Recycling an application pool causes all currently running IIS worker processes in that application pool to be gracefully shutdown, but unlike stopping the pool, new IIS worker processes can be started on demand to handle subsequent requests. IIS hosting is a simpler way of WCF hosting and it provides a lot of benefits, like message-based activation and process recycling to avoid giving the system any problems.

Which new feature of the Visual State Manager will change the layout of the application based on the size of the display?

Adaptive triggers are new to the Visual State Manager. Using these triggers, you can change the layout of your application based on the size of the display. When combined with a relative panel, this is a very potent feature that in a fairly straightforward manner lets you build what the web world refers to as responsive UIs and Microsoft calls adaptive displays. Answer D is incorrect. The relative panel allows to specify how controls should be positioned relative to one another. Answer A is incorrect. RefreshVisualizer represents a control that provides animated state indicators for content refresh. Answer B is incorrect. A panel is an object that provides a layout behavior for child elements it contains, when the Extensible Application Markup Language (XAML) layout system runs and your app UI is rendered. And a custom panel for the XAML layout is defined by deriving a custom class from the panel class.

Storyboard objects are used in WPF to define which of the following?

Animation Animations are created by using storyboards. The best way to define complex animations is to use a designer such as Expression Blend. Animations in WPF are defined using an object called a Storyboard. Using storyboards, you can animate the value of a property—for example, the background color of a button. It is very important to realize that you can animate just about any property in this way, not just properties that affect how a control is displayed.Answer A is incorrect. The Trigger class is used to set properties in response to changes to other properties and is particularly useful when used in Style objects.Answer B is incorrect. A template consists of a hierarchy of controls used to build the display of a control, which may include a content presenter for controls such as buttons that display content.

What types of objects can you query using LINQ?Each correct answer represents a complete solution. Choose all that apply. A Any .NET Framework collection that implements IEnumerable<T> B DataTables and DataSets C Collections that implement interfaces that inherit from IEnumerator<T>

Answers A and B are correct.Any .NET Framework collection that implements IEnumerable<T> or that inherit from IEnumerable<T> can be queried using LINQ. The DataSet object was introduced in the first version of the .NET Framework. This variety of LINQ enables legacy .NET data to be queried easily with LINQ.

Which of the following statements are true of the eXtensible Markup Language (XML)?Each correct answer represents a complete solution. Choose all that apply. A It is a data language used when transferring JavaScript and web services. B It is partially adopted by Microsoft in the .NET Framework. C The XML declaration defines the XML version. D It is a data language that stores data in a simple format.

Answers C and D are correct. eXtensible Markup Language (XML) is a data language, which is a way of storing data in a simple text format that can be read by both humans and nearly any computer. The XML declaration defines the XML version. It is a W3C standard format like HTML (XML). It has been fully adopted by Microsoft in the .NET Framework and other Microsoft products.Answer A is incorrect. JSON is a data language used when transferring JavaScript and web services.

Which state of any server is shared among all clients and is valid until the server restarts?

Application Application state is shared among all clients. This state is valid until the server restarts.Answer C is incorrect. In this state temporary cookies are deleted when the browser is closed; permanent cookies are stored on the disk of the client system.Answer B is incorrect. Session state is associated with a browser session. The session is invalidated with a timeout (by default, 20 minutes).Answer D is incorrect. Similar to application state, cache is shared. Developers have control over when the cache can be invalidated.

Which of the following is a feature that is useful for managing unexpected peaks of usage and requests to the Web App?

Auto scaling

Which method allows the programmer to code the BCL once and use it across all supported application verticals?

By combining the .NET Core framework with the .NET Standard class library .NET Core is a cross platform, open source application framework. Using this framework in combination with the .NET Standard class library allows the programmer to code the BCL once and use it across all supported application verticals. In the .NET Core scenario, the benefit is true cross platform support.

Each correct answer represents a complete solution. Choose all that apply. A Database First B Object First C Model First D Code First

C D Here are the development approaches available in an entity framework: Model First: In this approach we create entities, relationships directly on the design surface of EDMX. Code First: For code approach we avoid working with the visual designer or entity framework.

Which of the following examples refer to the side-by-side installation?Each correct answer represents a complete solution. Choose all that apply. A Upgrading from .NET Framework 4.3.2 to .NET Framework 4.6 B Upgrading from .NET Framework 4.5 to .NET Framework 4.6.2 C If a program targeted .NET Framework 2.0 and .NET Framework 4.0 was installed D Instaling .NET Framework 2.0 and .NET Framework 4.0 both

C) If a program targeted .NET Framework 2.0 and .NET Framework 4.0 was installed D) Instaling .NET Framework 2.0 and .NET Framework 4.0 both These are the examples of side-by-side installations. It is a major version change. For example, installing .NET Framework 2.0 and .NET Framework 4.0 would support programs targeting either 2.0 or 4.0. This is common when there are significant modifications or optimizations to the CLR and framework components. If a program targeted .NET Framework 2.0 and .NET Framework 4.0 was installed, the risk of impact is small, because it is a side by side installation.Answers A and B are incorrect because these are the examples referring to the in-place installation. It typically overwrites a previous installation of SQL Server with an installation of newer version.

Consider the following namespaces: using System; using System.Linq; using System.Data.Linq; using System.Xml.Linq; using System.Collections; Suppose the array string[] colors = { "green", "brown", "blue", "red" }; is defined. Then, what will be the output of the following expression? colors.OrderBy (c => c.Length).Single()

Compile time error This throws an InvalidOperationException: the sequence emitted by OrderBy contains four elements, and Single demands exactly one element. To get the result "red", you must use the First operator instead: colors.OrderBy (c => c.Length).First() Another option is to use FirstOrDefault (unlike First, FirstOrDefault doesn't throw an exception there are zero elements in the sequence). Single is good for retrieving a row from a table by primary key, in a LINQ to SQL query: Customer c = dataContext.Customers.Single (c => c.ID == 123); In this case, you'd want an exception to be thrown if there were two customers with that ID.

You are creating an ASP.NET MVC 4 web application that will be accessed by a large number of traditional consumers. If you need to be able to access state information on the client side in JavaScript/jQuery, where can you store it?Each correct answer represents a complete solution. Choose all that apply. A LocalStorage B Cookies C ViewState D QueryString

Cookies QueryString Query string information is available across all browsers and is usable on both the client and server. Cookies can be stored for a period of time on the client and be read from either client- or server-side operations.

How is the version control feature helpful in deploying any Web App to the Microsoft Azure platform? A By providing the information of assemblies and packages involved in the deployment B By listing the formal specification of APIs C By keeping the resources of a specific project or application grouped together D By specifying the information for the changes that have been made to the app

D) By specifying the information for the changes that have been made to the app The local and public Git repositories provide capabilities for version control, which is a very useful feature. Having version control lets the developer and release manager know what specific changes have been made, when they were made, and by whom. In the event that there are problems or unexpected exceptions when the binaries are compiled, or the changes are deployed to the live environment, it is easy to find who to contact about it.Answer C is incorrect. The Resource Group option of ASP.NET Web API is a way to keep all the resources for a specific project or application grouped together, helping you manage the resources better.Answers A and B are incorrect. These information are not provided during the deployment of any Web App.

Which attribute can be used for data validation in MVC?

Data Annotation ASP.NET offers several validation controls that can easily be used to validate user input on both the client and server sides. Validation on the client is done for performance reasons, but because the web client can never be trusted, validation must happen on the server as well.Answer D is incorrect. The HtmlHelper class provides the means to create objects such as Label, Textbox, and so on with Razor pages.Answer B is incorrect. Entity Framework Fluent API is used to configure domain classes to override conventions. EF Fluent API is based on a Fluent API design pattern where the result is formulated by method chaining.Answer A is incorrect. Kestrel is a new web server that can self host ASP.NET Core web applications and can run cross platform.

Which of the following is used to display properties from the controls DataContext?

DataTemplate DataTemplate is similar to ControlTemplate in that it can be used to change the visual appearance of a control. It is used to present the underlying data of a control. For example, it can be used to display properties from the controls DataContext.

Which of the following classes represents an entity set?

DbSet The DbSet class represents an entity set that can be used for create, read, update, and delete operations. The context class (derived from DbContext ) must include the DbSet type properties for the entities which map to database tables and views.Answer B is incorrect. DbContext is an important class in Entity Framework API. It is a bridge between your domain or entity classes and the database. DbContext is the primary class that is responsible for interacting with the database.Answer D is incorrect. A list is an array that grows when you add elements to it, while IEnumerable allows implementers to be used in a foreach.Answer C is incorrect. A query is a request for data or information from a database table or combination of tables. This data may be generated as results returned by Structured Query Language (SQL) or as pictorials, graphs or complex results, e.g., trend analyses from data-mining tools.

Which of the following tabs allows a user to register the app as a provider of services?

Declarations On the Declarations tab, a user can register the app as a provider of services. For instance, if the app works as a search provider, then the user can add this declaration to the app and specify the required properties.

Which of the following are the reasons for choosing ASP.NET MVC over other ASP.NET application types?

Deeply integrated with test driven development (TDD) Tightly coupled with Entity Framework (EF) and model binding Well suited for larger, more complicated web applications

Which of the following is a code that describes the objects of a game?

Domain model The domain model is a code that describes the objects of a game.

Which of the following is a combination of community resources, development tools, and runtime software?

Ecosystem The ecosystem is a combination of community resources, development tools, and runtime software.

Which of the following is a key/key combination to run the ASP.NET Web Site?

F5 A user can run the ASP.NET Web Site by pressing the F5 key.

Which of the following classes will help you to know when files or directories are being modified?

FileSystemWatcher The FileSystemWatcher class will help to know when files or directories are being modified. It exposes several events that an application can catch. This enables the application to respond to file system events.Answer D is incorrect. The DeflateStream compressed stream class is used to read and write compressed data from and to files.Answer B is incorrect. The FileSystemInfo class serves as the base class for both FileInfo and DirectoryInfo, making it possible to deal with files and directories at the same time using polymorphism.Answer C is incorrect. The DirectoryInfo class represents a physical directory on disk and has methods to manipulate this directory.

Which of the following controls is used to display images one at a time and allows the user to use the swipe gesture to move between the images?

FlipView FlipView is a nice little control that works very well with handheld devices. It allows the user to swipe left or right to move the content in view, but this can be changed to move up or down. When a mouse is used, the scroll button will work as well. It is often used to display images one at a time and allows the user to use the swipe gesture to move between the images.

Why is PCL taken into consideration?

For resolving the scaling, maintaining, testing, and supportability issues For targeting multiple verticals and platforms Using the directives #if, #else, and #endif to provide cross platform support was never a solid, scalable, maintainable, or easily supportable approach. The program ended up with many code paths, required much updating and complicated testing procedures when the components of the software or hardware were changed. As the need for targeting multiple verticals and platforms increased, a new solution for cross platform support was in high demand. From that demand, the concept of Portable Class Libraries (PCL) was created. PCL helped resolve the scaling, maintaining, testing, and supportability issues to a considerable extent.

Which of the following is an inclusive collection of APIs used for the creation of programs focused on a specific vertical?

Framework A framework/library is an inclusive collection of APIs used for the creation of programs focused on a specific vertical, in the form of an assembly.

Which static method of the directory class returns an array of string objects that represent the names of the files and directories in the specified directory?

GetFileSystemEntries() The GetFileSystemEntries() static method of the directory class returns an array of string objects that represent the names of the files and directories in the specified directory.Answer A is incorrect. The Open() static method belongs to the file class which returns a FileStream object at the specified path.Answer C is incorrect. The GetFiles() static method returns an array of string objects that represent the names of the files in the specified directory.Answer D is incorrect. The GetDirectories() static method returns an array of string objects that represent the names of the directories below the specified directory.

For embedding resiliency into the cloud program, which cloud programming pattern checks that cloud based applications are functionally available via the implementation of endpoint monitoring?

Health endpoint monitoring pattern For embedding resiliency into the cloud program, the health endpoint monitoring pattern checks that cloud based applications are functionally available via the implementation of endpoint monitoring.Answer A is incorrect. The throttling pattern manages the consumption of a cloud program so that SLAs can be met, and the program remains functional under high load.Answers C and D are incorrect. These are not the valid cloud programming patterns.

What features of the ASP.NET Web Forms make it prior to any other ASP.NET flavors?

Helpful in maintaining session and state over HTTP for web applications Optimal for small to mid sized development teams and projects The reasons to choose ASP.NET Web Forms over the other frameworks are that Web Forms are: Optimal for small to mid sized development teams and projects Useful for web applications which need to maintain session and state over HTTP Based on a very initiative set of request pipeline events When compared to the other ASP.NET flavors, ASP.NET Web Forms is the best and simplest way to get a feature rich and highly performant web application developed and deployed rapidly. The separation between the presentation logic and the business logic align well with targeted skillsets of front end, user interface developers and coders. This is optimal because the team can have specialists working on the various aspects of the project in parallel.Answer D is incorrect. ASP.NET MVC is more suitable for larger, more complicated web applications.Answer A is incorrect. It is not possible to maintain state without a session.

What points need to be considered while porting .NET Framework to .NET Core?

Identifying any third party dependencies Upgrading the current .NET Framework target Here are the points that need to be considered while porting .NET Framework to .NET Core: Identifying any third party dependencies Understanding which features are not available Upgrading the current .NET Framework target Choosing the platforms to target for the program

While manipulating the values of a node, which property gets the text of all the child nodes of the current node and returns it as a single concatenated string?

InnerText While manipulating the values of a node, the InnerText property of the HTML element gets the text of all the child nodes of the current node and returns it as a single concatenated string. If we attempt to assign HTML to an element with InnerText, the HTML code will display as literals in the document, just as if you were viewing HTML within a text file. If you assign HTML to an element using the InnerHtml property, InnerText will return all of the text in that HTML with the markup removed.Answer C is incorrect. OuterText will return all of the text in that HTML with the markup removed, if we assign HTML to an element using the InnerHtml property.Answer B is incorrect. InnerXml returns the text like InnerText, but it also returns all of the tags.Answer D is incorrect. OuterHtml includes the current element's tag as well as the HTML that tag contains.

In order for a program to be cloud optimized, which option is considered?

It must have a small footprint. In order to be considered cloud optimized, a program must have a small footprint, be able to handle high throughput, and be cross‐platform enabled.

Which of the following LINQ providers is an alternative LINQ interface that has been superseded by LINQ to Entities?

LINQ to SQL

For managing scalability, which cloud programming pattern modifies the storage structure to reflect the data query pattern?

Materialized view pattern The materialized view pattern modifies the storage structure to reflect the data query pattern. For example, creating views for specific highly used queries can make for more efficient querying.

Which contract type enables you to customize how information is formatted inside SOAP packets?

Message contract enables you to customize how information is formatted inside SOAP packets for example, whether data should be included in the SOAP header or SOAP message body. This can be useful when creating a WCF service that must integrate with legacy systems. Answer C is incorrect. Service contract contains general information about a service and the operations exposed by a service. This includes, for example, the namespace used by service. Answer B is incorrect. Data contracts define the types in terms of the data that they expose through properties. Answer A is incorrect. Operation contract includes the parameter and return types for an operation method along with additional information, such as whether a method will return a response message.

What platform will help you to optimally utilize physical resources to scale up, down, and out during the times when the resources are required?

Microsoft Azure Scaling to meet the requirements of your users used to be a very tedious, time consuming, and expensive activity. Microsoft Azure helps you to optimally utilize physical resources to scale up, down, and out during the times when the resources are required. When you need physical resources like CPU, disk space or memory, you scale up or out to meet the demands, and when the demand for your cloud hosted services reduce, you can scale back down and save your financial resources for use with other projects and services.Answer D is incorrect. AWS helps to benefit from the scale and performance of cloud with ease. AWS Services is here to help to build sophisticated applications with an increased scalability, flexibility and reliability.Answer C is incorrect. IBM Cloud helps to improve productivity and efficiency, reduce IT overhead costs, and gain agility by offloading IT resources and management complexity from the cloud.Answer B is incorrect. Windows Server provides tools for creating and managing a virtualised server computing environment.

Which of the following statements is true about the HttpContext.Items state type?

Passed between client and server, stored in an object, and accessible only during a single request

Which of the following are the attributes that define the cloud‐optimized stack?

Portability Scalability Resiliency

Which of the following is ideal for larger companies or those that must deliver a higher level of data security or government compliance?

Private cloud A private cloud is dedicated computer hardware and infrastructure that exists onsite or in an outsourced data center. This cloud type is ideal for larger companies or those that must deliver a higher level of data security or government compliance.Answer A is incorrect. A public cloud is shared computer hardware and infrastructure owned and operated by a cloud provider like Microsoft Azure, Amazon AWS, Rackspace, or IBM Cloud. This cloud type is ideal for small and medium businesses that need to manage fluctuations in customer and user demands.Answer C is incorrect. A hybrid cloud is a combination of both public and private cloud types whereby you choose which segments of your IT solution run on the private cloud and which run on the public cloud. The ideal solution is to run your businesses critical programs that require a greater level of security in the private cloud and run non sensitive, possibly spiking tasks in the public cloud.Answer D is incorrect. Community cloud computing refers to a shared cloud computing service environment that is targeted to a limited set of organizations or employees (such as banks or heads of trading firms).

What is the function of WCF?

Provides a framework for creating and communicating with remote services WCF (Windows communication foundation) provides a framework for creating and communicating with remote services. It combines elements of the web service and remoting architectures along with new technologies to achieve this. Answer C is incorrect. Bindings offer such a great degree of flexibility to specify the security requirements for communication over the transport protocol. Answer D is incorrect. The ScriptObject type (not covered in depth here) provides a way to access a JavaScript object, but even this is unable to give you the capability to do the following: int sum = jsObj.Add(2, 3); Answer A is incorrect. Windows Presentation Foundation (WPF) is a graphical subsystem by Microsoft for rendering user interfaces in Windows-based applications.

Which of the following actions are required for configuring package.appxmanifest?

Registering the app as a provider of services Specifying the capabilities required by the application Ensuring that there is at least one image for every category on the Visual Assets tab Here are the actions required for configuring package.appxmanifest: Registering the app as a provider of services Specifying the capabilities required by the application Ensuring that there is at least one image for every category on the Visual Assets tab Providing a proper name to the application Setting the properties of the package, including the name of the developer/publisher, the version of the app, and the certificate used to sign the package. Using Content URIs to give a web page access to geo location devices and the clipboard.

If a client sends a request to get the name of all users, then the service will proceed with it and the client must wait for a response when the service sends a result, and then the client is free. This is an example of which of the following message exchange patterns?

Request/response is the default message exchange pattern. In this pattern, a client sends a request to a server and it waits for the response until the server does not stop processing. For example, if a client sends a request to get the name of all users, then the service will proceed with it and the client must wait for a response when the service sends a result, and then the client is free. Answer B is incorrect. One-way mode is used when we don't want to show any type of error to a client because when we use the message exchange pattern, it doesn't give any message to the client. Answer C is incorrect. Duplex mode is used when we want to send the notification to a client about the request being reached successfully or not. The client and the service both initiate this pattern, and is more complex than other patterns because the additional communication is added.

What attributes are used to define that the .NET Core is optimized for the cloud?

Resiliency Scalability

With the help of which annotation method does ASP.NET decide which Web API method responds to which request?

Route The Route annotation is how ASP.NET decides which Web API method responds to which request. As you will come to realize, after publishing there is no specific file requested when you interface with an ASP.NET Web API. Unlike an ASP.NET Web Forms application where a request is sent to a file with an .aspx extension, the same is not true when calling a Web API (or an ASP.NET MVC application for that matter).Answer D is incorrect. Data Annotation helps in applications whenever there is a change in format of value during adding/displaying in or from the database.Answer C is incorrect. We can use the Newtonsoft.Json class library to parse and use its content.Answer A is incorrect. Fluent Validation is one of the most popular validation frameworks that enables developers to apply code validation rules in a fluent manner with support of standard models.

What will be the output of the following code? static void Main(string[] args) { Console.WriteLine("What is your name?"); char s; s = Convert.ToChar(Console.ReadLine()); Console.WriteLine("How are you: "+s+" ?"); Console.Read(); }

Run time error Since only a single character is required to be entered on the console when a string is entered, a run time exception is being generated as we had not used the Read() method which reads single character but used the readLine() method which reads string and is converted into the char using the convert.tochar() method.

Which of the following methods returns a node collection in the form of an XmlNodeList class?

SelectNodes

Which of the following cloud programming patterns breaks the data into multiple horizontal fragments that contain a distinct subset of the data?

Sharding pattern The sharding pattern breaks the data into multiple horizontal fragments that contain a distinct subset of the data as opposed to vertical scaling via the addition of hardware capacity.

What information is contained in the App.config file?

Storage account name and the secret storage account key The App.config file contains the storage account name and the secret storage account key needed for performing administrative actions on the Azure storage account.Answer A is incorrect. Web.xml is called as deployment descriptor file and it is an XML file that contains information on the configuration of the web application, including the configuration of servlets.Answer B is incorrect. The Global.asax file, also known as the ASP.NET application file, is an optional file that contains code for responding to the application-level and session-level events raised by ASP.NET or by HTTP modules.Answer D is incorrect. Web.config is the file for the local settings to be applied for a website which store configuration data in XML format.

Which of the following lines of code is the correct way to create a StreamWriter object directly from a file named Log.txt?

StreamWriter sw = new StreamWriter("Log.txt", true); There are many ways to create a StreamWriter object; however, to create a StreamWriter object directly from a file named Log.txt, use the following line of code: StreamWriter sw = new StreamWriter("Log.txt", true); If you already have a FileStream object, then you can use it to create StreamWriter: FileStream aFile = new FileStream("Log.txt", FileMode.CreateNew);StreamWriter sw = new StreamWriter(aFile);

Which of the following are sets of properties that are applied to a control as a batch?

Styles Styles are sets of properties that are applied to a control as a batch.

Which of the following state types is removed once the data is read by the application?

TempData

Which of the following are the controls that are used to build the display for a control?

Templates Templates are the controls that are used to build the display for a control. They consist of a hierarchy of controls used to build the display of a control, which may include a content presenter for controls such as buttons that display content.

Which of the following classes exposes events that an application can catch when changes occur in the locations?

The FileSystemWatcher class is used to monitor files and directories, and it exposes events that an application can catch when changes occur in the locations.

Which of the following properties specifies whether an operation returns a response or not?

The IsOneWay property specifies whether an operation returns a response or not.

Consider the following code snippet: string GetURL = "http://handofcards.azurewebsites.net/api/" + playerName; WebClient client = new WebClient(); Stream dataStream = client.OpenRead(GetURL); Which of the following statements are true?

The WebClient contains the methods required to perform an HTTP request. The result of the OpenRead() method is stored in a Stream object. Answers A and C are correct.The web address stored in the GetURL string is the Internet or intranet location of the ASP.NET Web API and is used as a parameter for the OpenRead() method of the WebClient class. The WebClient contains the methods required to perform an HTTP request. The result of the OpenRead() method is stored in a Stream object.

What will be the output of the following code? class Program { static void Main(string[] args) { int[] num = { 1, -2, 3, 0, -4, 5 }; var posNums = num.Where(n => n < 10).Select(r => r%3); Console.Write("The values in num: "); foreach (int i in posNums) Console.Write(i + " "); Console.WriteLine(); Console.ReadLine(); } }

The values in num: 1 -2 0 0 -1 2 In the given code the query is solved using lambda expression. The code var posNums = nums.Where(n => n < 10).Select(r => r%3) creates a query called posNums that creates a sequence of the values less than 10 in the variable num and thus the output will be as follow:

What will be the output of the following code? class Program { static void Main(string[] args) { int[] num = { 10, -20, -30, 50 }; var posNums = from n in num orderby n descending select n*4 / 2; Console.Write("The values in num: "); foreach (int i in posNums) Console.Write(i + " "); Console.WriteLine(); Console.ReadLine(); } }

The values in num: 100 20 -40 -60 In the given code, the orderby clause arranges the values of the variable num in descending order after applying the expression select n*4 / 2 , thus the output will be as follows:

When do we set the Trigger.Setters property to a collection of Setter objects?

To define the actions taken by a Trigger The Trigger.Setters property is set to a collection of Setter objects when we have to define the actions taken by a Trigger.Answer D is incorrect. To define what property a Trigger object monitors, you use the Trigger.Property property.Answer B is incorrect. To define when the Trigger object activates, you set the Trigger.Value property.Answer C is incorrect. We cannot define Triggers directly on any control.

Which transport protocol enables communications via the local network or Internet?

UDP UDP (User Datagram Protocol) is similar to TCP in that it enables communications via the local network or Internet, but it's implemented in a subtly different way. One of the consequences of this implementation is that a service can broadcast messages to multiple clients simultaneously.Answer B is incorrect. TCP enables you to communicate with WCF services on your local network or across the Internet if you configure your firewall appropriately. TCP is more efficient than HTTP and has more capabilities, but it can be more complicated to configure.Answer D is incorrect. MSMQ (Microsoft Message Queuing) is a queuing technology that enables messages sent by an application to be routed through a queue to arrive at a destination. MSMQ is a reliable messaging technology that ensures that a message sent to a queue will reach that queue.Answer C is incorrect. HTTP enables you to communicate with WCF services from anywhere, including across the Internet.

Which of the following points should be considered while designing a universal/Windows application?

Use a badge to provide status or summary info The point that should be considered is use a badge to provide status or summary info. A badge is a small version of the tile that Windows can use on the Lock Screen and in other situations.

Which points should be kept in mind while designing a universal/Windows application?

Using a badge to provide status or summary info Saving space for small screen devices Here are the points that should be kept in mind while designing a universal/Windows application: Using a badge to provide status or summary info. A badge is a small version of the tile that Windows can use on the Lock Screen and in other situations. Saving space for small screen devices. Desktop apps usually display the visual components of the menu and toolbar all the time, but universal apps will often choose not to do so to save precious real estate on the smaller screen. App movement should be adjustable with the orientation of the screen. So, if a user flips its tablet around, the app should follow the movement. A universal app loses focus, it is suspended and will stop using processor resources entirely. This allows many apps to appear to be running at the same time, when in fact they are just suspended. It doesn't display a caption bar. Some apps should keep running when they lose focus. If your app needs to keep running in the background, you must declare it as a Lock Screen app and provide information to display notifications on the Lock Screen.

Which DOM class will represent a node that is not considered as a part of the XML document?

XmlComment XmlComment represents a node that is not considered as a part of the XML document.Answer D is incorrect. XmlNodeList represents a collection of nodes.Answer C is incorrect. XmlText represents the text between a starting tag and a closing tag.Answer A is incorrect. XmlElement represents a single element in the XML document. It is derived from XmlLinkedNode, which in turn is derived from XmlNode.

Which of the following DOM classes extends the XmlNode class?

XmlDocument The XmlDocument class extends the XmlNode class, but is often the first object you use when using XML. That's because this class is used to load and save data from disk or elsewhere.Answer A is incorrect. XmlElementrepresents a single element in the XML document. XmlElement is derived from XmlLinkedNode, which in turn is derived from XmlNode.Answer D is incorrect. XmlAttribute represents a single attribute. Like the XmlDocument class, it is derived from the XmlNode class.Answer B is incorrect. XmlComment represents a special kind of node that is not regarded as part of the document other than to provide information to the reader about parts of the document.

Which of the following classes represents the content between a starting tag and a closing tag?

XmlText

Which of the following statements helps to get the results of a LINQ query?

foreach The foreach statement is used to iterate through the results of a LINQ query. Like the array used as the data source, the results of a LINQ query like this are enumerable, meaning it can be iterated through the results with the foreach statement, as shown in the example below: WriteLine("Names beginning with S:");foreach (var item in queryResults) { WriteLine(item); Answer C is incorrect. The do-while loop is the same as a 'while' loop except that the block of code will be executed at least once, because it first executes the block of code and then it checks the condition.Answer A is incorrect. The for keyword indicates a loop in C#. The for loop executes a block of statements repeatedly until the specified condition returns false. As per the syntax above, the for loop contains three parts: initialization, conditional expression, and steps, which are separated by a semicolon.Answer D is incorrect. An if statement can be followed by an optional else statement, which executes when the boolean expression is false. If the boolean expression evaluates to true, then the if block of code is executed, otherwise else block of code is executed.

What will be the output of the following code? class Program { static void Main(string[] args) { string[] strs = { ".com", ".net", "facebook.com", "google.net", "test", "netflix.net" }; var netAddrs = from addr in strs where addr.Length > 4 && addr.EndsWith(".net", StringComparison.Ordinal) select addr; foreach (var str in netAddrs) Console.WriteLine(str); Console.ReadLine(); } }

google.net netflix.net

Which of the following LINQ keywords is used to classify results in a query?

group By using the group clause, you can group or classify your results based on a key that you specify. It can be inserted between a from clause and a select clause.

Which LINQ keyword is used to categorize results in a query?

group By using the group clause, you can group your results based on a key that you specify. It can be inserted between a from clause and a select clause.Answer C is incorrect. The where clause filters source elements based on one or more Boolean expressions separated by logical AND and OR operators ( && or || ).Answer A is incorrect. The select clause specifies the type and shape that the elements in the returned sequence will have when the query is executed.Answer D is incorrect. The join clause joins two data sources based on an equality comparison between two specified matching criteria.


Ensembles d'études connexes

Therapeutic Interventions (Ch 10-13)

View Set

Cultural Forms of Addression (pg. 89)

View Set

Biology- The Nature of Molecules and the Properties of Water

View Set

Deep Learning for Computer Vision

View Set

13-THE MUSCULOSKELETAL SYSTEM KHAN ACADEMY NOTES

View Set

Path Ch.38 Disorders of Special Sensory Function

View Set

LEGL-2064 - Chapter 14, Section 4: Sales and lease contracts

View Set