Libraries
1.Explain Namespace.
Namespaces are logical groupings of names used within a program. It contains collection of classes, delegates, interfaces and there may be multiple namespaces in a single application code, grouped based on the identifiers’ use. The name of any given identifier must appear only once in its namespace.
2. What is CLR?
Common Language Runtime (CLR) is a run-time environment that manages the execution of .NET code and provides services like memory management, debugging, security, etc. The CLR is also known as Virtual Execution System (VES).
3. What is CLI or MSIL?
The CLI is a set of specifications for a runtime environment, including a common type system, base class library, and a machine-independent intermediate code known as the Common Intermediate Language (CIL).
4. Define an Assembly or what is an Assembly?
An assembly is a fundamental unit of deployment, version control, reuse, activation scoping, and security permissions. An assembly is a collection of types and resources that are built to work together and form a logical unit of functionality. An assembly provides the common language runtime with the information it needs to be aware of type implementations. To the runtime, a type does not exist outside the context of an assembly.
5. Explain Assembly and Manifest.
An assembly is a collection of one or more files and one of them (DLL or EXE) contains a special metadata called Assembly Manifest. The manifest is stored as binary data and contains details like versioning requirements for the assembly, the author, security permissions, and list of files forming the assembly. An assembly is created whenever a DLL is built. The manifest can be viewed programmatically by making use of classes from the System.Reflection namespace. The tool Intermediate Language Disassembler (ILDASM) can be used for this purpose. It can be launched from the command prompt or via Start> Run.
6. What is DLL Hell?
DLL hell is the problem that occurs when an installation of a newer application might break or hinder other applications as newer DLLs are copied into the system and the older applications do not support or are not compatible with them. .NET overcomes this problem by supporting multiple versions of an assembly at any given time. This is also called side-by-side component versioning.
7. Enumerate the types of Directives
o @ Page directive o @ Import directive o @ Implements directive o @ Register directive o @ Assembly directive o @ OutputCache directive o @ Reference directive
8. How is the DLL Hell problem solved in .NET?
Assembly versioning allows the application to specify not only the library it needs to run (which was available under Win32), but also the version of the assembly. 
9. What are the ways to deploy an assembly?
An MSI installer, a CAB archive, and XCOPY command. 
10. What is a satellite assembly?
When you write a multilingual or multi-cultural application in .NET, and want to distribute the core application separately from the localized modules, the localized assemblies that modify the core application are called satellite assemblies.     
11. What namespaces are necessary to create a localized application?
System.Globalization and System.Resources.
12. What is the smallest unit of execution in .NET?
an Assembly.
13. When should you call the garbage collector in .NET?
As a good rule, you should not call the garbage collector.However, you   could call the garbage collector when you are done using a large object (or set of objects) to force the garbage collector to dispose of those very large objects from memory.  However, this is usually not a good practice.
14. How do you convert a value-type to a reference-type?
Using Boxing.
15. How do you convert a reference-type to value-type ?
Using Unboxing. 
16. What happens in memory when you Box and Unbox a value-type?
Boxing converts a value-type to a reference-type, thus storing the object on the heap.  Unboxing converts a reference-type to a value-type, thus storing the value on the stack. Name some of the Microsoft Application Blocks. Have you used any? Which ones? A. Examples: Exception Management Logging Data Access User Interface Caching Application Block for .NET Asynchronous Invocation Application Block for .NET Configuration Management Application Block for .NET (there are others) We use Exception and Data Access
17. Describe the advantages of writing a managed code application instead of unmanaged one. What’s involved in certain piece of code being managed?
The advantages include automatic garbage collection, memory management, support for versioning and security. These advantages are provided through .NET FCL and CLR, while with the unmanaged code similar capabilities had to be implemented through third-party libraries or as a part of the application itself.
18. Are COM objects managed or unmanaged?
Since COM objects were written before .NET, apparently they are unmanaged.    
19. Can a COM object talk to a .NET object?
Yes, through Runtime Callable Wrapper (RCW) or PInvoke.    
20. How do you generate an RCW from a COM object?
Use the Type Library Import utility shipped with SDK. tlbimp COMobject.dll /out:.NETobject.dll or reference the COM library from Visual Studio in your project.
21. I can’t import the COM object that I have on my machine. Did you write that object?
You can only import your own objects. If you need to use a COM component from another developer, you should obtain a Primary Interop Assembly (PIA) from whoever authored the original object.
22. How do you call unmanaged methods from your .NET code through PInvoke?
Supply a DllImport attribute. Declare the methods in your.NET code as static extern. Do not implement the methods as they are implemented in your unmanaged code, you’re just providing declarations for method signatures.    
23. Can you retrieve complex data types like structs from the PInvoke calls?
Yes, just make sure you re-declare that struct, so that managed code knows what to do with it.
24. I want to expose my .NET objects to COM objects. Is that possible?
Yes, but few things should be considered first. Classes should implement interfaces explicitly. Managed types must be public. Methods, properties, fields, and events that are exposed to COM must be public. Types must have a public default constructor with no arguments to be activated from COM. Types cannot be abstract.
25. Can you inherit a COM class in a .NET application?
The .NET Framework extends the COM model for reusability by adding implementation inheritance. Managed types can derive directly or indirectly from a COM class; more specifically, they can derive from the runtime callable wrapper generated by the runtime. The derived type can expose all the method and properties of the COM object as well as methods and properties implemented in managed code. The resulting object is partly implemented in managed code and partly implemented in unmanaged code.    
26. Suppose I call a COM object from a .NET applicaiton, but COM object throws an error. What happens on the .NET end?
COM methods report errors by returning HRESULTs; .NET methods report them by throwing exceptions. The runtime handles the transition between the two. Each exception class in the .NET Framework maps to an HRESULT.  
27. What is delay signing?
Delay signing allows you to place a shared assembly in the GAC by signing the assembly with just the public key. This allows the assembly to be signed with the private key at a later stage, when the development process is complete and the component or assembly is ready to be deployed. This process enables developers to work with shared assemblies as if they were strongly named, and it secures the private key of the signature from being accessed at different stages of development.
28. Where are shared assemblies stored?
Global assembly cache(GAC).
29. How can you create a strong name for a .NET assembly?
With the help of Strong Name tool (sn.exe).    
30. Where’s global assembly cache located on the system?
Usually C:\winnt\assembly or C:\windows\assembly.
31. Can you have two files with the same file name in GAC?
Yes, remember that GAC is a very special folder, and while normally you would not be able to place two files with the same name into a Windows folder, GAC differentiates by version number as well, so it’s possible for MyApp.dll and MyApp.dll to co-exist in GAC if the first one is version 1.0.0.0 and the second one is 1.1.0.0.     So let’s say I have an application that uses MyApp.dll assembly, version 1.0.0.0. There is a security bug in that assembly, and I publish the patch, issuing it under name MyApp.dll 1.1.0.0.How do I tell the client applications that are already installed to start using this new MyApp.dll? Use publisher policy. To configure a publisher policy, use the publisher policy configuration file, which uses a format similar app .config file. But unlike the app .config file, a publisher policy file needs to be compiled into an assembly and placed in the GAC.
32. How can you debug failed assembly binds?
Use the Assembly Binding Log Viewer (fuslogvw.exe) to find out the paths searched.
33. What’s a strong name?
A strong name includes the name of the assembly, version number, culture identity, and a public key token.
34. What’s the difference between private and shared assembly?
Private assembly is used inside an application only and does not have to be identified by a strong name. Shared assembly can be used by multiple applications and has to have a strong name.