Technical Tips, Tricks and Articles

Interview Questions (.NET)

leave a comment »

  1. What’s the difference of using System.Text.StringBuilder over System.String?
    Answer: System.String is immutable. System.StringBuilder was designed with the
    purpose of having a mutable string where a variety of operations can be performed.

  2. What’s the difference between the System.Array.CopyTo() and System.Array.Clone()?
    The Clone() method returns a new array (a shallow copy) object containing all the elements in the original array. The CopyTo() method copies the elements
    into another existing array. Both perform a shallow copy. A shallow copy means the contents (each array element) contains references to the same object as the elements in the original array. A deep copy (which neither of these methods performs) would create a new instance of each element’s object, resulting in a different, yet identical object.

  3. How can you sort the elements of the array in descending order?
    By calling Sort () and then Reverse () methods.
  4. What’s the .NET collection class that allows an element to be accessed using a unique key?

Written by ..alee

December 19, 2006 at 3:54 pm

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: