Microsoft .NET Interview Question Answers collected from various sources.Please leave comments and your suggestions
Difference between String and Stringbuilder reference types?
System.string provides a set of members for working with text.Like search,replace,concratinate etc.. and strings of type system.string are immutable(that means any change to string causes a runtime to create a new string and abandon old one).
System.stringbuilder is used to dynamic strings which are mutable also.these string classes also overrides operators from System.object.
What is the difference between debug build and release build?
The biggest difference between these is that:
In a debug build the complete symbolic debug information is emitted to help while debugging applications and also the code optimization is not taken into account.
While in release build the symbolic debug info is not emitted and the code execution is optimized.
Also, because the symbolic info is not emitted in a release build, the size of the final executable is lesser than a debug executable.
One can expect to see funny errors in release builds due to compiler optimizations or differences in memory layout or initialization. These are ususally referred to as Release - Only bugs :)
In terms of execution speed, a release executable will execute faster for sure, but not always will this different be significant.
Can we force garbage collector to run?
System.GC.Collect() forces garbage collector to run.This is not recommended but can be used if situation arises.
What are the various ways of hosting a WCF service?
There are three major ways to host a WCF service:-
1. Self hosting the service in his own application domain. This we have already covered
in the first section. The service comes in to existence when you create the object of
ServiceHost class and the service closes when you call the Close of the ServiceHost
class.
2. Host in application domain or process provided by IIS Server.
3. Host in Application domain and process provided by WAS (Windows Activation
Service) Server.
What are Dead letter queues?
The main use of queue is that you do not need the client and the server running at one
time. So it’s possible that a message will lie in queue for long time until the server or client
picks it up. But there are scenarios where a message is of no use after a certain time. So
these kinds of messages if not delivered within that time span it should not be sent to the
user.
Below is the config snippet which defines for how much time the message should be in
queue.
Difference between String and Stringbuilder reference types?
System.string provides a set of members for working with text.Like search,replace,concratinate etc.. and strings of type system.string are immutable(that means any change to string causes a runtime to create a new string and abandon old one).
System.stringbuilder is used to dynamic strings which are mutable also.these string classes also overrides operators from System.object.
What is the difference between debug build and release build?
The biggest difference between these is that:
In a debug build the complete symbolic debug information is emitted to help while debugging applications and also the code optimization is not taken into account.
While in release build the symbolic debug info is not emitted and the code execution is optimized.
Also, because the symbolic info is not emitted in a release build, the size of the final executable is lesser than a debug executable.
One can expect to see funny errors in release builds due to compiler optimizations or differences in memory layout or initialization. These are ususally referred to as Release - Only bugs :)
In terms of execution speed, a release executable will execute faster for sure, but not always will this different be significant.
Can we force garbage collector to run?
System.GC.Collect() forces garbage collector to run.This is not recommended but can be used if situation arises.
What are the various ways of hosting a WCF service?
There are three major ways to host a WCF service:-
1. Self hosting the service in his own application domain. This we have already covered
in the first section. The service comes in to existence when you create the object of
ServiceHost class and the service closes when you call the Close of the ServiceHost
class.
2. Host in application domain or process provided by IIS Server.
3. Host in Application domain and process provided by WAS (Windows Activation
Service) Server.
What are Dead letter queues?
The main use of queue is that you do not need the client and the server running at one
time. So it’s possible that a message will lie in queue for long time until the server or client
picks it up. But there are scenarios where a message is of no use after a certain time. So
these kinds of messages if not delivered within that time span it should not be sent to the
user.
Below is the config snippet which defines for how much time the message should be in
queue.
Related Posts
No comments :