Searching...
Sunday, 24 January 2016

Adv .Net interview Questions and Answers


1. What is .NET Framework?
.NET Framework may be a complete surroundings that permits developers to develop, run, and deploy the subsequent
applications:


    1. Console applications
    2. Windows Forms applications
    3. Windows Presentation Foundation (WPF) applications
    4. Web applications (ASP.NET applications)
    5. Webervices
    6. Windows services
    7. Service-oriented applications victimisation Windows Communication Foundation (WCF)
    8. advancement-enabled applications victimisation Windows Workflow Foundation (WF)


.NET Framework conjointly permits a developer to make sharable parts to be utilized in distributed computing
architecture. web Framework supports the object-oriented programming model for multiple languages, such as
Visual Basic, Visual C#, and Visual C++. .NET Framework supports multiple programming languages in a very
manner that permits language ability. this means that every language will use the code written in some
alternative language.

interview-questions-dotnet


2. What area unit the most parts of .NET Framework?
.NET Framework provides monumental blessings to software package developers as compared to the benefits
provided by alternative platforms. Microsoft has united varied trendy in addition as existing technologies of software package
development in .NET Framework. These technologies area unit utilized by developers to develop extremely economical applications for trendy in addition as future business desires. the subsequent area unit the key parts of .NET
Framework:


    1. .NET Framework category Library
    2. Common Language Runtime
    3. Dynamic Language Runtimes (DLR)
    4. Application Domains
    5. Runtime Host
    6. Common sort System
    7. information and Self-Describing parts
    8.  Cross-Language ability
    9.  .NET Framework Security
    10.  Profiling
    11.  Side-by-Side Execution 




3. List the new options side in .NET Framework four.0.

the subsequent area unit the new options of .NET Framework four.0:


    1.   Improved Application Compatibility and preparation Support
    2. Dynamic Language Runtime
    3. Managed Extensibility Framework
    4. Parallel Programming framework
    5. Improved Security Model
    6. Networking enhancements
    7. Improved Core ASP.NET Services
    8.  enhancements in WPF four
    9. Improved Entity Framework (EF)
    10. Integration between WCF and WF


4. what's associate IL?
Intermediate Language is additionally referred to as MSIL (Microsoft Intermediate Language) or CIL (Common Intermediate Language). All .NET ASCII text file is compiled to IL. IL is then born-again to code at the purpose wherever the software package is put in, or at run-time by a Just-In-Time (JIT)                   compiler.

5. what's Manifest?
Assembly information is keep in Manifest. Manifest contains all the information required to try and do the subsequent things

    1. Version of assembly.
    2. Security identity.
    3. Scope of the assembly.
    4. Resolve references to resources and categories.

 The assembly manifest may be keep in a very letter of the alphabet file either (an .exe or) .dll with Microsoft intermediate language (MSIL code with Microsoft intermediate language (MSIL) code or in a  very complete letter of the alphabet file, that contains solely assembly manifest data.

6. What area unit code contracts?

Code contracts assist you to specific the code assumptions and statements stating the behavior of your code in a very language-neutral method. The contracts area unit enclosed within the style of pre-conditions, post-conditions and object- invariants. The contracts assist you to improve-testing by sanctioning run-time checking, static contract verification, and documentation generation.

The System.Diagnostics.Contracts namespace contains static categories that area unit wont to            categorical contracts in your code.


7. Name the categories that area unit introduced within the System.Numerics namespace.
the subsequent 2 new categories area unit introduced within the System.Numerics namespace:

  1. BigInteger - Refers to a non-primitive integral sort, that is employed to carry a price of any size. It has no lower and higher limit, creating it doable for you to perform arithmetic calculations with terribly giant numbers, even with the numbers that cannot hold by double or long.

      2.  Advanced - Represents advanced numbers and permits completely different arithmetic                   operations with advanced numbers. variety described within the kind a + metal, wherever a is that the real half, and b is that the imaginary part of a complex number, may be a complex quantity.

8. what's managed extensibility framework?
Managed extensibility framework (MEF) may be a new library that's introduced as a section of .NET 4.0 and Silverlight four. It helps in extending your application by providing larger recycle of      applications and parts.
MEF provides the simplest way for host application to consume external extensions with none configuration requirement.

9. justify memory-mapped files.
Memory-mapped files (MMFs) enable you map the content of a file to the logical address of associate application.
These files change the multiple processes running on an equivalent machine to share information with one another. The MemoryMappedFile.CreateFromFile() technique is employed to get a MemoryMappedFile object that represents a persisted memory-mapped file from a file on disk.
These files area unit enclosed within the System.IO.MemoryMappedFiles namespace. This namespace contains four
categories and 3 enumerations to assist you access and secure your file mappings.

10. what's Common sort System (CTS)?
CTS is that the part of CLR through that .NET Framework provides support for multiple                     languages as a result of it contains a kind system that's common across all the languages. 2 CTS-         compliant languages do not need sort conversion once career the code written in one language from at intervals the code written in another language. CTS offer a base set of knowledge sorts for all the languages supported by.NET Framework.
this implies that the scale of whole number and long variables is same across all .NET-compliant         programming languages. However, every language uses aliases for the bottom information sorts provided by CTS. for instance, CTS uses the information sort system. int32 to represent a four computer memory unit whole number value; but, Visual Basic uses the alias whole number for the same; whereas, C# uses the alias int. this is often in hot water the sake of clarity and ease.

11. provides a temporary introduction on side-by-side execution. will 2 applications, one                      victimisation non-public assembly and the opposite victimisation the shared assembly be expressed as side-by-side executables?

Side-by-side execution permits you to run multiple versions of associate application or part and CLR on the same laptop at an equivalent time. As versioning is applicable solely to shared assemblies and to not non-public assemblies, 2 applications, one employing a non-public assembly and alternative employing a shared assembly, can't be expressed as side-by-side executables.


12. that technique does one use to enforce garbage pickup in .NET?
The System.GC.Collect() technique.

13. State the variations between the Dispose() and Finalize().
CLR uses the Dispose and terminate ways to perform garbage pickup of run-time objects of .NET applications.
The terminate technique is named mechanically by the runtime. CLR includes a dustman (GC), which
sporadically checks for objects in heap that are not any longer documented by any object or program. It calls the terminate technique to free the memory utilized by such objects. The Dispose technique is named by the technologist.
Dispose is associateother technique to unleash the memory utilized by an object. The Dispose technique must be expressly referred to as in code to dereference associate object from the heap. The Dispose technique may be invoked solely by the categories that implement the IDisposable interface.

14. what's code access security (CAS)?
Code access security (CAS) is a component of the .NET security model that stops unauthorized access of resources and operations, and restricts the code to perform explicit tasks.

15. Differentiate between managed and unmanaged code?
Managed code is that the code that's dead directly by the CLR rather than the software. The code
compiler initial compiles the managed code to intermediate language (IL) code, conjointly referred to as as MSIL code. This code does not rely on machine configurations and may be dead on completely different machines.
Unmanaged code is that the code that's dead directly by the software outside the CLR surroundings. It is directly compiled to native code that depends on the machine configuration.
within the managed code, since the execution of the code is ruled by CLR, the runtime provides completely different services, like garbage pickup, sort checking, exception handling, and security support.
 These services facilitate offer uniformity in platform and language-independent behavior of                managed code applications. In the unmanaged code, the allocation of memory, sort safety, and           security is needed to be taken care of by the developer. If the unmanaged code isn't properly               handled, it's going to end in memory leak. samples of unmanaged code area unit ActiveX parts and Win32 arthropod genus that execute on the far side the scope of native CLR.

 16. What ar tuples?
Tuple could be a fixed-size assortment that may have parts of either same or completely different information varieties. almost like arrays, auser should need to specify the dimensions of a tuple at the time of declaration. Tuples ar allowed to carry up from one to eight parts and if there ar over eight parts, then the eighth component is outlined as another tuple. Tuples is specific as parameter or come back sort of a way.

17. however are you able to input and turn-off CAS?
you'll use the Code Access Security Tool (Caspol.exe) to show security on and off.
to show off security, kind the subsequent command at the command prompt:
caspol -security off
to show on security, kind the subsequent command at the command prompt:
caspol -security on
In the .NET Framework four.0, for victimisation Caspol.exe, you initially have to be compelled to set the <LegacyCasPolicy> component to true.

18. what's garbage collection? justify the distinction between garbage collections in .NET 4.0                  and earlier versions.
pickup prevents memory leaks throughout execution of programs. refuse collector could be a               low-priority method that manages the allocation and deallocation of memory for your                           application. It checks for the unreferenced variables and objects. If gigacycle finds any object that's not utilized by the applying, it frees up the memory from that object.
gigacycle has modified slightly with the introduction of .NET 4.0. In .NET 4.0, the GC.Collect()         methodology contains the following full methods:
GC.Collect(int)
GC.Collect(int, GCCollectionMode)
Another new feature introduced in .NET is to send word you once the gigacycle.Collect()                      methodology is invoked and completed with success by victimisation completely different ways.The .NET 4.0 supports a replacement background garbage assortment that replaces the coincidental pickup employed in earlier versions. This coincidental gigacycle allocates memory whereas running and uses current section (which is sixteen MB on a workstation) for that. After that, all threads ar suspended. just in case of background gigacycle, a separate temporary gigacycle - gen0 and gen1 is started, whereas the complete gigacycle - gen0, 1, and a pair of - is already running.

19. however will CAS works?

There ar 2 key ideas of CAS security policy- code teams and permissions. A code cluster contains
assemblies in it in a very manner that every .NET assembly is said to a specific code cluster and a few
permissions ar granted to every code cluster. as an example, victimisation the default security policy, a control
downloaded from an internet website belongs to the Zone, web code cluster, that adheres to the permissions
outlined by the named permission set. (Normally, the named permission set represents a really restrictive vary of
permissions.)
Assembly execution involves the subsequent steps:
 1. Evidences ar gathered regarding assembly.
 2. reckoning on the gathered evidences, the assembly is appointed to a code cluster.
 3. Security rights ar allotted to the assembly, reckoning on the code cluster.
 4. Assembly runs as per the rights appointed to that.

20. what's distinction between NameSpace and Assembly?
Following ar the variations between namespace and assembly:
 1. Assembly is physical grouping of logical units, Namespace, logically teams categories.
 2. Namespace will span multiple assembly.

21. Mention the execution method for managed code.
a bit of managed code is dead as follows:
 1. selecting a language compiler
 2.Compiling the code to MSIL
 3.Compiling MSIL to native code
 4.Executing the code.

22. Is there the way to suppress the terminate method within the rubbish collector forcibly in .NET?
Use the GC.SuppressFinalize() methodology to suppress the terminate method within the rubbish collector forcibly in
.NET.

23. however are you able to instantiate a tuple?

the subsequent ar 2 ways in which to instantiate a tuple:
 1.Using the new operator. as an example,
Tuple&lt;String, int&gt; t = new Tuple&lt;String, int&gt; ("Hellow", 2);
 2. victimisation the produce plant methodology on the market within the Tuple category. as an example,
Tuple&lt;int, int, int&gt; t = Tuple.Create&lt;int, int, int&gt; (2, 4, 5);

24. that is that the root namespace for basic varieties in .NET Framework?
System.Object is that the root namespace for basic varieties in .NET Framework.

25. What ar the enhancements created in CAS in .NET 4.0?
The CAS mechanism in .NET is employed to regulate and tack together the flexibility of managed code. Earlier, as this
policy was applicable for under native applications, the safety guarantee was restricted. Therefore, developers
accustomed seek for alternating solutions, like in operation system-level solutions. This drawback was solved  in
.NET Framework four by turning off the machine-wide security. The shared and hosted internet applications will currently
run a lot of firmly. the safety policy in .NET Framework four has been simplified victimisation the transparency model.
This model permits you to run the online applications while not regarding regarding the CAS policies.
As a results of security policy changes in .NET Framework four.0, you'll encounter compilation warnings and
runtime exceptions, if your attempt to use the obsolete CAS policy varieties and members either implicitly or expressly.
However, you'll avoid the warnings and errors by victimisation the <NetFx40_LegacySecurityPolicy> configuration
component within the runtime settings schema to choose into the obsolete CAS policy behavior.

0 comments:

Post a Comment

 
Back to top!