1.
When an exception occurs, the remainder of the code in the ____ block is skipped
Correct Answer
A. Try
Explanation
When an exception occurs, the remainder of the code in the try block is skipped. The try block is used to enclose the code that might throw an exception. If an exception is thrown within the try block, the control is transferred to the corresponding catch block. Therefore, any code after the point where the exception is thrown will not be executed unless it is within a catch or finally block.
2.
What are the different ways to overload a method?
(There may be multiple answers)
Correct Answer(s)
B. Different parameter data types
C. Different number of parameters
D. Different ordering of parameters
Explanation
The different ways to overload a method include using different parameter data types, different number of parameters, and different ordering of parameters. By using different parameter data types, the method can be called with different types of arguments. By using a different number of parameters, the method can be called with a different number of arguments. By using a different ordering of parameters, the method can be called with the parameters in a different order. These techniques allow for flexibility and versatility in method usage.
3.
When customErrors mode is set to Off, which of the following happens when an error occurs:
Correct Answer
B. All visitors see the full error details
Explanation
When the customErrors mode is set to Off, it means that all visitors, both local and remote users, will see the full error details when an error occurs. This means that instead of being redirected to a custom error page, they will be able to view the complete error message and stack trace, which can be helpful for troubleshooting and debugging purposes.
4.
If the value of passwordFormat is set to _______, users cannot retrieve their original passwords
Correct Answer
D. Hashed
Explanation
If the value of passwordFormat is set to "Hashed", users cannot retrieve their original passwords. Hashing is a one-way process that converts a password into a fixed-length string of characters, making it impossible to reverse-engineer the original password from the hashed version. This is a common security measure used to protect user passwords in databases. If users forget their passwords, they typically have to reset them rather than retrieve the original password.
5.
You should constrain user input to data you know is safe by:
(There may be multiple answers)
Correct Answer(s)
A. Setting max length on ASP.NET and HTML input controls
B. Using ASP.NET validation controls (RequiredFieldValidation, CompareValidator, RangeValidator, RegularExpressionValidator, CustomValidator) to constrain user input via ASP.NET input controls as much as possible.
C. Constraining user input to a white list (list of acceptable characters)
Explanation
The correct answer suggests that you should use multiple methods to constrain user input to ensure data safety. Setting a maximum length on input controls helps prevent users from entering excessively long inputs that could potentially cause issues. Using ASP.NET validation controls allows you to enforce specific rules and restrictions on user input, such as required fields, data comparisons, ranges, regular expressions, and custom validations. Constraining user input to a white list ensures that only acceptable characters are allowed, while constraining to a black list identifies and blocks all unacceptable characters. By implementing these measures, you can enhance data safety and prevent potential vulnerabilities.
6.
How do you explicitly kill a user session?
Correct Answer
B. Session.Abandon
Explanation
Session.Abandon is the correct answer because it is the method used to explicitly kill a user session in many programming languages, including ASP.NET. When Session.Abandon is called, it immediately terminates the session and removes all session data, including the session ID. This effectively ends the user's session and any further requests from the user will result in a new session being created.
7.
Which of the following is TRUE about Windows Authentication in ASP.NET?
Correct Answer
A. Automatically determines role membership
Explanation
Windows Authentication in ASP.NET automatically determines role membership. This means that the roles assigned to a user are determined by the authentication system itself, rather than being determined solely by user programming. This allows for easier management of role-based access control in ASP.NET applications, as the system can automatically assign roles based on the user's Windows credentials.
8.
JQuery is?
Correct Answer
C. A collection of scripts used to enhance End-User clientside experience.
Explanation
jQuery is a collection of scripts used to enhance the end-user clientside experience. It is a popular JavaScript library that simplifies the process of manipulating HTML documents, handling events, and creating animations. It provides a wide range of features and functionalities that make it easier for developers to create interactive and dynamic web pages. jQuery is not a .Net class, a javascript to connect and fetch data from a database server, or a java runtime based query execution client.
9.
Which of the following must be done in order to connect data from some data resource to Repeater control?
(There may be multiple answers)
Correct Answer(s)
A. Set the DataSource property
B. Call the DataBind method
Explanation
To connect data from a data resource to a Repeater control, two steps must be done. First, the DataSource property of the Repeater control needs to be set to the appropriate data source. This tells the Repeater control where to retrieve the data from. Second, the DataBind method needs to be called on the Repeater control. This method binds the data from the data source to the Repeater control, allowing it to display the data.
10.
What is the base class from which all Web forms inherit?
Correct Answer
B. Page Class
Explanation
The correct answer is "Page Class". The Page Class is the base class from which all Web forms inherit in ASP.NET. This class provides the basic functionality and properties required for creating and managing web pages. It contains methods and properties that allow developers to handle events, manage state, and interact with the user interface. By inheriting from the Page Class, developers can easily create and customize web forms according to their requirements.
11.
What is the Use of Global.asax
Correct Answer
A. Program Application & Session level events
Explanation
The Global.asax file is used to handle application-level and session-level events in a web application. It allows developers to write code that executes when certain events occur, such as when the application starts or ends, or when a session is started or ended. This file is commonly used to initialize global variables, set application-wide settings, and perform tasks that need to be done at the application or session level. It does not have any direct relation to notifying when a global variable is changed or setting the global layout of a web application.
12.
How do you manage states?
(There may be multiple answers)
Correct Answer(s)
A. Viewstate
B. Session Object
C. Application Object
Explanation
The correct answer is Viewstate, Session Object, and Application Object. These are different ways to manage states in a web application. Viewstate is used to store the state of individual controls on a web page. Session Object is used to store user-specific data that can be accessed across multiple pages during a user session. Application Object is used to store data that is shared among all users of the application. These objects provide different levels of state management depending on the scope and lifespan of the data.
13.
Where is default session data is stored?
Correct Answer
A. In Process
Explanation
The default session data is stored "In Process" which means that it is stored in the memory of the web server hosting the application. This allows for fast and efficient access to the session data. However, it also means that if the server is restarted or the application is redeployed, the session data will be lost.
14.
What method is used to ensure that only one process accesses a variable at a time?
Correct Answer
C. Lock() & Unlock()
Explanation
The method used to ensure that only one process accesses a variable at a time is by using the Lock() and Unlock() functions. These functions allow a process to acquire a lock on the variable, ensuring that no other process can access it until the lock is released. This ensures data integrity and prevents race conditions where multiple processes try to modify the variable simultaneously.
15.
Suppose a .NET programmer wants to convert an object into a stream of bytes then the process is called ?
Correct Answer
B. Serialization
Explanation
Serialization is the correct answer because it refers to the process of converting an object into a stream of bytes, which can then be stored or transmitted and later reconstructed back into an object. This is commonly used in .NET programming to save and load objects, send objects over a network, or store objects in a database. Threading, RCW, and AppDomain are unrelated concepts and do not involve the conversion of objects into bytes.
16.
In ASP.Net MVC, what is "Scaffolding" ?
Correct Answer
A. Quickly generating a basic outline of your software that you can then edit and customize.
Explanation
Scaffolding in ASP.Net MVC refers to the process of quickly generating a basic outline of your software that can be further customized and edited. It helps in automating the creation of basic code files, such as models, views, and controllers, based on predefined templates. This saves time and effort by providing a starting point for development, allowing developers to focus on implementing business logic rather than writing repetitive code. The generated code can be modified as per the specific requirements of the application.
17.
What is the purpose of "ViewBag" object?
Correct Answer
A. It enables you to pass data to a view template using a late-bound dictionary API.
Explanation
The purpose of the "ViewBag" object is to enable the passing of data to a view template using a late-bound dictionary API. This allows for dynamic data binding and flexibility in passing data from the controller to the view. The ViewBag object acts as a container for any data that needs to be passed to the view, and the late-bound dictionary API allows for accessing this data in the view template.
18.
What is the purpose of "TempData" object?
Correct Answer
D. All of the above.
Explanation
The purpose of the "TempData" object is to serve as a temporary storage mechanism in ASP.NET. It is derived from the TempDataDictionary class and stored in a short-lived session. It is commonly used to store one-time messages such as error messages or validation messages, which can be displayed to the user and then cleared. Additionally, it can be used to pass data from the current request to subsequent requests, making it useful for scenarios where data needs to be preserved across multiple actions or redirects. Therefore, the correct answer is "All of the above."
19.
ASP.Net MVC Framework supports these types of filters:
1. Authorization filter
2. Authentication filter
3. Action filter
4. Result filter
5. View filter
6. Exception filter
Correct Answer
C. 1,3,4,6
Explanation
The correct answer is 1,3,4,6 because ASP.Net MVC Framework supports Authorization filter, Action filter, Result filter, and Exception filter. Authentication filter and View filter are not supported by the framework.
20.
ASP.Net MVC Html Helper methods:
Correct Answer
A. Enables you to encapsulate the rendering of html
Explanation
ASP.Net MVC Html Helper methods enable you to encapsulate the rendering of html. This means that you can use these helper methods to generate HTML markup in a more organized and reusable way. Instead of writing raw HTML tags and attributes in your views, you can use helper methods to generate the desired HTML output. This helps in improving code maintainability and readability.
21.
WCF supports these bindings:
1. BasicHttp
2. WsHttp
3. NetTcp
4. Net MSMQ
5. NetTCP
6. wsFederation
Correct Answer
D. 1,2,3,4,5,6
Explanation
WCF supports all of the given bindings: BasicHttp, WsHttp, NetTcp, Net MSMQ, NetTCP, and wsFederation. This means that developers can choose any of these bindings to configure their WCF services based on their specific requirements and preferences.
22.
Some of the classes in System. Threading Namespace:
1. Thread
2. ThreadPool
3. ThreadProperty
4. Monitor
5. ThreadReflect
6. Mutex
Correct Answer
A. 1,2,4,6
Explanation
The correct answer is 1,2,4,6. These are the classes in the System.Threading namespace. Thread class represents a thread of execution. ThreadPool class provides a pool of threads that can be used to execute tasks. Monitor class provides a mechanism to synchronize access to objects. Mutex class provides a mutual exclusion lock. Therefore, the classes mentioned in the correct answer are the ones that belong to the System.Threading namespace and are relevant for working with threads and synchronization.
23.
Some of the methods in Thread Class:
1. Sleep
2. Start
3. Suspend
4. SetMaxThread
5. OpenExisting
Correct Answer
C. 1,2,3
Explanation
The correct answer is 1,2,3. This is because the methods mentioned in the options are all methods available in the Thread class. The Sleep method is used to pause the execution of a thread for a specified amount of time. The Start method is used to start the execution of a thread. The Suspend method is used to temporarily suspend the execution of a thread. Therefore, options 1,2,3 are the correct combination of methods in the Thread class.
24.
These are different types of contracts in WCF:
1. Service
2. Data
3. Message
4. Fault
5. Operation
Correct Answer
C. 1,2,3,4,5
Explanation
The correct answer is 1,2,3,4,5. This means that all types of contracts (Service, Data, Message, Fault, and Operation) are present in WCF. These contracts define the communication between the client and the service, specifying the operations that can be performed, the data that can be exchanged, and how faults are handled.
25.
WCF Service can be hosted in the following way(s):
Correct Answer
F. All of the above
Explanation
WCF service can be hosted in various ways, including Windows Service, IIS, WAS, WPF Application, and Windows Application. All of these options provide different hosting environments for the WCF service, depending on the specific requirements and preferences of the application. Therefore, the correct answer is "All of the above."