You are on page 1of 69

Question

What is the difference between Finalize() and Dispose()?


Answer: Dispose() is called by as an indication for an object to release any unmanaged resources it
has held...........
How does the XmlSerializer work? What ACL permissions does a process using it require?

Answer: The XmlSerializer constructor generates a pair of classes derived from


XmlSerializationReader and XmlSerializationWriter by analysis of the classes using reflection........
What are circular references? Explain how garbage collection deals with circular references.
Answer: A circular reference is a run-around wherein the 2 or more resources are interdependent on
each other rendering the entire chain of references to be unusable........
Explain how to add controls dynamically to the form using C#.NET.
Answer: The following code can be called on some event like page load or onload of some image or
even a user action like onclick.......

What are Extender provider components? Explain how to use an extender provider in the project.

Answer: An extender provider is a component that provides properties to other components..........


Describe the configuration files in .Net. What are different types of configuration files in .Net
framework?
Answer: The Machine.Config file, which specifies the settings that are global to a particular
machine.......
Describe the accessibility modifier "protected internal".
Answer: The Protected Internal access modifier can be accessed by:.....
What is the difference between Debug.Write and Trace.Write? When should each be used?
Answer: Debug.Write: Debug Mode, Release Mode (used while debuging a project).......
Explain the use of virtual, sealed, override, and abstract.
Answer: The virtual keyword enables a class to be overridden. If it has to be prevented from being
overridden, then the sealed keyword needs to be used.........
What benefit do you get from using a Primary Interop Assembly (PIA)?
Answer: A primary interop assembly contains type definitions (as metadata) of types implemented
with COM. Only a single PIA can exist, which needs to be signed with a strong name by the
publisher of the COM type library............
Explain the use of static members with example using C#.NET.
Answer: Static members are not associated with a particular instance of any class.
They need to be qualified with the class name to be called.............
How to achieve polymorphism in C#?

Answer: Polymorphism is when a class can be used as more than one type through inheritance. It
can be used as its own type, any base types, or any interface type if it implements interfaces........
What are implementation inheritance and interface inheritance?
Answer: Implementation inheritance is achieved when a class is derived from another class in such
a way that it inherits all its members...........
How to add a ReadOnly property in C#.NET?
Answer: Properties can be made read-only by having only a get accessor in the
implementation........
How to prevent a class from being inherited in C#.NET?
Answer: The sealed modifier is used to prevent derivation from a class. An error occurs if a sealed
class is specified as the base class of another class.............
What are generics in C#.NET?
Answer: Generic collection classes in the System.Collections.Generic namespace should be used
instead of classes such as ArrayList in the System.Collections namespace............
What is the use of GetCommandLineArgs() method in C#.NET?
Answer: With GetCommandLineArgs() method, the command line arguments can be accessed.
The value returned is an array of strings.............
What is the use of System.Environment class in C#.NET?
Answer: The System.Environment class can be used to retrieve information like:.......
What is the difference between const and readonly in C#.NET?
Answer: The read only can be modified by the class it is contained in. However, the const cannot be
modified. It needs to be instantiated only at the compile time.........
Advantages of CLR procedure over T-SQL procedure
Answer: The use of the CLR procedure makes it possible to do the complex database operations
without having an in-depth knowledge of T-SQL..........
How does C#.NET Generics and C++ Templates compare?
Answer: C# generics and templates in C++ are more or less similar syntactically..........
What is an object pool in .NET?
Answer: It is a list of ready to use objects. Whenever a new request comes in for creating an object,
then the application is served from this pool. This reduces the overhead of creating an object over
and over again.............
Why is an object pool required?
Answer: The request for the creation of an object is served by allocating an object from the pool.
This reduces the overhead of creating and re-creating objects each time an object creation is
required.............
How does object pooling and connection pooling differ?
Answer: In Object pooling, you can control the number of connections. In connection pooling, you
can control the maximum number reached........
Explain how to Implement an Object Pool in C#.NET.
Answer: using System;
using System.Collections;..........
Describe the three major components that make up a Web Service.
Answer: SOAP (Simple Object Access Protocol)
UDDI (Universal Description, Discovery and Integration)
WSDL (Web Services Description Language)...........
Explain with code sample how to Implement a Web Service in .NET.
Answer: C# generics are a simpler approach to parameterized types without the complexity of C++
templates In addition, C# does not attempt to provide all of the functionality that C++ templates
provide...........
What is ILDASM and Obfuscator in NET?
Answer: ILDASM (Intermediate Language Disassembler)
De-Compilation is the process of getting the source code from the assembly...........
Explain how Obfuscator works in NET
Answer: Obfuscator simply renames all types and namespace etc to meaningless code making it non
human readable. This diminishes the possibility of reverse engineering...........
What is an Exception in .NET?
Answer: Exceptions are errors that occur during the runtime of a program.
The advantage of using exceptions is that the program doesn’t terminate due to the occurrence of
the exception...........
Explain how to Handle Exceptions in .NET 2.0.
Answer: Exceptions should never be handled by catching the general System.Exception errors,
rather specific exceptions should be caught and handled....:......
What are Custom Exceptions? Why do we need them?
Answer: Custom exception needs to derive from the System.Exception class. You can either derive
directly from it or use an intermediate exception like SystemException or ApplicationException as
base class...........
What are delegates and why are they required?
Answer: Delegates are like type safe function pointers. We need delegates as they can be used to
write much more generic functions which are type safe also............
Explain how to implement Delegates in C#.NET.

Answer: Here is an implementation of a very simple delegate that accepts no parameters............


CLR Triggers
Answer: A CLR trigger could be a Date Definition or Date Manipulation Language trigger or could be
an AFTER or INSTEAD OF trigger.............
Steps for creating CLR Trigger
Answer: Follow these steps to create a CLR trigger of DML (after) type to perform an insert
action:.............
.
Question - Define assembly.
Answer - An assembly is the primary unit of a .NET application. It includes an assembly manifest
that describes the assembly.
Question - What is a Constructor?
Answer - It is the first method that are called on instantiation of a type. It provides way to set
default values for data before the object is available for use. Performs other necessary functions
before the object is available for use.
Question - What is a Destructor?

Answer - It is called just before an object is destroyed. It can be used to run clean-up code. You
can't control when a destructor is called since object clean up by common language runtime.
Question - Define abstract class in C#.NET.
Answer - Abstract class cannot be instantiated.
Same concept in C++ known as pure virtual method.
A class that must be inherited and have the methods over-ridden.
A class without any implementation.
Question - Explain serialization?
Answer - Serialization is a process of converting an object into a stream of bytes. .Net has 2
serializers namely XMLSerializer and SOAP/BINARY Serializer. Serialization is maily used in the
concept of .Net Remoting.
Question - C#.Net support multiple inheritance, comment.
Answer - No, but we can use interface instead.
Question - Can private virtual methods be overridden in C#.NET?
Answer - No, moreover, you cannot access private methods in inherited classes,
They have to be protected in the base class to allow any sort of access.
Question - Is is possible to force garbage collector to run?
Yes, we can force garbage collector to run using System.GC.Collect().
What is the role of data provider?
The .NET data provider layer resides between the application and the database. Its task is to take
care of all their interactions.
The .NET Data provider can be demonstrated to be:
SQL Server data provider
OLEDB data provider
ODBC Data Provider
ADO.NET supports the following OLE DB Providers:
Describe how a .Net application is compiled and executed.
From the source code, the compiler generates Microsoft Intermediate Language (MSIL) which is
further used for the creation of an EXE or DLL. The CLR processes these at runtime. Thus, compiling
is the process of generating this MSIL.
The way you do it in .Net is as follows:
Right-click and select Build / Ctrl-Shift-B / Build menu, Build command
F5 - compile and run the application.
Ctrl+F5 - compile and run the application without debugging.
Compilation can be done with Debug or Release configuration. The difference between these two is
that in the debug configuration, only an assembly is generated without optimization. However, in
release complete optimization is performed without debug symbols.
What is an Event?
When an action is performed, this action is noticed by the computer application based on which the
output is displayed. These actions are called events. Examples of events are pressing of the keys on
the keyboard, clicking of the mouse. Likewise, there are a number of events which capture your
actions.
Define Delegate.
Delegates are kind of similar to the function pointers. But they are secure and type-safe.
A delegate instance encapsulates a static or an instance method.
Declaring a delegate defines a reference type which can be used to encapsulate a method having a
specific signature.
What is Assembly manifest?
The manifest of an assembly contains assembly's data like version, scope, security information
(strong name),etc.
It also contains a reference to the resource and classes.
It is stored in either an .exe or a .dll with Microsoft intermediate language (MSIL) code.
What is GAC (global assembly cache)?
GAC, global assembly cache is an area of memory reserved to store the assemblies of all .NET
applications that are running on a certain machine.
It shares assemblies among multiple .NET applications. The assemblies must have a strong name
and must be publicly shared to be installed in the GAC.
Can you inherit private class-level variables?
Yes, they can be inherited but they are not accessible in the derived class, so it looks as if it is not
inherited.
Name the class from where everything is derived in .NET
System.Object.
What is the significance of the keyword virtual in the method definition?
The method with virtual keyword signifies that it can be over-ridden.
Can you override private virtual methods?
First of all private methods in the inherited class can't be accessed, so there is no question of
overriding of private virtual methods.
How can you allow class to be inherited and prevent the method from being over-ridden?
Declare the class as public and make the methods sealed.
What is an abstract class?
An abstract class is a class that can't be instantiated. It is just the blueprint for a class without any
implementation. You can inherit the class and have the methods over-ridden.
What is an interface class?
An interface class is an abstract class with public abstract methods. You can inherit the class and
have the methods over-ridden.
Difference between an interface and abstract class
Some methods in the abstract class can be concrete whereas all methods in the interface are
abstract,
Name the namespace used to create a localized application.
System.Globalization
System.Resources
Explain assert().

Assert method is in debug compilation. It takes a boolean condition as a parameter. It shows error
dialog if the condition is false and if the condition is true, the program proceeds without interruption.
Difference between // comments, /* */ comments and /// comments.
// comments - It is Single-line comment
/* */ comments - It is multi-line comment
/// comments - It is XML documentation comments.
What are the ways to deploy an assembly?
MSI installer
CAB archive
XCOPY command
Define a delegate.

A delegate is quite similar to C++ function pointers. It encapsulates a reference to a method.


Explain how to sort the elements of the array in descending order.
You can do so by calling Sort() and then Reverse() methods.
System.String vs. System.StringBuilder classes
System.String is immutable.
System.StringBuilder was designed with the purpose of having a mutable string where a variety of
operations can be performed.
Define protected internal.
This type of member is available to derived classes and classes within the same Assembly.
Method overriding vs. overloading
Overloading means having a method with the same name within the class
Through overriding, you change the method behavior for a derived class.
Difference between the System.Array.CopyTo() and System.Array.Clone().
System.Array.CopyTo() performs a deep copy of the array
System.Array.Clone() performs a shallow copy of the array
How is the DLL Hell problem solved in .NET?

DLL Hell problem is solved in .NET with the introduction of Assembly versioning. It allows the
application to specify not only the library it needs to run, but also the version of the assembly.
Define satellite assembly.
Satellite assembly is created to write a multilingual or multi-cultural application in .NET. It allows
distributing the core application separately from the localized modules.
Explain how to debug an ASP.NET Web application.
Attach the aspnet_wp.exe process to the DbgClr debugger.
Explain the purpose of tracing levels in System.Diagnostics.TraceSwitcher.
Five levels range from none to Verbose, allowing fine-tuning the tracing activities.
Difference between the Debug class and Trace class

Debug class is used for debug builds while Trace class is used for both debug and release builds.
Explain the role of the DataReader class in ADO.NET connections.

DataReader class returns a read-only dataset from the data source when the command is executed.
Explain the purpose of Dispose method.
Dispose method is used to destroy the objects from the memory.
What are the connections supported in Microsoft SQL Server?
Windows Authentication
SQL Server authentication
Out of Windows Authentication and SQL Server authentication, which one is trusted?
Windows Authentication is trusted because the username and password are checked with the Active
Directory.
It is a bad idea to throw your own exceptions. comment
Throwing your own exceptions means there is some design problem in the program. So, instead
write proper code that can handle the error.
Question - How do you inherit derived class from a base class in C#.NET?
Answer - By using colon and then the name of the base class.
Question - Name the Top .NET class that everything is derived from.
Answer - System.Object.
Question - Define protected class-level variable in C#.NET.
Answer - It can be inherited by the classes in the same namespace.
Question - Is it possible to inherit private class-level variables?
Answer - No.
Question - Is it possible to inherit multiple interfaces in C#.NET?
Answer - Yes.
Question - Define Protected internal.
Answer - It is available to derived classes and classes within the same Assembly.
Question - How to prevent your class from being inherited?

Answer - You can use keyword 'sealed' in the class definition to prevent class from being inherited.
Question - List down difference between overriding and overloading.
Answer - When overriding, you change the method behavior for a derived class.
Overloading simply involves having a method with the same name within the class.
Question - What does the keyword virtual mean in the method definition?
Answer - The method can be over-ridden.

Question - How to allow class to be inherited, but prevent the method from being over-ridden?
Answer - You can do so by declaring the class public and making the method sealed.
Question - When do we declare a class as abstract in C#.NET?
Answer - When at least one of the methods in the class is abstract.
Question - Define Interface class in C#.NET.
Answer - It is an abstract class with public abstract methods with no implimentation.
Question - Difference between an interface and abstract class
Answer - In the interface all methods must be abstract;
In the abstract class some methods can be concrete.
In the interface no accessibility modifiers are allowed, which is possible in abstract classes.
Question - How can you overload a method?
Answer - Different parameter data types, different number of parameters, different order of
parameters.
Question - Difference between System.String and System.StringBuilder classes.
Answer - System.String is immutable;
System.StringBuilder was designed with the purpose of having a mutable string where a variety of
operations can be performed.
Question - Define Delegate.
Answer - A delegate object encapsulates a reference to a method.
In C++ they were referred to as function pointers.
Question - How is DLL Hell problem solved in .NET?
Answer - Assembly versioning helps to resolve not only the library it needs to run , but also the
version of the assembly.
Question - Ways to deploy an assembly.
Answer - MSI installer, a CAB archive, and XCOPY command.
Question - Define Satellite Assembly.
Answer - 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.
Question - Namespaces to create a localized application.
Answer - System.Globalization, System.Resources.
Question - List out difference between the Debug class and Trace class.
Answer - Use debug class for debug builds, use Trace class for both debug and release builds.
Question - What are three test cases you should go through in unit testing?

Answer - Positive test cases (correct data, correct output), negative test cases (broken or missing
data, proper handling), exception test cases (exceptions are thrown and caught properly).
Level
Question
AJAX Interview questions and Answers
What is AJAX and what problem does it solve?

Answer - Ajax is a set of client side technologies that allows asynchronous communication
between...............
What are the benefits of AJAX over Java applet?

The following are the benefits of AJAX over Java applet: AJAX applications are loaded in seconds,
where as Applets takes longer time. The reason is, Applet applications are tend to load large
libraries..................
What is the disadvantage of AJAX?

The disadvantages of AJAX are: Search engines would not be able to index an AJAX
application..............
How is encoding handled in AJAX?

AJAX encoding can be done in two ways: encodeActionURL() method is used for full page
refresh.............
Why is AJAX a comfortable fit with JAVA?

AJAX is a comfortable fit because, using Java Enterprise Edition the following tasks can be
performed:.............
What is synchronous request in AJAX?

Synchronous AJAX is a process that makes a java script to halt or stop the processing an
application until a result is sent by a server. The browser is frozen, while the request...............
When should I use a Java applet instead of AJAX?

Applets provide features like custom data streaming, graphic manipulation, threading, and
advanced GUIs which AJAX cannot..................
How Ajax is different?

An AJAX application introduces a layer between the user and the server which comprises of the
AJAX engine. This eliminates the adhoc interaction between the client.............
Is the server or the client in control in AJAX?

With AJAX the control can be more centralized in a server-side component or a mix of client-side
and server-side controllers...............
Are there Usability Issues with AJAX?

The nature of updating a page dynamically using data retrieved via AJAX interactions and DHTML
may result in drastically changing the appearance and state of a page...................

Ajax Interview questions with answers posted on August 12, 2008 at 18:00 pm by Rajmeet Ghai
Explain ASP.NET Ajax Framework.

Answer - ASP.NET Ajax Framework is used for implementing the Ajax functionality......
Explain limitations of Ajax.
Answer - Back functionality cannot work because the dynamic pages don’t register themselves to
the browsers history engine..........
What is the role of Script Manager in Ajax?

Answer - Script Manager, as the name suggests is used to manage the client side script of
Ajax.............
List out differences between AJAX and JavaScript.

Answer - Ajax is Asynchronous Java Script and XML. Here on sending request to the server, one
needn’t wait for the response.................
Describe how to create AJAX objects.

Answer - Ajax Objects can be created by the following syntax:.............


Define JSON.

Answer - JSON is JavaScript Object Notation. JSON is a safe and reliable data..........
Explain in brief abo XMLHttpRequest object

Answer - XMLHttpRequest object is used to transfer data between a client and a server.......
Describe the formats and protocols used by AJAX.

Answer - Ajax uses HTTP’s GET or POST. AJAX also uses XMLHttpRequest protocol for requesting
to the web server...............
What are the security issues with AJAX?

Answer - AJAX function calls are sent in plain text to server. These calls may easily reveal
database...............
Describe how to handle concurrent AJAX requests.

Answer - JavaScipt Closures can be used for handling concurrent requests. A function can be
written.............
When should AJAX NOT be used?

Answer - If the page is expected to be shown in a search engine like Google. Since Web crawlers
don’t execute...............
How do you know that an AJAX request has completed?

Answer - By determining the readyState property value of XMLHttpReqyest, One can know if the
request...............
How do I handle the back and forward buttons?

Answer - In order to store changes in the browsers web history (enabling back and forward
buttons)..............
Level
Question
Question - What is Shared (static) member?
Answer - Itbelongs to the type but not to any instance of a type.
Itcan be accessed without creating an instance of the type.
It can beaccessed using the type name instead of the instance name.
Itcan't refer to any instance data.

Question - What is the transport protocol you use to call a Web service?
Answer - SOAP (Simple Object Access Protocol) is the preferred protocol.

Question - What is Option Strict used for?


Answer - Option Strict On enables type checking at design time andprevents type mismatch bugs.

Question - Define Boxing and Unboxing.

Answer - Boxing allows you to treat a value type the same as a reference type.

Unboxing converts a boxed reference type back to a value type.

Question - What does WSDL stand for?


Answer - Web Services Description Language.

Question - Define ViewState in ASP.NET.


Answer - It allows the state of objects (serializable) to be stored in a hidden field on the page.
It is transported to the client and back to the server, and is not stored on the server or any other external
source.
It is used to retain the state of server-side objects between postbacks.

Question - What is the lifespan for items stored in ViewState?


Answer - Items stored in the ViewState exist for the life of the current page.
This includes postbacks (to the same page).

Question - Define EnableViewState property.


Answer - It allows the page to save the users input on a form across postbacks.
It saves the server-side values for a given control into ViewState, which is stored as a hidden value on the
page before sending the page to the clients browser.

When the page is posted back to the server, the server control is recreated with the state stored in viewstate.

Question - What are Delegates?


Answer - Delegates provide the functionality behind events.
A delegate is a strongly typed function pointer.
Invoke a method without making an explicit call to that method.
In Visual Basic .NET, the role of the delegate is largely behind the scenes

Question - What are Classes?

Answer - Classes are the blueprints for objects.


A class acts as a template for any number of distinct objects.
Question - What is Encapsulation?
Answer - The data of an object should never be made available to other objects.

Question - Different types of Session state management options available with ASP.NET?
Answer - ASP.NET provides In-Process and Out-of-Process state management.
In-Process stores the session in memory on the web server.
Out-of-Process Session state management stores data in an external data source.
The external data source may be either a SQL Server or a State Server service.
Out-of-Process state management requires that all objects stored in session are serializable.

Question - What methods are fired during the page load?


Answer - Init() - when the page is instantiated.
Load() - when the page is loaded into server memory.
PreRender() - the brief moment before the page is displayed to the user as HTML
Unload() - when page finishes loading.

Question - Explain ADO.NET.

Answer - It is data-access technology, primarily disconnected and designed to provide efficient, scalable data
access.
The disconnected data is represented within a DataSet object.
A data provider is a set of classes that provide access to databases. The main components of data provider
are:
Connection
Command
DataReader
DataAdapter

Visual Studio .NET includes two data providers:


SQL Data Provider
OleDb Data Provider

Two additional data providers are included in Visual Studio .NET 2003:
ODBC Data Provider
Oracle Data Provider

Question - Define Server-side and Client-side code in ASP.NET.


Answer - Server-side code runs on the server.
Client-side code runs on the client's browser.
Question - What tag do you use to add a hyperlink column to the DataGrid?
Answer - <asp:HyperLinkColumn>

Question - Where does VS.NET store Web application projects?


Answer - Web application projects create a virtual folder for each project where all the files of the projects are
stored. The virtual folder can be viewed in IIS and property of that folder determines where the files are
physically stored.

Question - Describe Web application’s life cycle.

Answer - A Web application starts with the first request for a resource.
On request, Web forms are instantiated and processed in the server.
Server sends its response to the client.
Application ends once all client sessions end.

Question - Define class module and a code module.

Question - Steps to execute a stored procedure from Web Application.

Answer - Create a command object.


Set the object’s CommandText property to the name of the stored procedure.
Set the CommandType property to stored Procedure.
Execute stored procedure using command object’s method.

Question - Describe exception handling in ASP.NET.

Answer - Exception handling correct unusual occurrences and prevent application from getting terminated.
You can use Try(try) block and Error event procedures to handle exceptions.

Question - What are the exception-handling ways in ASP.NET?

Answer - Exceptions can be handled by using Try(try) block and Error event procedures at the global,
application, or page levels by using the Server object’s GetLastError and ClearError methods.

Question - Describe use of error pages in ASP.NET.

Answer - Error pages are used when exceptions are outside the scope of the application and the application
can’t respond directly to these exceptions. These types of exceptions are identified by HTTP response codes,
which IIS can respond to by displaying custom error pages listed in your application’s Web.config file.
Question - Explain tracing in ASP.NET.

Answer - Tracing records unusual events while an application is running. It helps in observing problems during
testing and after deployment. An application can write a message in case of unusual events to the trace log
using Trace class.

Question - What is the use of ComVisible attribute?

Answer - ComVisible attribute is used to select which public .NET classes and members are visible to COM.

Question - Define Windows and Forms authentication.


Answer - Windows authentication is the default authentication method of the ASP.NET application. It uses
security scheme of windows operating system of corporate network. Windows authentication uses user
names, passwords, and permissions of network resources and Web applications. User lists for Windows
authentication are included in the element of Web.config.
Form authentication allows creating own database of users in the application’s Web.config file or in a separate
user database and validate the identity of the users when they visit Web site. Users do not have to be
member of a domain-based network to have access to your application.

Question - What is Secure Sockets Layer (SSL) security?

Answer - SSL protects data exchanged between a client and an ASP.NET application by encrypting the data
before it is sent across the internet.

Question - Why is the Machine.config file?

Answer - The Machine.config file controls issue like process recycling, number of request queue limits, and
what interval to check if user is connected.

Question - Explain how to distribute shared components as part of an installation program?

Answer - Shared components should be included as a merge module within the setup project. Merge modules
can’t be installed by themselves. They can be installed only as part of an application installation.

Question - Define Unit testing, Integration testing, Regression testing.

Answer - Unit testing ensures that each piece of code works correctly.
Integration testing ensures each module work together without errors.
Regression test ensures new code did not break previously working code.

Question - Define HTML and XML.

Answer - HTML: It has predefined elements names '<h1>', '<b>' etc


XML: You can create your own elements with syntax much stricter than HTML.

Question - Define Session, SessionId and Session State in ASP.NET.

Answer - A session is the duration of connectivity between a client and a server application.

SessionId is used to identify request from the browser. By default, value of SessionId is stored in a cookie.
You can configure the application to store SessionId in the URL for a "cookieless" session.
Question - What is Session Identifier?
Answer - Session Identifier is used to identify session. It has SessionID property. When a page is requested,
browser sends a cookie with a session identifier. This identifier is used by the web server to determine if it
belongs to an existing session. If not, a Session ID (120 - bit string) is generated by the web server and sent
along with the response.
Question - Advantages and disadvantages of using Session State.

Answer - The advantages of using session state are as follows:


It is easy to implement.
It ensures data durability, since session state retains data even if ASP.NET work process restarts as data in
Session State is stored in other process space.
It works in the multi-process configuration, thus ensures platform scalability.

The disadvantages of using session state are:


Since data in session state is stored in server memory, it is not advisable to use session state when working
with large sum of data. Session state variable stays in memory until you destroy it, so too many variables in
the memory effect performance.

Question - What are the Session State Modes? Define each Session State mode supported by ASP.NET.

Answer - ASP.NET supports three Session State modes.

*
InProc
*
State Server
*
SQL Server

InProc Mode
This mode stores the session data in the ASP.NET worker process.
This is the fastest among all of the storage modes.
This mode effects performance if the amount of data to be stored is large.
If ASP.NET worker process recycles or application domain restarts, the session state will be lost.

State Server mode


In this mode, the session state is serialized and stored in memory in a separate process.
State Server can be maintained on a different system.
State Server mode involves overhead since it requires serialization and de-serialization of objects.
State Server mode is slower than InProc mode as this stores data in an external process.

SQL Server Mode


In this storage mode, the Session data is serialized and stored in a database table in the SQL Server
database.
This is reliable and secures storage of a session state.
This mode can be used in the web farms.
It involves overhead in serialization and de-serialization of the objects.
SQL Server is more secure than the InProc or the State server mode

Define Authentication and Authorization.


Answer - Authentication is the process of verifying user's identity. Authorization is the process of granting
privilege to authenticated user. The user is validated using authenticated process and then the authorization
process identifies if the user has access to a given resource. In ASP.NET, you can authenticate user in code or
allow the user to be authenticated by other party such as MS Passport. You have two layer of authentication in
ASP.NET i.e. IIS layer and ASP.net authentication process layer. IIS performs authentication if it is configured
to do so. By default, IIS allows anonymous access which means all the users are authenticated. All the
requests pass through IIS layer and then to ASP.NET authentication process. If any user requests IIS layer for
anonymous access, the user is treated as authenticated and pass to ASP.NET process. ASP.NET checks if
impersonation is enabled in the web configuaration file i.e. web.config file. If impersonation is enabled,
ASP.net acts as though it were the authenticated user otherwise it process with its own configured account.
To enable the application to authenticate users,
you need to add <deny users = "?"> element in the authorization section of Web.config.
What is the authentication mode available in ASP.NET?

Answer - ASP.NET supports three authentication modes through the System.Web.Security namespace.

Windows Authentication
The windows authentication authenticates users based on their windows accounts. In short, it uses windows
network security. It uses IIS to perform authentication.

Passport authentication
The Passport authentication uses Microsoft's passport service to authenticate users. The new user is directed
to the Microsoft site where he can register his identity. This facilitates user to access multiple sites using
single user name and password. You need to install the Passport SDK to enable the Passport classes in the
System.Web.Security namespace.

Form authentication
The Form authentication collects user's credential and lets the application use own logic to authenticate users.
The collected user's credential is validated using the list maintained by the application. The application
maintains its own user list either using <credential> element in the web.config file or using database. The
advantage of using form authentication is that the users don't need to be the member of windows network to
have access to the application.
How do you set authentication mode in the ASP.NET application?

Answer - You can set authentication mode using web.config file.


<authentication mode="windows">
<authentication mode="passport">
<authentication mode="forms">
List out the difference between windows authentication and form authentication.

Answer - Windows authentication uses windows account whereas form authentication maintains its own user
list. Windows authentication is best suited for the application which is meant for a corporate users whereas
form authentication is preferable for the applications which have diversified users from several places.
User lists for windows authentication are found in <authorization> element whereas in case of form
authentication, lists are there in <credential> element of web.config file.
How do you impersonate the authenticated user in ASP.NET?

Answer - Impersonation means delegating one user identity to another user. In ASP.NET, the anonymous
users impersonate the ASPNET user account by default. You can use <identity> element of web.config file to
impersonate user. E.g. <identity impersonate="true"/>
How do you provide secured communication in ASP.NET?

Answer - ASP.NET provides secured communication using Secure Sockets Layer. The application to use SSL
need to have an encryption key called a server certificate configured in IIS. When a user requests a secured
page, the server generates an encryption key for the user’s session. The encrypted response is then sent
along with encryption key generated. In the client side, the response is then decrypted using same encryption
key.

October 30, 2008 at 18:10 pm by Amit Satpute


What is impersonation in ASP.NET?

Impersonation is when a user accesses a resource without revealing his identity.

The two types of accounts that are set up using IIS make the task of being identifiable very difficult. These
are IUSR_machinename and IWAM_machinename and they get added on a web server automatically. When
IIS receives a request for a web page or other resource that has permission for anonymous access, IIS treats
the IUSR_machinename/ IWAM_machinename account (depending upon the type of the resource) as the
user's account, to access the resources. This obviates the need to authenticate a user.

What is the difference between login controls and Forms authentication?

Latest answer: Login control provides form authentication. If we implement for authentication through form
authentication then we do it through code. On the other hand, login control allows the easy
implementation...............
Read answer
What is Fragment Caching in ASP.NET?

Latest answer: Fragment caching allows to cache specific portions of the page rather than the whole page. It
is done by implementing the page in different parts............
Read answer
What is partial classess in .net?

Latest answer: When there is a need to keep the business logic separate from the User Interface or when
there is some class which is big enough to have multiple number of developers............
Read answer
Explain how to pass a querystring from an .asp page to aspx page.

Latest answer: From HTML in asppage:<ahref="abc.aspx?qstring1=test">Test Query String</a>


From server side code: <%response.redirect "webform1.aspx?id=11"%>...............
Read answer
What is a ViewState?

Latest answer: If a site happens to not maintain a ViewState, then if a user has entered some information in a
large form with many input fields and the page is refreshes, then the values filled up in the form are
lost...........
Read answer
What is the difference between src and Code-Behind?

Latest answer: With the ‘src’ attribute, the source code files are deployed and are compiled by the JIT as
needed.
Though the code is available to everyone with an access to the server (NOT anyone on the web)................
Read answer
What is the difference between URL and URI?

Latest answer: A URL (Uniform Resource Locator) is the address of some resource on the Web. A resource is
nothing but a page of a site. There are other type of resources than Web pages, but that's the easiest
conceptually...........
Read answer
What is the Pre-Compilation feature of ASP.NET 2.0?

Latest answer: Previously, in ASP.NET, the pages and the code used to be compiled dynamically and then
cached so as to make the requests to access the page extremely efficient............
Read answer
How can we create custom controls in ASP.NET?

Latest answer: Custom controls are user defined controls. They can be created by grouping existing controls,
by deriving the control from System.Web.UI.WebControls..........
Read answer
What is an application domain?

Latest answer: It's a way in CLR to maintain a boundary between various applications to ensure that they do
not interfere in working of any other application...........
Read answer
Explain the two different types of remote object creation mode in .NET. [Hint SAO and CAO]

Latest answer: SAO Server Activated Object (call mode): lasts the lifetime of the server. They are activated as
SingleCall/Singleton objects. It makes objects stateless...........
Read answer
Describe SAO architecture of Remoting.

Latest answer: Remoting has at least three sections:-

1. Server
2. Client: This connects to the hosted remoting object
3. Common Interface between client and the server .i.e. the channel..........
Read answer
Explain Singleton architecture of Remoting.

Latest answer: Singleton architecture is to be used when all the applications have to use or share same
data...........
Read answer
Define LeaseTime, SponsorshipTime, RenewOnCallTime, LeaseManagePollTime.

Latest answer: The LeaseTime property protects the object so that the garbage collector does not destroy it
as remoting objects are beyond the scope of the garbage collector. Every object created has a default
leasetime for which it will be activated..........
Read answer
Briefly explain how to specify remoting parameters using config files.

Latest answer: The remoting parameters can be specified through both programming and in config files. All
the settings defined in config files are placed under <system.runtime.remoting>...........
Read answer
What is marshalling? Explain types of marshalling.

Latest answer: Marshaling is a process of transforming or serializing data from one application domain and
exporting it to another application domain...........
Read answer
What is ObjRef object in remoting?

Latest answer: ObjRef is a searializable object returned by Marshal() that knows about location of the remote
object, host name, port number, and object name........
Read answer
Explain the steps of acquiring a proxy object in web services.

Latest answer: Every service listed has a URI pointing to the service's DISCO or WSDL document, which is
needed to access the webservice and its 'webmethod" methods..........
Read answer
Explain the steps to create a web services and consume it.

Latest answer: Create a new website by selecting "ASP.NET Web Site" and giving it a suitable name.
service.cs file appears inside the solution with a default webmethod named as "HelloWorld()"........
Read answer
Explain the difference between cache object and application object.

Latest answer: Application Object: Application variable/object stores an Object with a scope of availability of
the entire Application unless explicitly destroyed.............
Read answer
What is Cache Callback in Cache?

Latest answer: The cache object has dependencies e.g. relationships to the file it stores. Cache items remove
the object when these dependencies change. As a work around we would need to simply execute a callback
method............
Read answer
What is Scavenging?

Latest answer: A process where items are removed from cache in order to free the memory based on their
priority. A property called "CacheItemPriority" is used to figure out the priority of each item inside the
cache...........
Read answer
Explain the types of Caching using Cache object of ASP.NET.

Latest answer: Page output: Is used to fetch information or data at page level. It is best used when the site is
mainly static. Used by declaring the output page directive............
Read answer
Show with an example how to Cache different version of same page using ASP.NET Cache object.

Latest answer: The ways to cache different versions on the same page using ASP.NET cache object is using
OutputCache object............
Read answer
Explain how to implement Fragment Cache.

Latest answer: Fragment cache is to store user controls individually within a web form in cache instead of the
whole webform as such. The idea is to simply have different cache parameters for different user
controls.............
Read answer
Explain the various modes of storing ASP.NET session.

Latest answer: Types of sessions: InProc: The default way to use sessions. InProc is the fastest way to store
and access sessions...........
Read answer
What are the benefits and limitations of using hidden fields?

Latest answer: Advantages: Easy to implement, Hidden fields are supported by all browsers, Enables faster
access of information because data is stored on client side............
Read answer
What are the benefits and limitations of using Hidden Frames?

Latest answer: Advantages: Hidden frames allow you to cache more than one data field, The ability to cache
and access data items stored in different hidden forms...........
Read answer
What are benefits and limitations of using Cookies?

Latest answer: Advantages: They are simple to use. Light in size, thus occupy less memory. Stores server
information on client side. Data need not to be sent back to server........
Read answer
What is QueryString and what are benefits and limitations of using querystring?

Latest answer: Querystring is way to transfer information from one page to another through the URL........
Read answer
What is Absolute and Sliding expiration in .NET?

Latest answer: Absolute and sliding expiration are two Time based expiration strategies. Absolute Expiration:
Cache in this case expires at a fixed specified date or time..............
Read answer
Explain the concepts and capabilities of cross page posting.

Latest answer: Cross-page posting is done at the control level. It is possible to create a page that posts to
different pages depending on what button the user clicks on. It is handled by done by changing the
postbackurl property of the controls..........
Read answer
Explain how to access ViewState value of this page in the next page.

Latest answer: PreviousPage property is set to the page property of the nest page to access the viewstate
value of the page in the next page. Page poster = this.PreviousPage;..........
Read answer
What is SQL Cache Dependency in ASP.NET?

Latest answer: SQL Cache Dependency in ASP.NET: It is the mechanism where the cache object gets
invalidated when the related data or the related resource is modified.........
Read answer
Explain the concepts of Post Cache Substitution in .NET

Latest answer: Post Cache Substitution: It works opposite to fragment caching. The entire page is cached,
except what is to be kept dynamic. When [OutputCache] attribute is used, the page is cached............
Read answer
Explain the use of localization and Globalization.
Latest answer: Users of different countries, use different languages and others settings like currency, and
dates. Therefore, applications are needed to be configurable as per the required settings based on cultures,
regions, countries........
Read answer
Explain the concepts of CODE Page approach. What are the disadvantages of this approach?

Latest answer: Code Page was used before Unicode came into existence. It was a technique to represent
characters in different languages..........
Read answer
What are resource files and explain how do we generate resource files?

Latest answer: Resource files are files in XML format. They contain all the resources needed by an application.
These files can be used to store string, bitmaps, icons, fonts........
Read answer
What are Satellite assemblies and how to generate Satellite assemblies?

Latest answer: To support the feature of multiple languages, we need to create different modules that are
customized on the basis of localization. These assemblies created on the basis of different modules are knows
as satellite assemblies...........
Read answer
Define AL.EXE and RESGEN.EXE.

Latest answer: Al.exe: It embeds the resources into a satellite assembly. It takes the resources in .resources
binary format.......
Read answer
Explain the concepts of resource manager class.

Latest answer: ResourceManager class: It provides convenient access to resources that are culture-correct.
The access is provided at run time.........
Read answer
What is Windows communication foundation, WCF?

Latest answer: WCF is a framework that builds applications that can inter-communicate based on service
oriented architecture consuming secure and reliable web services.............
Read answer
Explain the important principle of SOA.

Latest answer: A service-oriented architecture is collection of services which communicate with one another
other......
Read answer
Explain the components of WCF - Service class, Hosting environment, END point.

Latest answer: WCF Service is composed of three components: Service class: It implements the service
needed, Host environment: is an environment that hosts the developed service.............
Read answer
Difference between WCF and Web Services.

Latest answer: WCF can create services similar in concept to ASMX, but has much more capabilities. WCF is
much more efficient than ASP.Net coz it is implemented on pipeline............
Read answer
What are different bindings supported by WCF?
Latest answer: BasicHttpBinding, WSHttpBinding, WSDualHttpBinding.......
Read answer
What is duplex contract in WCF?

Latest answer: Duplex contract: It enables clients and servers to communicate with each other. The calls can
be initiated independently of the other one.............
Read answer
Explain the different transaction isolation levels in WCF.

Latest answer: Read Uncommitted: - Also known as Dirty isolation level. It makes sure that corrupt Data
cannot be read. This is the lowest isolation level............
Read answer
What are Volatile and Dead letter queues?

Latest answer: Volatile Queues: There are scenarios in the project when you want the message to deliver in
proper time. The timely delivery of message is very more important and to ensure they are not lost is
important too. Volatile queues are used for such purposes.............
Read answer
What is Windows workflow foundation?

Latest answer: Windows Workflow Foundation (WF): It is a platform for building, managing and executing
workflow-enabled applications, for designing and implementing a programming model ..........
Read answer
Explain the types of Workflow in Windows Workflow Foundation.

Latest answer: There are 3 types of workflows in WWF: Sequential Workflow: The sequential workflow style
executes a set of contained activities in order, one by one and does not provide an option to go back to any
step...........
Read answer
What are XOML files? Explain their uses.

Latest answer: XOML is an acronym for Extensible Object Markup Language. XOML files are the markup files.
They are used to declare the workflow and are then compiled with the file containing the implementation
logic..............
Read answer
How to make an application offline in ASP.NET 2.0.

Latest answer: Microsoft's Internet Information Services web server software is used to make an application
offline. The IIS is instructed to route all incoming requests for the web site to another URL automatically........
Read answer
What are script injection attacks?

Latest answer: Script injection attacks called Cross-site scripting (XSS) attacks exploit vulnerabilities in Web
page validation by injecting client-side script code.............
Read answer
What is Authentication in ASP.NET?

Latest answer: Authentication is the process of verifying user’s details and find if the user is a valid user to the
system or not. This process of authentication is needed to provide authority to the user........
Read answer
What is Authorization in ASP.NET?
Latest answer: Authorization is a process that takes place based on the authentication of the user. Once
authenticated, based on user’s credentials, it is determined what rights des a user have...........
Read answer
What is the difference between login controls and Forms authentication?

Login controls are part of ASP. Net’s UI controls collection which allows users to enter their username and
password to login to a website/application. They provide login solution without the need of writing code. They
by default work with ASP.Net membership roles and forms authentication. Forms authentication on the other
hand refers to the authentication type being used by an application. ASP.Net supports Forms Authentication,
Integrated windows authentication and Custom authentication. One can however, change or configure the
login controls to work with the authentication mechanism chosen and not just Forms authentication which is
default.
What is Fragment Caching in ASP.NET?

Fragment caching does not cache a WebForm, rather it allows for caching of individual user controls within a
Web Form, where each control can have different cache duration and behavior.

E.g.: If you have a User Control, then add the following line in Aspx page

<%@ OutputCache Duration="20" VaryByParam="none"%>

Similarly you could have another usercontrol with duration set to 10 and have both these controls on a single
Web Form
What is partial classess in .net?

.Net2.0 supports the concept of partial classes which is unlike the concept of one class one file. In .Net
technology, one can define a single class over multiple files using the concept of partial classes. When an
application is compiled, it groups all the partial classes and considers them as a single object. This allows for
separation of concerns, e.g.: Aspx page class might have the UI code and the Aspx.cs class file has the code
for it.

E.g.:
public partial class MyClass
{
public void Attend()
{
}
}

public partial class MyClass


{
public void Dismiss()
{
}
}
Explain how to pass a querystring from an .asp page to aspx page.

Yes you can do it using a hyperlink


<a href="Abc.aspx?name=test">Click to go to aspx </a>
Next>>

Also Read
ASP.NET DataList Control

Using the DataList control, Binding images to a DataList control dynamically, Displaying data using the
DataList control, Selecting, editing and delete data using this control, Handling the DataList control
events..........

ASP.NET Methodologies

ASP.NET attempts to make the web development methodology like the GUI development methodology by
allowing developers to build pages made up of controls similar to a GUI. Server controls in ASP.NET function
similarly to GUI controls in other environments..........

Problems ASP.NET Solves

Microsoft developed ASP.NET, which greatly simplifies the web development methodology...........

ASP.NET issues & options

The truth is that ASP.NET has several issues that need to be addressed..........
Explain the advantages of ASP.NET

Web application exists in compiled form on the server so the execution speed is faster as compared to the
interpreted scripts.........
What Is ASP.NET 2.0 AJAX?

AJAX-style communications between client and server. This communication is over web services.
Asynchronous communication. All client-to-server communication in the ASP.NET 2.0 AJAX framework is
asynchronous................
The components in the ASP.NET 2.0 AJAX packaging

ASP.NET AJAX Futures Community Technology Preview (CTP) — The ASP.NET 2.0 AJAX framework contains a
set of functionality that is experimental in nature. This functionality will eventually become integrated with the
RTM/Core code.
Potential benefits of using Ajax

AJAX makes it possible to create better and more responsive websites and web applications...............
Potential problems with AJAX

Search engines may not be able to index all portions of your AJAX application site.........
What Is ASP.NET AJAX?

ASP.NET AJAX is the name of Microsoft’s AJAX solution, and it refers to a set of client and server technologies
that focus on improving web development with Visual Studio...............
Balancing Client and Server Programming with ASP.NET AJAX

With AJAX, much of the logic surrounding user interactions can be moved to the client. This presents its own
set of challenges. Some examples of AJAX use include streaming large datasets to the browser that are
managed entirely in JavaScript..................

Understanding Anonymous Types


Anonymous types defined with var are not VB variants. The var keyword signals the compiler to emit a strong
type based on the value of the operator on the right side. Anonymous types can be used to initialize simple
types like integers and strings but detract modestly from clarity and add little value..............
Model View Controller

We will learn about MVC design patterns, and how Microsoft has made our lives easier by creating the
ASP.NET MVC framework for easier adoption of MVC patterns in our web applications...............
MVC Design

MVC, which stands for Model View Controller, is a design pattern that helps us achieve the decoupling of data
access and business logic from the presentation code , and also gives us the opportunity to unit test the GUI
effectively and neatly, without worrying about GUI changes at all..........
Page Controller Pattern in ASP.NET

Here it shows how a page controller pattern works in ASP.NET.


Level
Question
Explain the namespaces in which .NET has the data functionality class.

System.data contains basic objects. These objects are used for accessing and storing relational
data........
Overview of ADO.NET architecture.

Data Provider provides objects through which functionalities like opening and closing connection,
retrieving and updating data can be availed.............
Difference between dataset and datareader.

DataSet object can contain multiple rowsets from the same data source as well as from the
relationships between them..........
Command objects uses, purposes and their methods.

The command objects are used to connect to the Datareader or dataset objects with the help of the
following methods.........
Explain the use of data adapter.

The data adapter objects connect a command objects to a Dataset object..............


What are basic methods of Dataadapter?

This method executes the SelectCommand to fill the DataSet object with data from the data
source...........
What is Dataset object? Explain the various objects in Dataset?

The DataSet object is a disconnected storage. It is used for manipulation of relational data.............
What are the steps involved to fill a dataset?

We fill it with data fetched from the data store. Once the work is done with the dataset, connection
is reestablished and the changes are reflected back into the store................
How can we check that some changes have been made to dataset since it was loaded?

The changes made to the dataset can be tracked using the GetChanges and HasChanges
methods..........
How can we add/remove row’s in “DataTable” object of “DataSet”?

‘NewRow’ method is provided by the ‘Datatable’ to add new row to it..............


How do we use stored procedure in ADO.NET and how do we provide parameters to the stored
procedures?
Explain the basic use of “DataView” and explain its methods.

A DataView is a representation of a full table or a small section of rows, it is used to sort and find
data within Datatable.
Differences between “DataSet” and “DataReader”.

DataSet object can contain multiple rowsets from the same data source as well as from the
relationships between them.......
Explain how to load multiple tables in a DataSet.
What is the use of CommandBuilder?

CommandBuilder builds “Parameter” objects automatically.........


What’s difference between “Optimistic” and “Pessimistic” locking?

In pessimistic locking, when a user opens a data to update it, a lock is granted....
How can we perform transactions in .NET?

Here are the general steps that are followed during a transaction....

What is connection pooling and what is the maximum Pool Size in ADO.NET Connection String?

A connection pool is created when a connection is opened the first time........


Can you explain how to enable and disable connection pooling?

To disable connection pooling set Pooling=false in connection string if it is an ADO.NET


Connection.........
Level
Question Level
What is the relation between Classes and Objects?

Class is a group of items, attributes of some entity. Object is any specific item that
may or may not be a part of the class.............
Explain different properties of Object Oriented Systems.

An object oriented system revolves around a Class and objects. A class is used to
describe characteristics of any entity of the real world..............

What is difference between Association, Aggregation and Inheritance relationships?

An Association is a relationship between similar objects or objects with common


structures. .............
Explain the features of an abstract class in NET.

An Abstract class is only used for inheritance. This means it acts as a base class for its
derived classes..............
Difference between abstract classes and interfaces

When a derived class is inherited from an Abstract class, no other class can be
extended then. Interface can be used in any scenario..............
Similarities and difference between Class and structure in .NET

Both Class and Structures can have methods, variables and objects..............
Features of Static/Shared classes.

Static classes are used when any change made to an object should not affect the data
and functions of the class..............
What is Operator Overloading in .NET?

Operator overloading is the most evident example of Polymorphism. In operator


overloading, an operator is ‘overloaded’.............
What is Finalize method in .NET?

Object.Finalize method in .NET is typically used to clean and release unmanaged


resources like OS files, window etc..............
What are the concepts of DISPOSE method?

Dispose method belongs to IDisposable interface. It is used to free unmanaged


resources like files, network connection etc..............

Also read
Concurrency with AOP

Concurrency is the system's ability to act with several requests simultaneously, such a
way that threads don't corrupt the state of objects when they gain access at the same
time............
Transparent caching with AOP
To get better results in terms of speed and resources used, it's suggested to use a
cache. We can store in it the results corresponding to the methods' invocations as
key-value pairs: method and arguments as key and return object as value..............
Security with AOP

Security is one of the most important elements of an application. The word "security"
covers two concepts: Authentication is the verifi cation's process of a principal's
identity; a principal is typically a user. A principal in order to be authenticated
provides a credential that is the password. Authorization, on the other hand, is the
process of granting authorities, which are usually roles, to an authenticated
user...........
Aspect-Oriented Programming

Explain the concepts and capabilities of Aspect-Oriented Programming, AOP.


What is Aspect in AOP?
AOP approach addresses Crosscutting concerns. Explain
The components of AOP are advices/interceptors, introductions, metadata, and
pointcuts. Explain them
AOP vs OOPs...........
What is Manifest in .NET?

Manifest in .NET helps to understand the relation between the elements of the
assemblies...........
What is garbage collection? How to force garbage collector to run?

Garbage collection helps in releasing memory occupied by objects. CLR automatically


releases these unused objects...........
Explain Boxing and Unboxing in .NET.

Boxing permits any value type to be implicitly converted to type object or to any
interface type Implemented by value type.............
What is Native Image Generator (Ngen.exe)?

Ngen.exe helps in improving performance of managed applications by creating native


images and storing them on the cache.............
Question Level

What is XML?

Answer - XML, Extensible Markup Language, is an open, text based markup language
that provides structural and semantic information to data...............
List the rules to be followed by an XML document.

Answer - They must have a root tag, the document should be well formed : the tags
should be properly closed, since XML is case sensitive, one should take care..............
Define DTD (Document Type definition).

Answer - XML DTD is a rule book that an XML document follows. Once DTD is ready,
you can create number of XML documents following the same rules..............
What is a CDATA section in XML?

Answer - The term CDATA is used when you dont want some text data to be parsed
by the XML parser. ..............
What is XSL?

Answer - XSL is a language for expressing style sheets. An XSL style sheet is a file
that describes the way to display an XML document...............
What is XQuery?

Answer - Xquery is a query language that is used to retrieve data from XML
documents...............
What is XMLA ?

Answer - It is a Microsoft specified XML-messaging-based protocol for exchanging


analytical data between client applications and servers..............
What is DOM?

Answer - DOM is an interface-oriented Application Programming Interface. It allows


for navigation of the entire document...............
What is XML Namespace?

Answer - An XSL sheet or a document may have duplicate elements and attributes.
Therefore, the XML namespaces define a way to distinguish between..............
XML interview questions - August 22, 2008 at 19:00 PM by Amit Satpute
What is XML data binding?

Answer - XML data binding refers to the process of representing the information in an
XML document as an object in computer memory...............
What is an XML encoding error?

Answer - XML documents can contain non ASCII characters, like Norwegian æ ø å , or
French ê è é which introduce errors...............
What is XML Serialization and Binary Serialization?
Answer - XML Serialization makes it possible to convert any common language
runtime objects into XML documents or streams and vise versa. ..............
How do you load data from XML file to a ORACLE table?

Answer - You need to first create a table in oracle that matches with the fields of the
XML data...............
What are XML indexes and secondary XML indexes?

Answer - The primary XML index is a B+tree and is useful because the optimizer
creates a plan for the entire query. ..............
What is the purpose of FOR XML in SQL Server?

Answer - SQL Server 2000 provides the facility to retrieve data in the form of XML
with the help of the FOR XML clause appended to the end of a SELECT
statement. ..............
What is EXtensible Application Markup Language (XAML)?

XAML is a markup language used to define dynamic or static UIs for .NET
applications.......
Advantages of XAML

Easy designing of a UI.....

How do we create the XSD schema?

While creating XML documents, it is important to structure the elements such as


name of the elements and datatypes which should be understood by application. Here
the need of XSD Schema is sought.

XSD schemas are the successors of DTD. The difference is that XSD itself uses a XML
syntax. XSD schemas allows to declare the structure of your XML documents. This
includes the inclusion of elements,attributes,mandatory and optional elements etc.

The XML document now should conforms the XSD schema.

Ex :

<?xml version="1.0"?>
<xs:schema targetNamespace=http://myorganization.org/MySchema.xsd
xmlns=http://myorganization.org/MySchema.xsd
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Employees">
<xs:complexType>
<xs:choice minOccurs="1" maxOccurs="unbounded">
<xs:element name="Employee" type="EmployeeType"/>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:complexType name="EmployeeType">
<xs:sequence>
<xs:element name="FirstName" type="xs:string"
minOccurs="1" maxOccurs="1"/>
<xs:element name="LastName" type="xs:string"
minOccurs="1" maxOccurs="1"/>
<xs:element name="Job" type="xs:string"
minOccurs="1" maxOccurs="1"/>
<xs:element name="EmailAddress" type="xs:string"
minOccurs="1" maxOccurs="1"/>
</xs:sequence>
<xs:attribute name="ID" form="unqualified" type="xs:string"/>
</xs:complexType>
</xs:schema>
What is the use of FOR XML in SQL Server?

SQL Server is having a fantastic feature to retrieve data persisted in the form of XML
format. The data in the XML format can be retrieved using FOR XML clause appending
to the SELECT statement.

It offers 3 modes.

* “FOR XML AUTO": Returns XML elements that are nested, based on which tables
are listed in the "from" part of the query, and which fields are listed in the "select"
part.
* "FOR XML RAW": Returns XML elements with the "row" prefix (ex: ""). Each
column in a table is represented as an attribute and null column values aren't
included.
* "FOR XML EXPLICIT": Explicit mode is the most complex shaping method used in
SQL Server 2000. It allows users to query a data source in such a way that the
names and values of the returned XML are specified before the query batch is
executed.

XML interview questions - Feb 28, 2009 at 14:00 PM by Vidya Sagar


What is the difference between SAX parser and DOM parser?

SAX

SAX is developed especially for java programs. It implements a model that is memory
resident. To access data from XML file, SAX follows top to bottom approach.

DOM is an open standard. The XML file is arranged in a tree fashion. DOM supports
random access to the data of XML file.
What is the difference between Schema and DTD?

DTD supports two types of data – CDATA and PCDATA. Schema supports numeric,
Boolean and String data types and suitable for applications that developed in a
programming language. Schema supports custom data types.

Schema supports encapsulation and inheritance concepts. Schema supports for WEB
services, XSLT.
How do you parse/validate the XML document?

Parsing the XML document is the only way to validate the XML file. Validation is done
by either DOM parser or the SAX parser.
What is XML template?
A transformation rule describes a style sheet. Transmission rule is a combination of a
pattern and a template. An XML template is a structure that is to be instantiated in a
result tree. If a pattern in source tree is matched, the corresponding pattern will be
generated in the result tree.
What is Xpath?

XPath specifies the path in the XML document which has hierarchical elements. XPath
is used with XPointer and XSLT and parser.
What is XML template?

XML templates are XML files such as XHTML files. XML templates includes the
processing directives which affect how the template is rendered, and the template
expressions which are substituted dynamically by various data.
What are the steps to transform XML into HTML using XSL?

The xsl:output element specifies how to display the result tree. The XSL processor
produces the output result tree. It should be specified by xsl:output element. The
method attribute of xsl:output specifies the overall process to produce the result tree.
The HTML output method results the tree as HTML document.
Next >>

Also read
What is XPath?

XPath is a language for addressing an XML document's elements and attributes. As an


example, say you receive an XML document that contains the details of a shipment
and you want to retrieve the element/attribute values from the XML document.........
SQL Server 2005 XML support

Explain the concepts and capabilities of SOAP. Explain the purpose of Native XML
mode in SQL Server 2005.
Native XML Access vs. SQLXML.
Benefits of Native XML Access in SQL Server 2005.
Limitation for Native XML Web Services.
XML Data type implementation in SQL Server 2005

What is Untyped XML?


Provide examples for : Create a table with a untype XML column, Insert into an
untyped XML data type column
What is typed XML?
The XML data type comes with five methods. Explain them
Differentiate between Untyped XML and Typed XML.
Explain with an example how to apply defaults constraint to an XML data type
column.
You can add constraints to XML data type columns. Illustrate with an example.
Querying and modifying XML data in SQL Server 2005

What is XQuery language?


Explain the syntax rule of XQuery language.
XQuery expression contains two parts: the Prolog and the Body. Explain them
Explain PATH expression in XQuery with an example.
What is XML?

Answer
XML, Extensible Markup Language, is an open, text based markup language that
provides structural and semantic information to data. XML is a metalanguage that can
be used to create other language. It is used to structure and describe data that can
be understood by other applications. Using XML, we can separate the user interface
from data.

Features of XML
XML is a generalized markup language that means one can define his/her own tag
sets.
A valid XML document contains rules and is self-describing.
The rules that are found in DTD allow the documents to be validated.
Describe the logical structure of XML.

Answer
XML documents comprise of declaration, elements and comments

XML Declaration
It identifies the version to which XML conforms
<?xml version = "1.0"?>

Document Type Declaration


It consists of markup code that indicates grammar rules or Document Type Definition
(DTD) for the particular class of document.
<! DOCTYPE Car SYSTEM "cr.dtd">

This statement tells the XML processor that the document is of the class Car that
conforms the rules specified in the DTD "cr.dtd".

Document element
The document element contains data of an XML document.
Why is XML so popular?

Answer
Due to the following advantages of using XML, it has become popular:

* It supports Unicode. Therefore documents written in any human language can be


communicated.
* Data structures: records, lists and trees can be represented using XML.
* Its format describes structure, field names and their specific values too. Its
therefore called self-documenting.
* Its syntax and parsing requirements make the necessary parsing algorithms very
simple, efficient, and consistent.
* It can be used as a document storage and processing format.
* It is platform-independent.
*

Why is XML referred as self-describing data?

Answer
Text labels inside of XML's syntactic delimiters that cause most people to think that
XML is self-describing. But these tags aren't part of XML.

Choosing the terms used for tags or naming anything is often a difficult and
contentious activity. Everyone naturally creates names that make sense to them.

However, XML is not self describing.


Why is XML extensible?

Answer
Extensibility is another attribute of XML. XML is short of "eXtensible Markup
Language. This is so because a developer may easily create his own XML syntax for
any applications he wishes to use it for. Any other developer, once having learned
how to use his own language's XML parsing routines, can use any XML-based format
currently available.
XML is a secured language for information exchange over the network. Explain

Answer
Applications require a secure exchange of structured data. XML encryption can ensure
this by providing end-to-end security as it is iitself a widely used data structuring
technology.

XML encryption addresses the issues not covered in by the TLS which are encrypting
part of the data that is being exchanged and secure sessions between multiple
parties.

XML Encryption can handle XML as well as binary data.

List the rules to be followed by an XML document.

Answer
Following rules need to be followed by an XML document:

They must have a root tag, the document should be well formed : the tags should be
properly closed, since XML is case sensitive, one should take care that the documents
are written with proper care and the attribute values should be inside “”
Explain about XML Canonicalization.

Answer
Canonicalization refers to finding the simplified form of an XML document.

XML files may not contain the same sequence of characters (bytes or octets) even if
they are logically equivalent. This is where we need to canonicalize them and check
their canonical forms.

Steps to canonicalize an XML document

* Encoding schemes should represent characters by octets.XML documents should


be encoded in UTF-8 encoding.
* The canonical form needs all line breaks to be #xA.
* All attributes need to be normalized in canonical form.
Define DTD (Document Type definition).

Answer
DTD - Document Type Definition defines the legal building blocks of an XML
document.

It defines the document structure with a list of legal elements and attributes.

XML DTD is a rule book that an XML document follows. Once DTD is ready, you can
create number of XML documents following the same rules specified in the DTD. DTD
can be internal or external DTD. The internal DTD is included in the XML document,
while external DTD exists outside the content of the documents.
Explain DTD and schema.

Answer
A DTD provides a list of the elements, attributes, comments, notes, and entities
contained in an XML or HTML document and indicates their relationship with each
other.

The 'DOCTYPE' tells the browser that it is a Document Type Declaration

Some commonly used attribute types are

* CDATA The value is character data


* ID The value is a unique id
* IDREF The value is the id of another element
* IDREFS The value is a list of other ids

Schema means the organization and the structure of a database.

E.g.: An XML schema is a description of XML document. It is expressed in terms of


constraints on the structure and content of documents.
XML XML DTD - Jan 14, 2009 at 14:00 PM by Nishant Kumar
Define XML DTD.

XML DTD is a rule book that an XML document follows. Once DTD is ready, you can
create number of XML documents following the same rules specified in the DTD. DTD
can be internal or external DTD. The internal DTD is included in the XML document,
while external DTD exists outside the content of the documents.

What is a CDATA section in XML?

Answer
CDATA - (Unparsed) Character Data
The term CDATA is used when you dont want some text data to be parsed by the XML
parser.

A CDATA section starts with "<![CDATA[" and ends with "]]>":


XML - CDATA section in XML - Jan 14, 2009 at 14:00 PM by Vidya Sagar
What is a CDATA section in XML?
The CDATA section of XML is used to describe the text that should not be parsed by
the XML parser.

The characters like "<" ">" are not supported in XML


< will cause an error by the parser. Because the parser identifies < as the starting
character for an element.

Any text that is included in CDATA section is ignored by the parser.


Example :
<![CDATA[" < and > are used to enclose an element in XML "]]>

Define XSLT.

XSLT language is used for transforming XML documents into XHTML documents. It
also transforms XML into another XML document.
What is XPATH?

XPath is a language that is used to navigate through XML documents.It can find
information in an XML document like elements and attributes.
Define XMLReader Class.

The XMLReader Class (Assembly: System.Xml.dll) represents a reader that provides


fast, non-cached, forward-only access to XML data.
Define XMLValidatingReader class.

The XMLValidatingReader class (Assembly: System.Xml.dll) represents a reader that


provides:

- Document type definition (DTD),


Err:508
Err:508
What is Windows Communication Foundation, WCF?

WCF helps in building applications to communicate with each other. It is a framework that helps in
managing distributed computing. WCF has a layered architecture. It is a part of the .Net Framework 3.0
What are the components of WCF?

Components of WCF

1. Contracts and descriptions: - Describes different features of messaging. The features are described by
Data contract, message contract, service contract and policy and binding.

2. End points or Service runtime: - This describes the actual behavior or operation of the service at
runtime. The behaviors are identified by throttling behavior, error behavior, metadata behavior, instance
behavior etc.

3. Messaging: - Processing and authentication of messages through channels takes place. Transport and
protocol channels are used for the same.

4. Hosting environments: - Hosting environments like IIS, Windows services, consoles are used for
hosting.
What is the difference between WCF and Web services?

WCF has a variety of distributed programming infrastructures. WCF offers more flexibility and portability.
WCF has better security mechanisms as compared to Web services. Transportation is easier in WCF .
What is duplex contracts in WCF?

WCF allows duplex messaging pattern. Services can communicate with client through a callback. Duplex
messaging in WCF can be done over different transports, like TCP, Named Pipes and even HTTP
What are different binding supported by WCF?

Different bindings
Built- in bindings and custom bindings. When the built in or system provided bindings are not suited for
the requirement, custom bindings can be sued.

The system –Provided bindings are:


1. BasicHttpBinding:- uses HTTP for transport .
2. WSHttpBinding:- Used for non duplex services
3. WSDualHttpBinding:- Used for Duplex services
4. NetTcpBinding:- Used for cross machine communication
5. NetPeerTcpBinding:- Used for multiple machine communication
6. NetMsmqBinding:- queued binding Used for multiple machine communication
How do we use MSMQ binding in WCF?

Message queue allows applications running at different times to send and read messages from queues.
WCF uses transactional queue to capture messages, delivered and stored. A non transactional queue can
be used as well, though it does not guarantee the assurance of messages being transferred.
netMsmqBinding defines a queued binding. This can be used for cross machine communication. Properties
of netMsmqBinding allow sending and receiving of messages
Explain volatile queues and Dead letter queues.
WCF also uses non transactional queues for storing messages. Such queues are volatile in nature. They
are stored in memory and not used in transactions. On shutting down the machine, the queue is lost. They
don’t guarantee the transfer of messages.

Dead letter queues: - Dead letter queues are used for failed or dead messages. When a message delivery
fails, it is stored in a dead letter queue. MSMQ has two types of dead letter queues recording failed
messages for transactional systems and non transactional systems.
What are the various ways of hosting a WCF service?

Ways of hosting WCF Service

1. Self hosting: - The service code is embedded within the application code. An end point for the service is
defined and an instance of SeriveHost is created. A method can be written then to call the service.

2. Managed Windows services: - here, some hosting code is written in the application code. It consists of
registering the application domain as a windows service.

3. Internet Information Services: - Does not require any hosting code to be written in the application
code. IIS host services can only use HTTP transport mechanism. IIS needs to be installed and configured
on the server.

4. Windows process activation service:- Does not require any hosting code to be written in the application
code. WAS needs to be installed and configured on the server. WCF uses the listener adapter interface to
communicate activation requests. Requests are transported over non HTTP protocols.
Explain transactions in WCF.

Transactions in WCF allow several components to concurrently participate in an operation. Transactions


are a group of operations that are atomic, consistent, isolated and durable. WCF has features that allow
distributed transactions. Application config file can be used for setting transaction timeouts.
What are the various programming approaches for WCF?

Programming approaches for WCF

Imperative: - Different programming languages can be sued for implementing service logic
Configuration based:- Config files can be used to accomplish a task and end points along with security
settings
Attributes can be used for declaration for behaviors and contracts
What are the advantages of hosting WCF services in IIS?

Advantages of hosting WCF services in IIS

1. Provides process activation and recycling ability thereby increasing reliability


2. It is a simplified way of deployment and development of hosted services.
3. Hosting WCF services in IIS can take advantage of scalability and density features of ASP.NET
What are different isolation levels provided in WCF?

The different isolation levels:


1. READ UNCOMMITTED: - An uncommitted transaction can be read. This transaction can be rolled back
later.
2. READ COMMITTED :- Will not read data of a transaction that has not been committed yet
3. REPEATABLE READ: - Locks placed on all data and another transaction cannot read.
4. SERIALIZABLE:- Does not allow other transactions to insert or update data until the transaction is
complete.
What are design patterns? Define basic classification of patterns.

A design pattern in Software is used to solve similar problems that occur in different scenarios.
What is the difference between Factory and Abstract Factory Patterns?

The difference between Factory and Abstract Factory Patterns lies in object instantiation. In Abstract factory pat
Composition..........
What is MVC pattern?

Model View Controller is used to separate the interface from the business logic so as to give a better visual appe
How can we implement singleton pattern in .NET?

Singleton pattern restricts only one instance running for an object..........


How do you implement prototype pattern in .NET?

Prototype pattern is used to create copies of original instances known as clones. It is used when creating instan
complex.......
What is aspect oriented programming? What is cross cutting in AOP?

When A computer program is broken into distinct features that overlap in functionality is called as Separation of
oriented programming (AOP) aims to improve the.........
What is Windows DNA architecture?

Windows Distributed internet Applications architecture provides a robust, efficient solution to enable Windows p
What is Service Oriented architecture?

Service oriented architecture is based on services. Service is a unit of some task performed by a service provide
the consumer.............
What is three tier architecture?

Three tier architecture typically consists of a client, server and “agent” between them. The agent is responsible
results and returning..............
Explain the situations you will use a Web Service and Remoting in projects.

Web services should be used if the application demands communication over a public network and require to wo
platforms......................

Describe the .Net base class library.

Answer
The .NET Framework class library is a library of classes, interfaces, and value types.

This library system functionalities and is the foundation of .NET Framework applications, components, and contr
What is the difference between value types and reference types?

Answer

Err:508
Err:508
Err:508
Err:508

Err:508
Err:508

-In .NET, when you pass a variable by value, the syntax would be: (ByVal a as datatype)
Err:508

Explain CLR in brief.

Answer

CLR stands for Common Language Runtime.

The CLR is a development platform. It provides a runtime, defines functionality in some libraries, and supports
languages. The CLR provides a runtime so that the softwares can utilize its services. The CLR Base Class Library
with the runtime. The CLR supports various programming languages, several standards and is itself been submi
standard.
Describe how a .Net application is compiled and executed.

Answer
From the source code, the compiler generates Microsoft Intermediate Language (MSIL) which is further used fo
EXE or DLL. The CLR processes these at runtime. Thus, compiling is the process of generating this MSIL.

The way you do it in .Net is as follows:

Right-click and select Build / Ctrl-Shift-B / Build menu, Build command


F5 - compile and run the application.
Ctrl+F5 - compile and run the application without debugging.

Compilation can be done with Debug or Release configuration. The difference between these two is that in the d
only an assembly is generated without optimization. However, in release complete optimization is performed wi
Describe the parts of assembly.

Answer
An assembly is a partially compiled code library. In .NET, an assembly is a portable executable and can be an E
assembly) or a DLL (library assembly). An assembly can consist of one or more files or modules in various lang
deployment, versioning and security.
.NET common language runtime - April 30, 2009 at 22:00 PM by Amit Satpute
Overview of CLR integration.

The CLR (Common Language Runtime) integration is hosted in the Microsoft SQL Server 2005.
With CLR integration, stored procedures, triggers, user- defined functions, user-defined types, and user-defined
managed code, etc can be written.
As managed code compiles to native code before executing, significant performance can be achieved.
The SQL Server acts as an operating system for the CLR when it is hosted inside SQL Server.

Following are the steps to build a CLR stored procedure in SQL Server 2005

* Enable CLR integration in SQL Server 2005


* Create a CLR stored procedure Assembly
* Deploy the Assembly in SQL Server 2005
* Create and execute the CLR stored procedure in SQL Server 2005

Describe how to create and use array in .NET.

Arrays treat several items as a single collection.

Following are the ways to create arrays:

Declaring a reference to an array


Int32[] a;

Create array of ten Int32elements


b = new Int32[10];

Creating a 2-dimensional array


Double[,] c = new Double[10, 20];

Creating a 3-dimensional array


String[,,] d = new String[5, 3, 10];
Define Constants and Enumerations in .NET.

Constants are values which are known at compile time and do not change.

Example:
Module Module1
Sub Main()
Const abc = "100.00"
Console.WriteLine(abc)
End Sub
End Module

An enumeration is a named constant. Enum provides methods to:

* compare instances of classes,


* convert the instance values to strings,
* convert strings to an instance of a class,
* create instance of a specified enumeration and value.

Explain collection in .NET and describe how to enumerate through the members of a collection.

There are various collection types in .NET which are used for manipulation of data. Collections are available in S
namespace

IEnumerator is the base interface for all enumerators. Enumerators can only read the data from the data collec
them. Reset and MoveNext are the methods used with enumerators which bring it back to the first position and
element position respectively. Current returns the current object.
Summarize the similarities and differences between arrays and collections.

The Array class is not part of the System.Collections namespaces Collections are. But an array is a collection, as
IList interface.
Array has a fixed capacity but the classes in the System.Collections namespaces don’t.

However, only the system and compilers can derive explicitly from the Array class. Users should use the array c
the language that they use.
Briefly describe the two kinds of multidimensional arrays in .NET.

There are two types of multidimensional arrays:

Rectangular arrays
These multidimensional arrays have all the sub-arrays with a particular dimension of the same length. You need
square brackets for rectangular arrays.

Jagged arrays
These multidimensional arrays have each sub-array as independent arrays of different lengths. With these you
separate set of square brackets for each dimension of the array.

You might also like