Interview Questions on .Net Framework 6

By | May 12, 2014

What are the Main Features of .NET platform? Features of .NET Platform are :- Common Language Runtime Explains the features and benefits of the common language runtime, a run-time environment that manages the execution of code and provides services that simplify the development process. Assemblies Defines the concept of assemblies, which are collections of types and resources that form logical units of functionality. Assemblies are the fundamental units of deployment, version control, reuse, activation scoping, and security permissions. Application Domains Explains how to use application domains to provide isolation between applications. Runtime Hosts Describes the runtime hosts supported by the .NET Framework, including ASP.NET, Internet Explorer, and shell executables. Common Type System Identifies the types supported by the common language runtime. Metadata and Self-Describing Components Explains how the .NET Framework simplifies component interoperation by allowing compilers to emit additional declarative information, or metadata, into all modules and assemblies. Cross-Language Interoperability Explains how managed objects created in different programming languages can interact with one another. .NET Framework Security Describes mechanisms for protecting resources and code from unauthorized code and unauthorized users. .NET Framework Class Library Introduces the library of types provided by the .NET Framework, which expedites and optimizes the development process and gives you access to system functionality.

What is the use of JIT ? JIT (Just – In – Time) is a compiler which converts MSIL code to Native Code (ie.. CPU-specific code that runs on the same computer architecture). Because the common language runtime supplies a JIT compiler for each supported CPU architecture, developers can write a set of MSIL that can be JIT-compiled and run on computers with different architectures. However, your managed code will run only on a specific operating system if it calls platform-specific native APIs, or a platform-specific class library. JIT compilation takes into account the fact that some code might never get called during execution. Rather than using time and memory to convert all the MSIL in a portable executable (PE) file to native code, it converts the MSIL as needed during execution and stores the resulting native code so that it is accessible for subsequent calls. The loader creates and attaches a stub to each of a type’s methods when the type is loaded. On the initial call to the method, the stub passes control to the JIT compiler, which converts the MSIL for that method into native code and modifies the stub to direct execution to the location of the native code. Subsequent calls of the JIT-compiled method proceed directly to the native code that was previously generated, reducing the time it takes to JIT-compile and run the code.

What meant of assembly & global assembly cache (gac) & Meta data. Assembly :– An assembly is the primary building block of a .NET based application. It is a collection of functionality that is built, versioned, and deployed as a single implementation unit (as one or more files). All managed types and resources are marked either as accessible only within their implementation unit, or as accessible by code outside that unit. It overcomes the problem of ‘dll Hell’.The .NET Framework uses assemblies as the fundamental unit for several purposes: 

  •  Security 
  •  Type Identity 
  •  Reference Scope 
  • Versioning 
  •  Deployment

Global Assembly Cache :– Assemblies can be shared among multiple applications on the machine by registering them in global Assembly cache(GAC). GAC is a machine wide a local cache of assemblies maintained by the .NET Framework. We can register the assembly to global assembly cache by using gacutil command. We can Navigate to the GAC directory, C:\winnt\Assembly in explore. In the tools menu select the cache properties; in the windows displayed you can set the memory limit in MB used by the GAC MetaData :–Assemblies have Manifests. This Manifest contains Metadata information of the Module/Assembly as well as it contains detailed Metadata of other assemblies/modules references (exported). It’s the Assembly Manifest which differentiates between an Assembly and a Module.

What are the mobile devices supported by .net platform The Microsoft .NET Compact Framework is designed to run on mobile devices such as mobile phones, Personal Digital Assistants (PDAs), and embedded devices. The easiest way to develop and test a Smart Device Application is to use an emulator. These devices are divided into two main divisions: 1) Those that are directly supported by .NET (Pocket PCs, i-Mode phones, and WAP devices) 2) Those that are not (Palm OS and J2ME-powered devices).

What is GUID , why we use it and where? GUID :– GUID is Short form of Globally Unique Identifier, a unique 128-bit number that is produced by the Windows OS or by some Windows applications to identify a particular component, application, file, database entry, and/or user. For instance, a Web site may generate a GUID and assign it to a user’s browser to record and track the session. A GUID is also used in a Windows registry to identify COM DLLs. Knowing where to look in the registry and having the correct GUID yields a lot information about a COM object (i.e., information in the type library, its physical location, etc.). Windows also identifies user accounts by a username (computer/domain and username) and assigns it a GUID. Some database administrators even will use GUIDs as primary key values in databases. GUIDs can be created in a number of ways, but usually they are a combination of a few unique settings based on specific point in time (e.g., an IP address, network MAC address, clock date/time, etc.).

Describe the difference between inline and code behind – which is best in a loosely coupled solution ASP.NET supports two modes of page development: Page logic code that is written inside runat=”server”> blocks within an .aspx file and dynamically compiled the first time the page is requested on the server. Page logic code that is written within an external class that is compiled prior to deployment on a server and linked “”behind”” the .aspx file at run time.

Whats MSIL, and why should my developers need an appreciation of it if at all? When compiling the source code to managed code, the compiler translates the source into Microsoft intermediate language (MSIL). This is a CPU-independent set of instructions that can efficiently be converted to native code. Microsoft intermediate language (MSIL) is a translation used as the output of a number of compilers. It is the input to a just-in-time (JIT) compiler. The Common Language Runtime includes a JIT compiler for the conversion of MSIL to native code. Before Microsoft Intermediate Language (MSIL) can be executed it, must be converted by the .NET Framework just-in-time (JIT) compiler to native code. This is CPU-specific code that runs on the same computer architecture as the JIT compiler. Rather than using time and memory to convert all of the MSIL in a portable executable (PE) file to native code. It converts the MSIL as needed whilst executing, then caches the resulting native code so its accessible for any subsequent calls.

What is a formatter?   A formatter is an object that is responsible for encoding and serializing data into messages on one end, and deserializing  and decoding messages into data on the other end.

Leave a Reply