.net interview questions with answers 2010 for freshers

Advertisements


1. Differences between DLL and EXE?
.exe
1.These are outbound file.
2.Only one .exe file exists per application.
3. .Exe cannot be shared with other applications.

.dll
1.These are inbund file .
2.Many .dll files may exists in one application.
3. .dll can be shared with other applications.

2. Can an assembly have EXE?
Assembly is nothing but single deployment and self describing. Yes Assembly can have dll/exe.

3. Can a DLL be changed to an EXE?
In short, the answer is no. Unlike an EXE file which contains a single entry point (typically WinMain() or simply main() depending on the type of exe file), a DLL file is a library of functions intended to be linked into a running application. A DLL file can have a nearly infinite (it’s based on file size and such) possible entry points.

4. Compare & contrast rich client (smart clients or Windows-based) & browser-based Web application
When implementing a client/server architecture you need to determine if it will be the client or the server that handles the bulk of the workload. By client, we mean the application that runs on a PC or workstation and relies on a server to perform some operations.
In last week’s Did You Know article we discussed the differences between thick clients (also called fat clients) and thin clients in terms of hardware. The terms thick client and thin client, however, have double meanings, as thick and thin also are used to describe the applications or software. In this article we take a look at the terms thick and thin as related to client application software.

5. Compare Client server application with n-Tier application
All web applications are N-Tier architectures. An N-Tier architecture is really a Client-Server architecture combined with the Layered architecture. The reason why I combine Client-Server and N-Tier here is because they are very much related.
A Client-Server system is one in which the server performs some kind of service that is used by many clients. The clients take the lead in the communication. The basic Client-Server architecture has 2 tiers (Client and Server).
6. Can a try block have more than one catch block?
Yes, It can have as many as you want. It allows you to catch very specific exceptions.

7. Can a try block have nested try blocks?
Yes perfectly legal, but not always it is useful.

8. How do you load an assembly at runtime?
Here is the sample code, hope it will help
Loader.AssemblyLoader assLoader = null;
object[] parms = { AssemblyName }; // string AssebmlyName

assLoader = (Loader.AssemblyLoader)domain.CreateInstanceFromAndUnwrap(
“yourAssemply.dll”, “Loader.AssemblyLoader”, true, bindings, null, parms,
null, null, null);

9. If I am writing in a language like VB or C++, what are the procedures to be followed to support .NET?
If you want your VB6 or C++ code to be used with .NET code your code should be CLS compliant….

What is CLS-Compliant?

One of the greatest advantages of .net is that you can write code in a variety of different languages and it all translates to MSIL at the end and is run by the CLR. That’s a wonderful feature, however languages themselves differ in the kind of features that they support. For example C# supports operator overloading while some languages do not.

To resolve this Microsoft introduced the Common Language Specification. Basically, if your code is CLS Compliant it means that all your code is guaranteed to be callable by any .Net module. You can accomplish this by using the CLSCompliant assembly attribute:

1: [assembly: CLSCompliant(true)]
CLS is a subset of the Common Type System / Common Language Runtime. For more information on making your assemblies CLS Compliant check out this article on MSDN http://msdn2.Microsoft.com/en-us/library/bhc3fa7f(VS.71).aspx

10. How do you view the methods and members of a DLL?
Go to visual studio 2003/2005 command prompt and type “ildasm”. It will open a window. In that window load ur dll, it will show all the methods and members.

11. What is shadowing?
Shadowing is either through scope or through inheritance. Shadowing through inheritance is hiding a method of a base class and providing a new implementation for the same. This is the default when a derived class writes an implementation of a method of base class which is not declared as overridden in the base class. This also serves the purpose of protecting an implementation of a new method against subsequent addition of a method with the same name in the base class.’shadows’ keyword is recommended although not necessary since it is the default.

12. What are the collections you’ve used?
.Net collections that you have used.

Advertisements


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>