Advanced C# Interview Questions and Answers Part 1

1.) How can we sort the elements of the array in descending order ?                         
For This,First we call the Sort (method and then call Reverse() Methods.

2.) Can we store multiple data types in System.Array ?                                                   

3.) What is the difference between the System.Array.CopyTo() and System.Array.Clone() ?
System.Array.CopyTo()-->It require a destination array to be existed before and it must be capable to hold all the elements in the source array from the index that is specified to copy from the source array.
System.Array.Clone()-->It does not require the destination array to be existed as it creates a new one from scratch.
Note-These both are used as a shallow copy.
4.) What is difference between string and stringBuilder ?                                              
StringBuilder is more efficient than string.
String :- It is Immutable and resides within System Namespace.
StringBuilder:-It is mutable and resides System.Text Namespace.
More Details...
5.) What is class SortedList Underneath?                                                                             
It is a Hash Table.

6.) What is the .NET datatype that allow the retrieval of data by a unique key ?
Hash Table

7.) Is finally block get executed if the exception is not occured ?                              

8.) Can multiple catch () block get executed if the exception is not occured ?      
No,Once the proper catch code fires off ,the control is transferred to the finally block(if any),and the whatever follows the finally block.

9.) What is multicast delegate ?                                                                                                 
The Multicast delegate is a delegate that points to and eventually fires off several methods.

10.) What are the ways to deploy an assembly ?                                                                 
  • An MSI Installer
  • A CAB archive
  • XCopy command
11.) What is the DLL Hell Problem Solved in .NET ?                                                         
In .NET, Assembly versioning allows the application to specify not only the library it needs to run ,but also the version of the assembly.

12.) What is a Satellite assembly ?                                                                                          
When we write the code, a  multicultural or multilingual application in .NET and want to distribute the core application separately from the localized modules,the localized assemblies that modify the core application ,that is known  as Satellite assembly. 


Powered by Blogger.