Interview Tips Interview Tips, Interview Questions and Answers

18Aug/100

Define Trace Switches

Define Trace Switches.

Trace switches are used to configure tracing behavior.
There are two kinds of trace switches: BooleanSwitch and TraceSwitch.
BooleanSwitch: It is either on or off.
TraceSwitch : It has property to determine trace behaviour.
Trace switches can be configured through application's .config file even after the application is compiled.

What are Trace switches?

Trace switches are used to enable, disable and filter the tracing output. They are objects can be configured through the .config file.

Explain how to implement properties.

You can either use fields or property procedure to add properties.

It is convenient to use fields when the values associated with the properties are less in number. eg: boolean which can have only two values associated with it.

If property procedure has to be used to add a property, then three steps need to be followed:

- Declare a private variable to store the value of the property
- Write a get procedure to retrieve the value of the variable and
- Write a set procedure to set the value of the variable.

13Aug/100

Debug Vs Trace in VSTS

Debug Vs Trace.

Both these objects are found in the System.Diagnostics namespace.
Both are used for diagnose problems without interrupting application execution.
Debug statement can only be used in debug mode while trace statement can be used both in debug and released mode.
Debug statements can't be compiled into a release version.

Define trace class.

The trace class in the code is used to diagnose problem.
You can use trace messages to your project to monitor events in the released version of the application.
The trace class is found in the System.Diagnostics namespace.

11Aug/100

What is break mode? What are the options to step through code?

What is break mode? What are the options to step through code?

Break mode lets you to observe code line to line in order to locate error.
VS.NET provides following option to step through code.
Step Into
Step Over
Step Out
Run To Cursor
Set Next Statement

.NET debug and trace classes - August 25, 2008 at 18:00 PM by Amit Satpute

What is Break mode?

When changes are made to the code in an application, the way to be able to view how those changes have changed the way of execution is Break Mode. In break mode, a snapshot of the running application is taken in which the status and values of all the variables is stored.

5Aug/100

What is Windows Presentation Foundation, WPF?

What is Windows Presentation Foundation, WPF?

WPF allows creating rich application with respect to look and feel. The rich classes of WPF along with a design engine allow you to make innovative interfaces and client applications with 3D images, animation that is not available using HTML

What are the different documents supported in WPF?

The different documents supported by WPF are mainly fixed documents and flow documents. Fixed documents are used for what you see is what you get (WYSIWYG) applications. In such applications observance to the original design is important. E.g. Desktop applications Flow documents concentrate more on optimize viewing and readability., rather than using a “fixed” layout, flow documents adjust their content based on values of runtime variables. Adjusting content will also include adjusting size, resolution etc. E.g. a Web page.

15Jul/100

Explain the ways of authentication techniques in ASP.NET

Selection of an authentication provider is done through the entries in the web.config file for an application.

The modes of authentication are:

<authentication mode=”windows”>
<authentication mode=”passport”>
<authentication mode=”forms”>

Custom authentication needs installation of ISAPI filter in IIS. It compares incoming requests to a list of source IP addresses and a request is considered to be authenticated if it comes from an acceptable address.

10Jul/100

How to use performance monitor to diagnose bottlenecks in your application?

Monitor is a tool built to assist you in diagnosing the problem.
Type ‘perfmon’ in command prompt to access Performance Monitor

The counters, sampling intervals, etc can be used to monitor the performance.

A baseline should be established so that critical reference points, changes and trends can be observed and identified.

Results can be made more readable by removing all the distracting sample noise so that the graphical view of trend lines is not blurred. This can be done using buckets - a vertical line, indicating the minimum, average, and maximum of the sample points in the bucket.

It should be noted that the bottlenecks can be caused due to over utilization of physical disk, memory, process, CPU, and network.

16Jun/103

ASP.NET Cookies Overview

A cookie is a small bit of text that accompanies requests and pages as they go between the Web server and browser. The cookie contains information the Web application can read whenever the user visits the site.

For example, if a user requests a page from your site and your application sends not just a page, but also a cookie containing the date and time, when the user's browser gets the page, the browser also gets the cookie, which it stores in a folder on the user's hard disk.

Later, if user requests a page from your site again, when the user enters the URL the browser looks on the local hard disk for a cookie associated with the URL. If the cookie exists, the browser sends the cookie to your site along with the page request. Your application can then determine the date and time that the user last visited the site. You might use the information to display a message to the user or check an expiration date.

Cookies are associated with a Web site, not with a specific page, so the browser and server will exchange cookie information no matter what page the user requests from your site. As the user visits different sites, each site might send a cookie to the user's browser as well; the browser stores all the cookies separately.

Cookies help Web sites store information about visitors. More generally, cookies are one way of maintaining continuity in a Web application—that is, of performing state management. Except for the brief time when they are actually exchanging information, the browser and Web server are disconnected. Each request a user makes to a Web server is treated independently of any other request. Many times, however, it's useful for the Web server to recognize users when they request a page. For example, the Web server on a shopping site keeps track of individual shoppers so the site can manage shopping carts and other user-specific information. A cookie therefore acts as a kind of calling card, presenting pertinent identification that helps an application know how to proceed.

Cookies are used for many purposes, all relating to helping the Web site remember users. For example, a site conducting a poll might use a cookie simply as a Boolean value to indicate whether a user's browser has already participated in voting so that the user cannot vote twice. A site that asks a user to log on might use a cookie to record that the user already logged on so that the user does not have to keep entering credentials.

Cookie Limitations

Most browsers support cookies of up to 4096 bytes. Because of this small limit, cookies are best used to store small amounts of data, or better yet, an identifier such as a user ID. The user ID can then be used to identify the user and read user information from a database or other data store. (See the section "Cookies and Security" below for information about security implications of storing user information.)

Browsers also impose limitations on how many cookies your site can store on the user's computer. Most browsers allow only 20 cookies per site; if you try to store more, the oldest cookies are discarded. Some browsers also put an absolute limit, usually 300, on the number of cookies they will accept from all sites combined.

A cookie limitation that you might encounter is that users can set their browser to refuse cookies. If you define a P3P privacy policy and place it in the root of your Web site, more browsers will accept cookies from your site. However, you might have to avoid cookies altogether and use a different mechanism to store user-specific information. A common method for storing user information is session state, but session state depends on cookies, as explained later in the section "Cookies and Session State."

2Jun/101

ASP.NET 2.0 Interview Questions

24. While developing ASP.NET 2.0 web application you have a DataSet containing a Customer DataTable and an Order DataTable. You want to easily navigate from an Order DataRow to the Customer who placed the order. What object will allow you to easily navigate from the Order to the Customer?
A. The DataColumn object
B. The DataTable object
C. The DataRow object
D. The DataRelation object
25. Which of the following is a requirement when merging modified data into a DataSet?
A. A primary key must be defined on the DataTable objects.
B. The DataSet schemas must match in order to merge.
C. The destination DataSet must be empty prior to merging.
D. A DataSet must be merged into the same DataSet that created it.
26. You are working with a DataSet and want to be able to display data, sorted different ways. How do you do so?
A. Use the Sort method on the DataTable object.
B. Use the DataSet object’s Sort method.
C. Use a DataView object for each sort.
D. Create a DataTable for each sort, using the DataTable object’s Copy method, and then Sort the result.
27. Which of the following ways can you proactively clean up a database connection’s resources?
A. Execute the DbConnection object’s Cleanup method.
B. Execute the DbConnection object’s Close method.
C. Assign Nothing (C# null) to the variable that references the DbConnection object.
D. Create a using block for the DbConnection object.
29. What event can you subscribe to if you want to display information from SQL Print statements?
A. InfoMessage
B. MessageReceived
C. PostedMessage
D. NewInfo
30. To perform asynchronous data access, what must be added to the connection string?
A. BeginExecute=true
B. MultiThreaded=true
C. MultipleActiveResultSets=true
D. Asynchronous=true
31. Which class can be used to create an XML document from scratch?
A. XmlConvert
B. XmlDocument
C. XmlNew
D. XmlSettings
32. Which class can be used to perform data type conversion between .NET data types and XML types?
A. XmlType
B. XmlCast
C. XmlConvert
D. XmlSettings

24. While developing ASP.NET 2.0 web application you have a DataSet containing a Customer DataTable and an Order DataTable. You want to easily navigate from an Order DataRow to the Customer who placed the order. What object will allow you to easily navigate from the Order to the Customer? A. The DataColumn object B. The DataTable object C. The DataRow object D. The DataRelation object
25. Which of the following is a requirement when merging modified data into a DataSet? A. A primary key must be defined on the DataTable objects. B. The DataSet schemas must match in order to merge. C. The destination DataSet must be empty prior to merging. D. A DataSet must be merged into the same DataSet that created it.
26. You are working with a DataSet and want to be able to display data, sorted different ways. How do you do so? A. Use the Sort method on the DataTable object. B. Use the DataSet object’s Sort method. C. Use a DataView object for each sort. D. Create a DataTable for each sort, using the DataTable object’s Copy method, and then Sort the result.
27. Which of the following ways can you proactively clean up a database connection’s resources? A. Execute the DbConnection object’s Cleanup method. B. Execute the DbConnection object’s Close method. C. Assign Nothing (C# null) to the variable that references the DbConnection object. D. Create a using block for the DbConnection object.
29. What event can you subscribe to if you want to display information from SQL Print statements? A. InfoMessage B. MessageReceived C. PostedMessage D. NewInfo
30. To perform asynchronous data access, what must be added to the connection string? A. BeginExecute=true B. MultiThreaded=true C. MultipleActiveResultSets=trueD. Asynchronous=true
31. Which class can be used to create an XML document from scratch? A. XmlConvert B. XmlDocument C. XmlNew D. XmlSettings
32. Which class can be used to perform data type conversion between .NET data types and XML types? A. XmlType B. XmlCast C. XmlConvert D. XmlSettings