Tuesday, August 31, 2010

Microsoft Interview Questions

1. Consider following code block,
-------------------------------------------------------------
public class A
{
public A()
{
B objB = new B();
Console.WriteLine("A constructor.")
}
}

public class B
{
public B()
{
A objA = new A();
Console.WriteLine("B constructor");
}
}

static void main()
{
A objNewA = new A();
}

---------------------------------------------------
Q: What would be output of the above code when executed? (C# code)

2. What is ASP.NET pipeline?

3. Say you have a milion of record need to be cached for your ASP.NET web application. What would be available options for caching mechanism considering fast access and critical data?

4. In case your answer is "StackOverflow exception happens" for question number 1, then tell us why exception type is "StackOverflow" because as it is seen in the code, that both A and B's constructors are creating new instances of type A/B and new objects are stored in "heap" and not on "Stack". Why it is still then "StackOverflow exception"????

There are couple of more questions too. But I need to memorise it. I would post them as soon as I remember and frame it correctly.

Happy reading !!!!

Cheers,