KyaPoocha.com

Huge Collection of Interview Questions


Archive for April, 2008

What’s a delegate ? 

A delegate object encapsulates a reference to a method. In C++ they were referred to as function pointers.  Read more »

What’s the C# equivalent of C++ catch (…), which was a catch-all statement for any possible exception ? 

A catch block that catches the exception of type System.Exception. You can also omit the parameter data type in this case and just write catch {}.  Read more »

What’s the difference between the System.Array.CopyTo() and System.Array.Clone() ? 

The first one performs a deep copy of the array, the second one is shallow.  Read more »

What’s 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’s being operated on, a new... Read more »

What’s the difference between System.String and System.StringBuilder classes ? 

System.String is immutable; System.StringBuilder was designed with the purpose of having a mutable string where a variety of operations can be performed.  Read more »

What’s the difference between an interface and abstract class ? 

In the interface all methods must be abstract; in the abstract class some methods can be concrete. In the interface no accessibility modifiers are allowed, which... Read more »

Why can’t you specify the accessibility modifier for methods inside the interface ? 

They all must be public. Therefore, to prevent you from getting the false impression that you have any freedom of choice, you are not allowed to specify any accessibility,... Read more »

What’s an interface class ? 

It’s an abstract class with public abstract methods all of which must be implemented in the inherited classes.  Read more »

What’s 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,... Read more »

How’s method overriding different from overloading ? 

When overriding, you change the method behavior for a derived class. Overloading simply involves having a method with the same name within the class.  Read more »

What’s the top .NET class that everything is derived from ? 

System.Object.  Read more »

C# provides a default constructor for me. I write a constructor that takes a string as a parameter, but want to keep the no parameter one. How many constructors should I write? 

Two. Once you write at least one constructor, C# cancels the freebie constructor, and now you have to write one yourself, even if there’s no implementation in... Read more »

What’s the implicit name of the parameter that gets passed into the class’ set method ? 

Value, and its datatype depends on whatever variable we’re changing.  Read more »

How many classes can a single .NET DLL contain ? 

It can contain many classes.  Read more »

True or False: To test a Web service you must create a windows application or Web application to consume this service ? 

False, the webservice comes with a test page and it provides HTTP-GET method to test.  Read more »

Page 3 of 15«12345»...Last »