Wednesday, March 16, 2011

App Shark Qns

Telephonic - 15 min

SQL

1) Difference between UDF and SP?
2) What is concurrency?
3) How do you handle concurrency?
4) What did you do in SQL?
5) What is transaction?
6) Where/when do you commit or rollback transaction?

C#

1) What is interface?
2) There is class A and Class B and Class C. C is inherited from B, B is inherited from A. I created object for Class C. What is the order of the constructor execution?

First constructor of Class A is executed. Next, Class B constructor is executed, later Class C constructor is executed.

namespace ClasABC
{
class Program
{
static void Main(string[] args)
{
C obj = new C();
}
}

class A
{
public A()
{
Console.WriteLine("Constructor in 'Class A' is executed");
}
}
class B : A
{
public B()
{
Console.WriteLine("Constructor in 'Class B' is executed");
}
}
class C : B
{
public C()
{
Console.WriteLine("Constructor in 'Class C' is executed");
}
}
}
OutPut:











3) What is static variable?
4) How do you access static member?
5) What is difference between a global variable and public property?
6) What is object intializer?
7) what is generations?
8) What is garbage collector?
9) What is dispose method?

ASP.NET

1) How do you maintain state?
2) Where do you store session?
3) How do you identity a session belongs to a particular user?

4) If cookies are disabled at browser, how do you identify a session belongs to a particular user?


In ASP.NET, the necessary session-to-user link may optionally be established without using cookies. Interestingly enough, you don't have to change anything in your ASP.NET application to enable cookieless sessions, except the following configuration setting in web.config file.

The  node can also be used to configure other aspects of the session state management, including the storage medium and the connection strings. However, as far as cookies are concerned, setting the cookieless attribute to true (default is false) is all that you have to do.


Note that session settings are application-wide settings. In other words, all the pages in your site will, or will not, use cookies to store session IDs.

Where is ASP.NET storing the session ID when cookies are not being used? In this case, the session ID is inserted in a particular position within the URL. The figure below shows a snapshot from a real-world site that uses cookieless sessions.

Aa479314.cookieless01(en-us,MSDN.10).gif
Figure 1. MapPoint using cookieless sessions

Imagine you request a page like http://yourserver/folder/default.aspx. As you can see from the MapPoint screenshot, the slash immediately preceding the resource name is expanded to include parentheses with the session ID stuffed inside, as below.



http://yourserver/folder/(session ID here)/default.aspx

The session ID is embedded in the URL and there's no need to persist it anywhere. Well, not exactly.. Consider the following scenario.

DrawBack:

You visit a page and get assigned a session ID. Next, you clear the address bar of the same browser instance, go to another application and work. Then, you retype the URL of the previous application and, guess what, retrieve your session values as you get in.
If you use cookieless sessions, in your second access to the application you're assigned a different session ID and lose all of your previous state. This is a typical side effect of cookieless sessions. To understand why, let's delve deep into the implementation of cookieless sessions.

5) What is webservice?

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.