Advanced c# and .NET Interview Questions and Answers Part 7

By // No comments:
1.) How Garbage collector (GC) works in .NET ?                                                                 
In .NET,this class method influence when an object is garbage collected and when resources allocated by an object are released. Properties in this class provide information about the total amount of memory available in the system and the generation, or age category, of memory allocated to an object. Periodically, the garbage collector performs garbage collection to reclaim memory allocated to objects for which there are no valid references. Garbage collection happens automatically when a request for memory cannot be satisfied using available free memory. An application can force garbage collection using the Collect method.
There are following steps in Garbage collection as given below. 
  • The garbage collector searches for managed objects that are referenced in managed code. 
  • The garbage collector attempts to finalize objects that are not referenced. 
  • The garbage collector frees objects that are not referenced and reclaims their memory. 

Advanced C# and .NET Interview Questions and Answers Part 5

By // No comments:
1.) How to find Method of assembly without using ILDASM ?                                       
Use Reflection concept.

2.) What is Garbage collection in.NET and its uses ?                                                        
The Process of transitively tracing through all points to actively used objects in order to locate all objects that can be referenced and then arranging to reuse any heap memory that is in use to reduce the working space needed for the heap.

3.) What is Application Domain ?                                                                                             
The Application Domain provide a unit of isolation for the common language runtime.They created and run inside a process.They are usually created by a runtime host ,which is an application  that are responsible for loading the runtime into a process and executing user code within an application domain runtime host.It creates a process and a default application domain and runs managed codes inside it.
Runtime host are  ,internet explorer and winow shell. 

Advanced c# and .NET Interview Questions and Answers Part 6

By // No comments:
1.) What is Serialization in .NET ?                                                                                            
A Serialization is the process of the converting an object into a stream of bytes and Deserialization is the opposite process of creating an object from a stream of bytes . The Serialization and Deserialization is mostly used  to transport objects (ex. during remoting applications).
2.) What are the types of  Serialization in .NET ?                                                                
There are two types of serialization used in .NET as given below:-
1.) Binary Serialization :- This serialization concepts preserves type fidelity that is used for preserving the state of an object between different invocations of an application.We can share an object between different application by serializing it to the clipboard.We can also serialize an object to a system,memory,disk ,over Network and others. 
2.) XML Serialization :- This XML Serialization concepts does not preserves type fidelity.
You already know,XML is an open standard and platform independent language. It is used  for sharing the data across the web .XML is technology that is used to share the the data with any application without any restriction.
The Microsoft uses XMLSerialization for the web services and uses  SOAPFormatter/  BinaryFormatter for remoting application.

Advanced C# interview Questions and Answers Part 4

By // No comments:
1.) How do we inherit from a class in c# ?                                                                               
In c#, we use a colon (:) and then the name of the base class.

2.) Does c# support multiple inheritance  ?                                                                          
No, we use interface for this purpose.

3.) Are private class -label variables inherited ?                                                                
Yes, but it is not accessible.we generally know that they are inherited but not accessible.

4.) What is the implicit name of the parameter that gets passed into class "set" method ?   
Value and it's datatype(it depends whatever variable we are changing).

Advanced C# Interview Questions and Answers Part 3

By // 1 comment:
1.) Where is the output of TextWriterTraceListener redirected  ?                           
The output of TextWriteTraceListener Redirected to the console or a text file depending on the parameter passed to the constructor.

2.) Can you change the value of a variable while debugging a c# application ?   
Yes, if you are debugging via visual studio.NET.

3.) What is the service layer in 3 Tier .NET application  ?                                            
  • Presentation Layer
  • Business Access Layer(BAL)
  • Data Access Layer (DAL)

4.) What is the role of the DataReader class in ADO.NET Connections  ?             
The DataReader class returns a read-only dataset from the datasource when the command is executed.

Advanced c# Interview Questions and Answers Part 2

By // No comments:
1.)  What Namespaces are used  to create a localized application ?                          
  • System.Globalization
  • System.Resources
2.)  What are the different type of comment is used in .NET ?                                      
  • //             - -->  Signal Line
  • /* */        - -->  MultiLine
  • ///           --->  XML Documentation Comments
3.)  is XML is case sensitive ?                                                                                                       
Ex. Here <EMPLOYEE> and <employee> are different element.

4.)  What is the different between <c> and <code> XML documentation code?  
It is example of single line code and multi-line code.

Advanced C# Interview Questions and Answers Part 1

By // 1 comment:
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...
Powered by Blogger.