.net Interview Questions
.net Interview questions for SE/SEE/TL level.
brief about .net Interview Questions section
This section provides the latest interview questions on dotnet. We update
every section regularly. If have any .net interview question, please share
with us. We will try to publish this on the site with answer.
Looking for .net Interview Question. Here is the list:
- What is
serialization
Serialization is a process of saving the state of an object in persist format by
converting it into a stream of bytes.
-
Types of serialization
The kind of serialization is done by the SOAP and Binary Serialization is
known as deep serialization. As the object contains a reference to other objects
are also serialized.
- What is difference between String and StringBuilder?
Strings in .net are immutable.
Whenever you try to add a new string value in an existing string, this has to create a new string and release the old string. The same operation is repeated every time a new sting concatenate in existing string. So if you have to do lots of concatenation within string, avoid using string datatype.
The alternative is StringBuilder, which is best in above scenarios, as it just adds new string in the existing string and does not creates a new string every time. So if you have to perform lots of concatenation in existing string use StringBuilder instead of string this will have a very good impact on the performance of the application.
- Is string a value type or a reference type?
String is a reference type but this behaves like a value type.
- Lets say you have a class, which needs to use across the applications on your server. How you will handle this?
I will create a separate assembly of this class with the strong name and put in GAC to make it a shared assembly.
- What is GAC?
GAC stands for Global Assembly Cache. This is a common folder on machine with the name "assembly" under the WinDirectory/assembly. Assemblies in this folder can be used by n number of applications and this folder can have multiple assemblies with the same name with the different version.