.NET Framework Interview Questions and Answers (547) - Page 10

If a method is marked as protected internal who can access it?

Access is limited to the current assembly or types derived from the containing class
Why is Global.asax is used for ?

Global.asax is used To implement application & Session level events
What are Jagged Arrarys ?

A jagged array is really an array of arrays.
To create a jagged array, you declare the array of arrays with multiple sets of parentheses or brackets and indicate the size of the jagged array in the first set of brackets (parentheses).
WHat is HttpModule

It's just like a filter. The Modules are called before and after the handler executes.

For example: BeginRequest, AuthenticationRequest event, EndRequest event etc. You may intercept , participate and modify each request.

Modules implement the IHttpMudule interface

Request generelly goes as IIS > Modules > Handlers
What are the major processes that handle a request in Dot Net ?

aspnet_inetinfo.exe is the process that takes care of IIS running.

aspnet_ISAPI.exe is the process that decides which extenstion has to handle the request for requested document.

aspnet_wp.exe is the Process that processes the actual CLR task for Managed Code.
What is the use of System.Web namespace?

System.Web namespace defines a number of namespaces used in the development of .NET web applications, including ASP.NET applications XML web services.
Which casing should be used to declare name of class, as per the Microsoft coding standard?

Pascal Casing. Class name should be declared with using Pascal Casing.
Example: Capitalize the first letter of every word, e.g. MyClassName.
Which casing should be used to declare name of interface, method and Namespace, as per the Microsoft coding standard?

Pascal Casing. Interface name should be declared with using Pascal Casing.
Example: Capitalize the first letter of every word, e.g. MyClassName.
Which casing should be used to declare name of Parameter, as per the Microsoft coding standard?

Camel Casing: Parameter name should be declared using Camel Casing.
Example: Capitalize the first letter of every word except the first word. e.g.myClassName.
How do we store the same named assemblies in GAC? Whether its possible?

Yes it is possible. By different versions of assembly we can store.
Can you please tell me about the typed dataset?

A typed dataset will be having the sehema with them as in an xml format.
It raises the compile time exceptions. Arranging data and giving relationship is possible through this.
Tell me a method to access a COM dll in .NET?

We can create a interop dll of COM to access in .NET
What is side-by-side execution? Can two application one using private assembly and other using Shared assembly be stated as a side-by-side executables?

Side-by-side execution is the ability to run multiple versions of an application or component on the same computer. You can have multiple versions of the common language runtime, and multiple versions of applications and components that use a version of the runtime, on the same computer at the same time. Since versioning is only applied to shared assemblies, and not to private assemblies, two application one using private assembly and one using shared assembly cannot be stated as side-by-side executables
Why string is called Immutable data Type?

The memory representation of string is an Array of Characters, So on re-assigning the new array of Char is formed & the start address is changed. Thus keeping the Old string in Memory for Garbage Collector to be disposed.
How does assembly versioning work?

Each assembly has a version number called the compatibility version. Also each reference to an assembly (from another assembly) includes both the name and version of the referenced assembly.The version number has four numeric parts (e.g. 5.5.2.33). Assemblies with either of the first two parts different are normally viewed as incompatible. If the first two parts are the same, but the third is different, the assemblies are deemed as 'maybe compatible'. If only the fourth part is different, the assemblies are deemed compatible. However, this is just the default guideline - it is the version policy that decides to what extent these rules are enforced. The version policy can be specified via the application configuration file.
How does CAS work?

The CAS security policy revolves around two key concepts - code groups and permissions. Each .NET assembly is a member of a particular code group, and each code group is granted the permissions specified in a named permission set.
For example, using the default security policy, a control downloaded from a web site belongs to the 'Zone - Internet' code group, which adheres to the permissions defined by the 'Internet' named permission set. (Naturally the 'Internet' named permission set represents a very restrictive range of permissions.)
What's the difference between the Debug class and Trace class?

Documentation looks the same. Use Debug class for debug builds, use Trace class for both debug and release builds
What is the difference between the value-type variables and reference-type variables in terms of garbage collection?

The value-type variables are not garbage-collected, they just fall off the stack when they fall out of scope, the reference-type objects are picked up by GC when their references go null.
What's the advantage of using System.Text.StringBuilder over System.String?

StringBuilder is more efficient in the cases, where a lot of manipulation is done to the text. Strings are immutable, so each time it's being operated on, a new instance is created.
Found this useful, bookmark this page to the blog or social networking websites. Page copy protected against web site content infringement by Copyscape

 Interview Questions and Answers Categories