You are developing an application that will transmit large amounts of data between a client computer and a server.
You need to ensure the validity of the data by using a cryptographic hashing algorithm.
Which algorithm should you use?
Answer : A
Explanation:
Explanation:
The .NET Framework provides the following classes that implement hashing algorithms:
-> HMACSHA1.
-> MACTripleDES.
-> MD5CryptoServiceProvider.
-> RIPEMD160.
-> SHA1Managed.
-> SHA256Managed.
-> SHA384Managed.
-> SHA512Managed.
HMAC variants of all of the Secure Hash Algorithm (SHA), Message Digest 5 (MD5), and RIPEMD-160 algorithms.
CryptoServiceProvider implementations (managed code wrappers) of all the SHA algorithms.
Cryptography Next Generation (CNG) implementations of all the MD5 and SHA algorithms.
References:
http://msdn.microsoft.com/en-us/library/92f9ye3s.aspx#hash_values
DRAG DROP -
You are testing an application. The application includes methods named CalculateInterest and LogLine. The CalculateInterest() method calculates loan interest. The LogLine() method sends diagnostic messages to a console window.
You have the following requirements:
-> The CalculateInterest() method must run for all build configurations.
-> The LogLine() method must be called only for debug builds.
You need to ensure that the methods run correctly.
How should you complete the relevant code? (To answer, drag the appropriate code segments to the correct locations in the answer area. Each code segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.)
Select and Place:
Answer :
You are developing an assembly that will be used by multiple applications.
You need to install the assembly in the Global Assembly Cache (GAC).
Which two actions can you perform to achieve this goal? Each correct answer presents a complete solution.
NOTE: Each correct selection is worth one point.
Answer : DE
Explanation:
There are two ways to deploy an assembly into the global assembly cache:
Use an installer designed to work with the global assembly cache. This is the preferred option for installing assemblies into the global assembly cache.
Use a developer tool called the Global Assembly Cache tool (Gacutil.exe), provided by the Windows
Software Development Kit (SDK).
Note:
In deployment scenarios, use Windows Installer 2.0 to install assemblies into the global assembly cache. Use the Global Assembly Cache tool only in development scenarios, because it does not provide assembly reference counting and other features provided when using the Windows Installer.
References:
http://msdn.microsoft.com/en-us/library/yf1d93sz%28v=vs.110%29.aspx
You are debugging an application that calculates loan interest. The application includes the following code. (Line numbers are included for reference only.)
Answer : A
Explanation:
By default, the Debug.Assert method works only in debug builds. Use the Trace.Assert method if you want to do assertions in release builds. For more information, see Assertions in Managed Code.
References:
http://msdn.microsoft.com/en-us/library/kssw4w7z.aspx
You are developing an application that accepts the input of dates from the user.
Users enter the date in their local format. The date entered by the user is stored in a string variable named inputDate. The valid date value must be placed in a
DateTime variable named validatedDate.
You need to validate the entered date and convert it to Coordinated Universal Time (UTC). The code must not cause an exception to be thrown.
Which code segment should you use?
Answer : A
Explanation:
AdjustToUniversal parses s and, if necessary, converts it to UTC.
Note: The DateTime.TryParse method converts the specified string representation of a date and time to its DateTime equivalent using the specified culture- specific format information and formatting style, and returns a value that indicates whether the conversion succeeded.
DRAG DROP -
You are developing an application by using C#. The application will process several objects per second.
You need to create a performance counter to analyze the object processing.
Which three actions should you perform in sequence? (To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order.)
Select and Place:
Answer :
Explanation:
CounterCreationDataCollection counterDataCollection = new CounterCreationDataCollection(); // Box1
// Add the counter. Box 1
CounterCreationData averageCount64 = new CounterCreationData(); averageCount64.CounterType = PerformanceCounterType.AverageCount64; averageCount64.CounterName = "AverageCounter64Sample"; counterDataCollection.Add(averageCount64);
// Add the base counter.
CounterCreationData averageCount64Base = new CounterCreationData(); averageCount64Base.CounterType = PerformanceCounterType.AverageBase; averageCount64Base.CounterName = "AverageCounter64SampleBase"; counterDataCollection.Add(averageCount64Base); // Box 2
// Create the category. Box 3
PerformanceCounterCategory.Create("AverageCounter64SampleCategory",
"Demonstrates usage of the AverageCounter64 performance counter type.",
PerformanceCounterCategoryType.SingleInstance, counterDataCollection);
You are developing an application by using C#. You provide a public key to the development team during development.
You need to specify that the assembly is not fully signed when it is built.
Which two assembly attributes should you include in the source code? Each correct answer presents part of the solution.
NOTE: Each correct selection is worth one point.
Answer : CD
References:
http://msdn.microsoft.com/en-us/library/t07a3dye(v=vs.110).aspx
DRAG DROP -
You are developing an application that includes a class named Warehouse. The Warehouse class includes a static property named Inventory- The Warehouse class is defined by the following code segment. (Line numbers are included for reference only.)
Answer :
Explanation:
After taking a lock you must check once again the _inventory field to be sure that other threads didn't instantiated it in the meantime.
You are adding a public method named UpdateGrade to a public class named ReportCard.
The code region that updates the grade field must meet the following requirements:
-> It must be accessed by only one thread at a time.
-> It must not be vulnerable to a deadlock situation.
You need to implement the UpdateGrade() method.
What should you do?
Answer : A
You are developing an application that includes a class named BookTracker for tracking library books. The application includes the following code segment. (Line numbers are included for reference only.)
Answer : B
DRAG DROP -
You are implementing a method that creates an instance of a class named User and adds the user to the users list. The User class contains a public event named Renamed. The following code segment defines the Renamed event:
Public event EventHandler<RenameEventArgs> Renamed;
You need to create an event handler for the Renamed event by using a lambda expression.
You have the following code:
Answer :
You are creating a console application by using C#.
You need to access the assembly found in the file named car.dll.
Which code segment should you use?
Answer : D
Explanation:
Assembly.LoadFile - Loads the contents of an assembly file on the specified path.
References:
http://msdn.microsoft.com/en-us/library/b61s44e8.aspx
You are developing an application by using C#.
The application includes an object that performs a long running process.
You need to ensure that the garbage collector does not release the object's resources until the process completes.
Which garbage collector method should you use?
Answer : C
Explanation:
The GC.KeepAlive method references the specified object, which makes it ineligible for garbage collection from the start of the current routine to the point where this method is called.
The purpose of the KeepAlive method is to ensure the existence of a reference to an object that is at risk of being prematurely reclaimed by the garbage collector.
The KeepAlive method performs no operation and produces no side effects other than extending the lifetime of the object passed in as a parameter.
An application includes a class named Person. The Person class includes a method named GetData.
You need to ensure that the GetData() method can be used only by the Person class and not by any class derived from the Person class.
Which access modifier should you use for the GetData() method?
Answer : D
Explanation:
The GetData() method should be private. It would then only be visible within the Person class.
DRAG DROP -
You are developing an application by using C#. The application will output the text string "First Line" followed by the text string "Second Line".
You need to ensure that an empty line separates the text strings.
Which four code segments should you use in sequence? (To answer, move the appropriate code segments to the answer area and arrange them in the correct order.)
Select and Place:
Answer :
Explanation:
Box 1:
Have any questions or issues ? Please dont hesitate to contact us