Thursday, January 3, 2008

interview questions 2

21 What is the advantage of using System.Text.StringBuilder over System.String?
StringBuilder is more efficient in the cases, where a lot of manipulation is done to the text.
Strings are immutable, so each time it is being operated on, a new instance is created.

22 What is the .NET datatype that allows the retrieval of data by a unique key?
HashTable. What is class SortedList underneath?

23 What is an interface class?
It is an abstract class with public abstract methods all of which must be implemented in the
inherited classes.

24 What is an abstract class?
A class that cannot be instantiated. A concept in C++ known as pure virtual method. A class that must be inherited and have the methods over-ridden. Essentially, it is a blueprint for a class
without any implementation.

25 What is a satellite assembly?
When you write a multilingual or multi-cultural application in .NET, and want to distribute the
core application separately from the localized modules, the localized assemblies that modify the
core application are called satellite assemblies.

26 What is a pre-requisite for connection pooling?
Multiple processes must agree that they will share the same connection, where every parameter is the same,

27 What is a multicast delegate?
It is a delegate that points to and eventually fires off several methods.

28 What is a delegate?
A delegate object encapsulates a reference to a method. In C++ they were referred to as
function pointers.

29 What does the This window show in the debugger?
It points to the object that is pointed to by this reference. Object s instance data is shown.

30 What does the parameter Initial Catalog define inside Connection String?
The database name to connect to.

31 What does the keyword virtual mean in the method definition?
The method can be over-ridden.

32 What does Dispose method do with the connection object?
Deletes it from the memory.

33 What does assert() do?
In debug compilation, assert takes in a Boolean condition as a parameter, and shows the error
dialog if the condition is false. The program proceeds without any interruption if the condition is
true.

34 What debugging tools come with the .NET SDK?
CorDBG - command-line debugger, and DbgCLR - graphic debugger. Visual Studio .NET uses
the DbgCLR. To use CorDbg, you must compile the original C# file using the /debug switch.

35 What connections does Microsoft SQL Server support?
Windows Authentication (via Active Directory) and SQL Server authentication (via Microsoft SQL Server username and passwords).

36 What are three test cases you should go through in unit testing?
Positive test cases (correct data, correct output), negative test cases (broken or missing data,
proper handling), exception test cases (exceptions are thrown and caught properly).

37 What are the ways to deploy an assembly?
An MSI installer, a CAB archive, and XCOPY command.

38 What are advantages and disadvantages of Microsoft-provided data provider classes in
ADO.NET?
SQLServer.NET data provider is high-speed and robust, but requires SQL Server license
purchased from Microsoft. OLE-DB.NET is universal for accessing other sources, like Oracle,
DB2, Microsoft Access and Informix, but it is a .NET layer on top of OLE layer, so not the fastest thing in the world. ODBC.NET is a deprecated layer provided for backward compatibility to ODBC engines.

39 Is XML case-sensitive?
Yes, so and are different elements.

40 If a base class has a bunch of overloaded constructors, and an inherited class has another
bunch of overloaded constructors, can you enforce a call from an inherited constructor to an arbitrary base constructor?
Yes, just place a colon, and then keyword base (parameter list to invoke the appropriate
constructor) in the overloaded constructor definition inside the inherited class.

0 comments: