About Me

My photo
Northglenn, Colorado, United States
I'm primarily a BI Developer on the Microsoft stack. I do sometimes touch upon other Microsoft stacks ( web development, application development, and sql server development).
Showing posts with label questions. Show all posts
Showing posts with label questions. Show all posts

Saturday, September 08, 2007

Some Interview Questions given to me in the past.

1. What is a PostBack?
2. What is ViewState? How is it encoded? Is it encrypted? Who uses ViewState?
3. Demonstrate definition of a property in a class (in c#)
4. Demonstrate populating a dropdownlist from an xml file (in c#)
5. How do you assign a static IP Address to a Windows 2003 Server?
6. Draw out what the outcome of an Inner Join, Left Outer Join and Right Outer Join would be on two tables.
7. How would you access the database connection strings from a web.config file in VS 2003 and VS 2005?
8. Where would you setup “Impersonation” and when would it be a good time to use it?
9. How many static IP Addresses can a Windows 2003 Server have?
10. A client needs a web page that collects the following: first name, last name, phone number and then pushes the data to them via email. Please provide sample code of a form that sends that data to the client.
11. Demonstrate in Asp.Net how to pull a remote user’s IP Address, Referring URL, and the [cookieid] from a user’s machine for domain [SAN].
12. Please provide an example of a time when you have ever used web services.
13. How would you go about debugging a web service SOAP Message?
14. How do you view the methods and properties of a web service within Visual Studio?















1) What is a postback?

http://www.xefteri.com/articles/show.cfm?id=18 does a nice job in explaining what a postback is, in detail.

In my own words: In a standard postback a web page, with a web form is submitted and then processed on the server-side. The server-side then updates the page on the client-side by reposting the data. This is usually seen with something similar to a page refresh. (Which is why, if you are buying something on the web, it's a good idea not to hit refresh button or it would duplicate the last sent request.)

Now with, javascript and nowadays Ajax, it isn't necessary to refresh the whole page. It is possible to just refresh a certain control, allowing the user to see updated information without refreshing and redrawing other controls.



2) What is ViewState? How is it encoded? Is it encrypted? Who uses ViewState?

In my own words:
A viewstate is a serializable hashtable of objects that are used to store information on the client-side. During a postback, the informatin is then used on the server-side before reposting to the client-side. This allows the data found in controls like a textbox to be repoulated, or to use the viewstate to store global variables which can be reused.

A viewstate is stored in base64, and encryption by default is set to auto. This means, as long as no control in the form does not need encryption, then the whole viewstate is unencrypted; otherwise the whole viewstate is encrypted. You can set the view state for each page:

<%@Page ViewStateEncryptionMode="Always" %>

, or you can set it for the whole website by using the web.config:

<configuration>
<system.web>
<pages ViewStateEncryptionMode="Always" />
</system.web>
</configuration>


3) Demonstrate definition of a property in a class

class MyClass
{
private string _name = “”;

public string Name
{
get
{
return _name;
}
set
{
_name = value;
}
}
}


4) Demonstrate populating a dropdownlist from an xml file


Not tested:

XML file:

<library>
<book>
<author>Dietel & Dietel</author>
<title>C how to program</title>
</book>
<book>
<author>William Shakespare</author>
</book>
</library>


XmlDocument doc = new XmlDocument();
doc.Load(Server.MapPath("Library.xml"));
XmlNodeList nodeList = doc.SelectNodes("library/book/"); //xslt path
foreach(XmlNode node in nodeList)
{
DropDownListTitle.Items.Add(new ListItem(node.SelectSingleNode("title").InnerText));
}


5) How do you assign a static IP Address to a Windows 2003 Server?

I personally don't know much about setting up servers, I'm a developer. So, I look it up:
http://technet2.microsoft.com/windowsserver/en/library/36c35b2c-8b8b-4517-812e-913a60ff551d1033.mspx?mfr=true

The basic info provided:

To configure TCP/IP for static addressing
1.
Open Network Connections.
2.
Right-click the network connection you want to configure, and then click Properties.
3.
On the General tab (for a local area connection) or the Networking tab (for all other connections), click Internet Protocol (TCP/IP), and then click Properties.
4.
Click Use the following IP address, and do one of the following:
•
For a local area connection, in IP address, Subnet mask, and Default gateway, type the IP address, subnet mask, and default gateway addresses.
•
For all other connections, in IP address, type the IP address.
5.
Click Use the following DNS server addresses.
6.
In Preferred DNS server and Alternate DNS server, type the primary and secondary DNS server addresses.








6) Draw out what the outcome of an Inner Join, Left Outer Join and Right Outer Join would be on two tables.

Can't draw







7) How would you access the database connection strings from a web.config file in VS 2005? (Don't care about VS 2003 anymore :P )

This question really sucks, I wish it was more specific.
If I just need to look it up, I would just open the web.config file and look in the appSetting tag:

<appSettings>
<add key="sqlConn" value="Server=myPc;Database=Northwind" />
<add key="smtpServer" value="smtp.mydomain.com" />
</appSettings>

If I need to access it in the program:

this.sqlConnection1.ConnectionString = ((string)( System.Configuration.ConfigurationSettings.AppSettings.GetValues("sqlConn.ConnectionString"))));


8) Where would you setup “Impersonation” and when would it be a good time to use it?
"When using impersonation, ASP.NET applications can optionally execute with the identity of the client on whose behalf they are operating. The usual reason for doing this is to avoid dealing with authentication and authorization issues in the ASP.NET application code. Instead, you rely on Internet Information Services (IIS) to authenticate the user and either pass an authenticated token to the ASP.NET application or, if unable to authenticate the user, pass an unauthenticated token. "
In the web.config:
<identity impersonate="true"/>
http://west-wind.com/weblog/posts/1572.aspx goes in nice detail on how to access information that is not allowed with the standard asp.net permissions.

Wednesday, September 27, 2006

BizTalk Questions: Migrating BTS 2002 to BTS 2004

Well, I'm starting to read a article on migrating BT2002 to BT2004 and seen these questions and answers.

What is a promoted property?


Property promotion enables you to flag schema nodes at design time for promotion to the MessageBox at run time. In addition to any custom metadata you explicitly define by promoting properties, BizTalk Server 2004 has several pre-existing properties that it tracks by default. These pre-existing properties are not defined by instance schemas.


What is a binding file?


Binding files are shortcuts so that you can bind once using the BizTalk Explorer, export that binding, and then import it when you need to assign the binding subsequent times. For example, if you install and deploy your development environment and save a binding file, when it is time to go into production, you can script the Deployment Wizard and specify the binding file to use to create the bindings for the ports. For messaging migration, the Migration Wizard only generates one binding file for the send or receive locations in a solution.


Can I have multiple schemas with the same root node?


No. The messaging engine relies on the root node to resolve an XML instance to a schema at run time. (This is possible in BizTalk Server 2002.)


Can I add an orchestration within my migration project?


Yes, it is possible, but not recommended because you have to manually create a send/receive port to/from an orchestration, thereby complicating the migration of your messaging solution.


Is it possible to create an orchestration that receives a non-XML message (a binary large object (BLOB) for instance) through a pipeline with a custom disassembler and promote properties in the blob?


You can pass type-less [aka: un-type] messages through orchestrations by declaring them as an XmlDocument. If you want to retrieve their data, you need to pass them to a .NET object as XLANGPart/XLANGMessage and call part.RetrieveAs(typeof(Stream) ); by using part.LoadFrom( myStream ), you can also construct non-XML messages in an orchestration.


How do I create a dynamic send port?


You can create a dynamic send port either using BizTalk Explorer or within an orchestration:

BizTalk Explorer – Create the port using BizTalk Explorer, and then assign values to the transport properties in BizTalk Editor using the global property schema. You can then select the appropriate schema from references. By default, BizTalk Server 2004 references Microsoft.BizTalk GlobalPropertySchema. Values to the transport properties come from your document. You need to promote elements from your schema using the global property schema.

Orchestration – You can create dynamic ports in an orchestration, and, after you deploy it, the port is accessible from BizTalk Explorer. In the orchestration, you need to assign the address (transport) using an Expression shape.


Will the Migration Wizard migrate custom script functoids?


No. Any maps that are migrated that contain custom script functoids need to be opened and functoids re-coded.


Will the Migration Wizard migrate my queue receive functions?


Yes. BizTalk Server supports all types of receive functions including BizTalk message queuing (MSMQ) file receive. BizTalk Server supports the conventional HTTP receive function, but not the HTTP file receive function because it has no meaningful use in the product.


Will the Migration Wizard migrate my pre-processor?


No. You must update your project by manually migrating any components such as pre-processors not migrated by the Migration Wizard.


Will the Migration Wizard migrate my channel routing and filter configurations?


No, with one exception. BizTalk Server 2004 automatically migrates routing and filtering configurations for channels that use dynamic routing or filtering. Custom routing done in a channel requires that you promote the properties and create the filters.


Will the Migration Wizard migrate orchestrations?

No. The Migration Wizard only migrates the following items.
  • BTS 2002 document definitions to BTS 2004 schemas

  • BTS 2002 maps to BTS 2004 maps

  • BTS 2002 receive functions to BTS 2004 receive locations

  • BTS 2002 ports and channels to BTS 2004 ports and pipelines

  • BTS 2002 port groups (distribution lists) to BTS 2004 send port groups


The content in this section is provided by Ben Goeltz, Brandon Gross, and Stephen Roger of Equarius, Inc. For more information about Equarius, Inc., see http://go.microsoft.com/fwlink/?LinkId=26941, published in September 2004.