Professional Microsoft.NET Interview Preparation Guide
Download PDF

Microsoft.NET guideline for job interview preparation. Explore list of Microsoft.NET frequently asked questions(FAQs) asked in number of Microsoft.NET interviews. Post your comments as your suggestions, questions and answers on any Microsoft.NET Interview Question or answer. Ask Microsoft.NET Question, your question will be answered by our fellow friends.

31 Microsoft.NET Questions and Answers:

Table of Contents:

Professional  Microsoft.NET Job Interview Questions and Answers
Professional Microsoft.NET Job Interview Questions and Answers

1 :: Is .NET capable of supporting multi-thread?

Multithreading is a important feature of .NET, which was not there in Visual Basic.

If u want to use Multithreading, import a namespace called as System.Threading.In this namespace there are many classes related to it like Mutex,....

2 :: What is IL and C#?


IL is a intermediate language, which is created when you compile the .net program. This is also a object oriented language. This makes cross language inheritance.


C# is a new OOPs language which is developed by Microsoft. This language gives flexibility, mordern, easy to use.

c# is one of the programming language defined as "Type safe version of c with oops" developed by Microsoft corporation.

IL(Intermediate Language) is a code which can be converted by .net to support the cross language support.
(That is whatever the language like c#, vb, c++,j# is used to program in .net that code is converted into IL which is common for all .net platform supporting languages before the execution, it supports the cross language support in .net platform)

3 :: What is satelite assembly?

Satellite assemblies are often used to deploy language-specific resources for an application. These language-specific assemblies work in side-by-side execution because the application has a separate product ID for each language and installs satellite assemblies in a language-specific subdirectory for each language. When uninstalling, the application removes only the satellite assemblies associated with a given language and .NET Framework version. No core .NET Framework files are removed unless the last language for that .NET Framework version is being removed

4 :: How to produce an assembly?

Goto command prompt Ist you have to set the path and type csc /t:library filename then you will be created assembly which will stored in the application directory.

for ex. i have file with hello.cs

i used to csc /t:library hello.cs

then it became hello.dll. stored in the application directory.

5 :: How to stop a thread?

NET allows to call System.Windows.Forms.Control functions only from thread where control was created. To run them from other thread we need to use Control.Invoke (synchronous call) or Control.BeginInvoke (asynchronous call) functions. For task like showing database records we need Invoke. To implement this :Delegate type for calling form function, delegate instance and function called using this delegate Invoke call from worker thread. Next problem is to stop worker thread correctly. Steps to do this:Set event "Stop Thread" Wait for event "Thread is stopped" While waiting for event process messages using Application.DoEvents function. This prevents deadlock because worker thread makes Invoke calls which are processed in main thread. Thread function checks in every iteration whether Stop Thread event is set. If event is set, function makes clean-up operations, sets event "Thread is stopped" and returns.

6 :: Is there built-in support for tracing/logging?

Basically there are two ways by which you can enable tracing.

i. page label ii.application label.

For page label tracing in the page directive write the following

<@page trace="True">

and if you want show some message then either wrire trace.write(message) or trace.warn(some warning message)

note that trace.warn will show the message in red color.

7 :: How to redirect tracing to a file?

TextWriterListener will redirect the tracing output to an instance of the TextWriter or to any object of stream class such as log file, network stram or Console.

8 :: How to spawn a thread?

Threads are processed differently depending on IIS5. or IIS 6 is used. For each request that comes in, a new instance of the appropriate HttpApplication-derived class is created, as are the associated modules for that app. To avoid reallocating apps and modules too often, each AppDomain maintains a pool of apps and modules. The maximum size of the app pool is the same as the size of the thread pool, so by default, up to 25 requests per worker process can be processed concurrently, each with its own app and module set.

9 :: Explain What languages does the .NET Framework support?

1. ASP.NET Web applications: These include dynamic and data driven browser based applications.

2. Windows Form based applications: These refer to traditional rich client applications.

3. Console applications: These refer to traditional DOS kind of applications like batch scripts.

4. Component Libraries: This refers to components that typically encapsulate some business logic.

5. Windows Custom Controls: As with traditional ActiveX controls, you can develop your own windows controls.

6. Web Custom Controls: The concept of custom controls can be extended to web applications allowing code reuse and modularization.

7. Web services: They are ?web callable? functionality available via industry standards like HTTP, XML and SOAP.

8. Windows Services: They refer to applications that run as services in the background. They can be configured to start automatically when the system boots up.

10 :: What is Code Access Security (CAS)?

Identity permissions control code access from one assembly to another. You can use identity permissions, which are a subset of code access permissions, either declaratively or imperatively

CAS is a part of .NET security model that determines whether a piece of code is allowed to run and what resources it can use while running,eg:CAS will allow a application to be read but cannot delete it.

11 :: Explain serialization?

SERIALIZATION: It is the process of converting the objects into stream of bytes which is used for Web Services or Remoting. There are 2 types of serializers present

1 XML Serializer:- used for web services

2Binary Formatter:-used for remoting

searialization means we can do changes in a class object & these changes are saved somewhere means this object state is saved smwhere in memory now whnever another object of dis class is created by d user dis new object automatically receives all the values of the previous object becoz previous object(state) value are already stored somewhere

12 :: What is the difference between and asp?

There are a number of striking differences between ASP.NET and ASP. For some of these differences, the benefits will be immediately obvious. For others. We?ll have to get used to new ways of thinking about dynamic web Pages. Among the changes are:

ASP.NET pages are complied, not interpreted. A binary executable is compiled upon the first request to the page. This image is stored in an in-memory cache on the web server, and subsequent request to this page use this executable to service the request.

The Framework provides a very clean separation of code from content. With ASP, because the HTML is generated as the page is interpreted, your page logic must be embedded into the page at the location where you want the HTML generated by this logic to be output. With ASP.NET, no HTML is generated until all of the code in your page has finished executing. The entire task of HTML generation is done in the page?s rendering step, which uses the properties for all of us who consider script writing and HTML generation a poor substitute to sitting down and writing real code.

ASP.NET Framework maintains state for you. Do you ever have to post of the server to apply validation logic to a data entry HTML form? When there?s a problem, you must write code to repopulate every input on your HTML form. You must also execute script inline to add validation messages next to the fields that have errors. The resulting code is often a tangled mess. If the business logic changes, that?s a tough page to maintain. With the ASP.NET Framework, this state maintenance is done for you. The fields maintain their value without a single line of code written by you. This applies not only to simple text inputs but also to SELECT lists, check boxes, radio buttons, and other input types on your form. Built-in validation controls allow you to enforce your business logic by adding a single tag to your page and simply checking the Page. Is Valid property when it posts to the server.

ASP.NET runs events on the server. In ASP, because of the amount of script that must be mixed with the HTML, it?s common to split a single functional area across several pages. One page may collect data from a user, whereas another accepts the HTTP post and updates your relational data, telling your user the result of the operation. Although its possible to put this functionality into a single ASP page you do so at the risk of needing to maintain a garbled mess of code over the long haul. Breaking these functions into separate pages causes the number of files in your web site to balloon. With ASP.NET, you can set up server side event traps

ASP.NET provides a consistent event model. With ASP, script is executed on the page in a top-down manner. Although it?s possible to put your script within functions that you call from the page body, there?s no event model that fires at specific points in the lifecycle of your page. With ASP.NET, this event model has been added. Most importantly, there?s an event fired whenever your page. With ASP.NET, this event your page begins to load. This is very much like the from_Load event in VB. The page load event can be trapped in a script tag or from your code behind the page. This gives you a consistent model for setting up your output.

script is executed on the page in a top-down manner. Although it?s possible to put your script within functions that you call from the page body, there?s no event model that fires at specific points in the lifecycle of your page. With ASP.NET, this event model has been added. Most importantly, there?s an event fired whenever your page

13 :: What languages does the .NET Framework support?

Commonly used languages are

ASP.NET with C#sharp
visual C++
Visual J#

14 :: How to customize the trace output?

the tracing output's target by adding TraceListener instances to or removing instances from the Listeners collection.

15 :: Explain What does managed mean in the .NET context?

The executed by the CLR environment it is called Managed Code, which can provide security, Exception Handling and Memory Management (Garbage Collection). Provide Type Safe.

It becomes light weighted code.

The code which are all run under the CLR(Common Language Runtime) is called managed code.
The code which starts with unsafe doesn't run under CLR, called unmanaged code.

managed code is the safe code that couldnot make any harmful activities knowingly or unknowingly to the developer.

managed code is the secured harmless code without the developers knowledge.

16 :: Explain garbage collection?

The automatic memory management scheme employed by the .NET Framework (CLR) is called garbage collection.
Unused memory is automatically reclaimed by garbage collection without interaction with the application
The garbage collector is a low-priority thread that always runs in the background of the application under normal circumstances. It operates when processor time is not consumed by more important tasks. When memory becomes limited, however, the garbage collector thread moves up in priority. Memory is reclaimed at a more rapid pace until it is no longer limited, at which point the priority of garbage collection is again lowered.

in c# memory is divided in five blocks stack,heap,Global,static,& the code block..all the objects created in the heap block(the total size of heap block is 64 mb)whn the heap block is about to full the gc(garbaze collector)automatically invokes & it deletes all those objects which are not in use or not pointing other words we can say dat the GC free the memory by deleting the unused objects or references.
a user never know when GC runs or invokes becz it runs automatically when d heap memory is going to full..
GC takes cares of heap block not stack block so it is good for the user to create any number of objects without care of memory. c# launches new features of garbage collection before c# (in any languages like c or c#)whn a user create a object it thinks first about memory and after dat its user responsibility to free d memory bt this is not d case in c# bcoz GC automatically takes cares of MEMORY MANAGMENT

17 :: Explain What is reflection in Microsoft .NET Context?

Net Reflection :

The REFLECTION is used to read the metadata information like(type, reference and methods). Which is derived from system.assembly.reflection class object.

The simple meaning is to read assembly information by using this system.assembly.reflection class.

18 :: Explain What is an Application Domain?

Operating systems and runtime environments provide some form of isolation between applications. This isolation is necessary to ensure that code running in one application cannot adversely affect other, unrelated applications

19 :: Explain What is the Difference between web application and enterprise application?

Web applications are stored on a server and delivered to users over the Internet. A Web application is usually a three-tier structure, comprising a User Service tier (allowing user access to the application), a Business Service tier (allowing the user to carry out complex activities) and a Data Service tier (which allows data storage and retrieval).
An application that conforms to the Java 2 Platform Enterprise Edition specification.

20 :: Explain the difference between a private assembly and a shared assembly?

The .NET Assemblies Part1

This online presentation about .NET assemblies helps the webmasters to know about the three tier architecture and about .NET assemblies. The author describes the real need of the three-tier architecture. The author divides the application into three layers named as Presentation, Business Logic and Database. This article describes each with its pictorial representation given.

The .NET Assemblies Part 2

The author defines the assemblies and highlights the benefits of .NET assemblies. The author also discusses about the two developments - Code behind and Custom controls. The author tells that by generating the pre-compiled libraries of IL, the users could improve the performance of their applications. This gives a solution to the beginners thirst to know about .NET assemblies.

The .NET Assemblies Part 3

This article deals with assemblies and their implementation in .NET. The main content of this article is about implementing a simple .NET assembly. In ASP.NET web applications, the users might employ many pre-built assemblies. The author helps by teaching the method of creating their own assemblies. One such creation of the component which would facilitate the users with some options to be viewed as a message or information on the screen. The sample source code is given along with this article.

21 :: What is .net3.0 and .net3.5?

.net 3.0 is the framework and .net 3.5 is also framework with some extra features than 3.0 framework.

22 :: Explain How do assemblies find each other?

If the assemblies is private means doesn't worry about it. The assembly name is unique. Whereas the assemblies is like shared assembly find the name and versioning number of the assembly.

23 :: What is the difference between .Net2000 and .Net2005(features)? Which one is better?

.net 2005 is better as it has many additional .net 2000,there was not the login control...but in 2005 it is.similarly many more functions is added in 2005.

24 :: Explain ASP.NET?

ASP.NET is the latest version of Microsoft's Active Server Pages technology (ASP).

ASP.NET is a part of the Microsoft .NET framework, and a powerful tool for creating dynamic and interactive web pages.

25 :: Explain What platforms does the .NET Framework run on?

The .Net Framework runs on
Windows XP,
Windows Server 2003,
Windows 2000, NT Server 4.0,
Windows 98, or Windows ME, a
lthough ASP.NET runs only on the first 3.
Microsoft.NET Interview Questions and Answers
31 Microsoft.NET Interview Questions and Answers