Sei sulla pagina 1di 45

abeda_07@yahoo.co.in,madu_ruby2000@yahoo.co.in,vijetha_k28@yahoo.co.

in

INDEX

1. C#
2. ASP.NET/ADO.NET
3. IIS
4. ASP2
5. SQL
6. XML and WebServices
7. COM/DCOM
8. .Net Framework
9. UML

ASP.NET/ADO.NET Top

1. Diff between Server transfer/ Server Execute AND Response.Redirect?

Server.Transfer: End the current Web form and begin executing a new Web form. This method
works only when navigating to a Web Forms page (.aspx).
Server.Execute: Begin executing a new Web form while still displaying the current Web form.
The contents of both forms are combined. This method works only when navigating to a Web
Forms page (.aspx).

Response.Redirect: Navigate to another page from code. This is equivalent to clicking a


hyperlink.This for Html pages

2. Custom errors in ASP.NET

Exceptions are unusual occurrences that happen within the logic of an application. Errors that are
not dealt with in code are called unhandled exceptions. Use GetLastError to get the last exception
value. There are three approaches to handling exceptions in a Web application:

• Use exception-handling structures to deal with exceptions within the scope of a procedure.
This technique is called structured exception handling (SEH) in the Visual Studio .NET
documentation. Use Try, Catch and Finally to handle Exceptions. Finally block is always
executed. If an exception occurs in the “Finally" block then it becomes an Unhandled Exception.

• Use error events to deal with exceptions within the scope of an object. Error events let you
handle exceptions for an entire object in a single, centralized location--the error event procedure.
o Page_Error: An unhandled exception occurs on the page. This event procedure resides in the
Web form.

o Global_Error: An unhandled exception occurs in the application. This event procedure resides
in the Global.asax file.

o Application_Error: An unhandled exception occurs in the application. This event procedure


resides in the Global.asax file.

• Use custom error pages to display informational messages for unhandled exceptions within
the scope of a Web application

o Specify application-wide error page settings in the customErrors section of the Web.config
file.

o Specify an error page for a specific Web form in the ErrorPage attribute of the Web form's @
Page directive.

3. Pageclass life cycle and Page Events:

Page_Init: The server controls are loaded and initialized from the Web form's view state. This is
the first step in a Web form's life cycle.

Page_Load: The server controls are loaded in the Page object. View state information is
available at this point, so this is where you put code to change control settings or display text on
the page.

Page_PreRender: The application is about to render the Page object.

Page_Unload: The page is unloaded from memory.

Page_Disposed: The Page object is released from memory. This is the last event in the life of a
Page object.

4. User controls vs custom controls

1. Web user controls

These combine existing server and HTML controls by using the Visual Studio .NET Designer to
create functional units that encapsulate some aspect of the user interface. User controls reside
in content files, which must be included in the project in which the controls are used.

2. Composite Custom controls


These create new controls from existing server and HTML controls. Although similar to user
controls, composite controls are created in code rather than visually, and therefore they can be
compiled into an assembly (.dll), which can be shared between multiple applications and
used from the Toolbox in Visual Studio .NET.

3. Rendered Custom controls

These create entirely new controls by rendering HTML directly rather than using composition.
These controls are compiled and can be used from the Toolbox, just like composite controls, but
you must write extra code to handle tasks that are performed automatically in composite
controls.

5. If we have a web service how does the client know if the location of the web
service is changed?? Ans: Using the URL property.
6. What is a DataProvider?

A data provider is a set of classes that provide access to databases. The main components of
data providers are:

a. Connection (SQL connection or OleDb Connection)

b. Command (contains 3 methods, Execute Query,ExecuteScalar and Execute Reader)

c. DataReader (This is returned when Command object's Execute Reader executes)

d. DataAdapter

7. What is DataSet?
The DataSet is a disconnected, in-memory representation of data. The DataSet
persists in memory, and the data therein can be manipulated and updated independent of
the database. A DataSet object contains DataTables,

A DataSet contain

4. DataTable (each of which is an in-memory representation of a single table.)


5. DataRelations Collection (define the relationships between tables in the DataSet)

And DataTables contain

6. DataColumns Collection (enumerates the columns in a particular table)


7. DataRow Collections (It contains actual Data)
8. Constraint Collection (enumerates any constraints on the table)

8. What does Command object have in ADO.Net?


The Command object executes a command against a data source. It can execute non-
query commands, such as INSERT, UPDATE, or DELETE, or return a DataReader with
the results of a SELECT command. The Command object is represented by two
corresponding classes: SqlCommand and OleDbCommand. Command objects provide
three methods that are used to execute commands on the database:

• ExecuteNonQuery:

Executes commands that return no records, such as INSERT, UPDATE, or DELETE

• ExecuteScalar:

Returns a single value from a database query

• ExecuteReader:

Returns a result set by way of a DataReader object

9. What are the Namespaces that ADO.Net Uses?

System.Data Classes, types, and services for creating and accessing data sets
and their subordinate objects
System.Data.SqlClient Classes and types for accessing Microsoft SQL Server databases
System.Data.OracleClient Classes and types for accessing Oracle databases (Microsoft
.NET Framework version 1.1 and later)
System.Data.OleDb Classes and types for accessing other databases
10. Differenece between DataSet and DataReader and which is faster?

DataSet is disconnected in-memory representation of data, whereas DataReader is read-only,


forward-only connected stream of record set. Since only one row is present in memory at a time,
it presents lowest overhead, but it has to be connected for the life time of a DataReader.
DataReader is faster.

11. How to deal with many-many relation ships in ADO.NET

??????????????

12. IsPostback vs viewstate?

IsPostBack gets a value indicating whether the page is being loaded in response to a client
postback, or if it is being loaded and accessed for the first time. true if the page is being loaded in
response to a client postback; otherwise, false.
View State is the mechanism ASP.NET uses to keep track of server control state values that
don't otherwise post back as part of the HTTP form. It's a hidden form field managed by the
ASP.NET page framework.

13. A Windows application, say myapp.exe when complied what files are generated?
14. what is a typed dataset?

If an XML schema is attached to a dataset then its called a Typed dataset.

15. What are the three Objects of ADO?

The 3 objects of ADO are Command object, Connection object and Recordset object.

16. Problems in Debugging?

Open Question

17. Server Side Controls and what is the diff between Server controls and HTML
controls?

Server controls HTML controls

Server events Trigger control-specific events on the server. Can trigger only page- level
events on server (postback).
State Data entered in a control is maintained Data is not maintained; must
management across requests. be saved and restored using
page-level scripts.
Adaptation Automatically detect browser and adapt No automatic adaptation;
display as appropriate. must detect browser in code
or write for least common
denominator.
Properties The Microsoft .NET Framework provides a HTML attributes
set of properties for each control. Properties
allow you to change the control's
appearance and behavior within server-side
code.

18. Code behind pages?

Its used for separating the code and the html. You specify in @page directive. The syntax
goes like this. <% @page language=C# codebehind=”somewebform.aspx.cs” ..%> Code-
behind files are pre-compiled modules written in any of the Microsoft .NET runtime compliant
languages
19. What are Configuration files and how many are there? Which config file replaces
web.config file?

A configuration file is an XML document that contains predefined elements. An element is a


logical structure. It sets the configuration information and is represented by using start and end
tags. There are 3 Config files.

• Machine configuration, Machine.config file.

This file is located in the %runtime installation path%\Config directory and contains settings that
affect all the applications that run on the machine. This file contains an element called
<appSettings>. This element contains application-specific settings, which you can modify to
define the settings required by your application. When you run an application, the runtime checks
for any additions made to the system configuration file and then checks the settings in the
application configuration file.

• Application configuration file.

This file contains the settings required to configure an individual application. For ASP.NET-
hosted applications, the configuration file is named Web.config and is located in the Web
application folder. It contains fields like authuentication, authorization, custom errors, tracing etc.

1. Security configuration files.

The security configuration files contain security permissions for a hierarchy of code groups.
Code groups are logical groups of code that are related to each other through common
characteristics such as application directory, strong name, URL, site, and zone.

Machine.config replaces Web.config file.

20. What are differenences between OLEDB/Sql Client?

OleDb is used for databases other databases like Oracle etc and also for Sql Server 6.0 or lower.
SQL client is used to access Sql Server 7.0 and above.

21. What is Application and Session Handling?

The data that ASP.NET preserves between requests is called the Web form's View state. By
default, a Web form's view state is available only within that Web form. To make data entered on
a Web form available to other Web forms in an application, you need to save the data in a state
variable in the Application or Session objects. These objects provide two levels of scope:

• Application state variables


These are available to all users of an application. You can think of Application state as multiple-
user global data. All sessions can read or write these variables.

• Session state variables

These are available only to a single session (user). Session state is like global data in a standard
Windows application. Only the current session has access to its Session state.

22. what is the difference between HashTables/arrays


Represents a collection of key-and-value pairs that are organized based on the hash
code of the key. Arrays are a way to manage groups of similarly typed values or objects.
23. cookies and Session difference

Cookies are used to store small amounts of information on a client. A small file that a Web
application can write to the client's computer. Cookies are used to identify a user in a future
session or to store and retrieve information about the user's current session. Clients might refuse
cookies, so the code has to anticipate that possibility.

ASP.NET stores items added to a page's ViewState property as hidden fields on the page.

24. JavaScript in Server Side Code?

???

25. Performance of Program??


26. Assembly vs DLL created in .NET an Assembly if so why?
27. Can an assembly be an exe in .NET? Yes
28. What is use of culture info?

It represents information about a specific culture including the names of the culture, the writing
system, and the calendar used, as well as access to culture-specific objects that provide
information for common operations, such as formatting dates and sorting strings.

29. Way of sharing sessions between ASP and ASP.NET?

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/converttoaspnet.asp

30. Can we have 2 form tags in single aspx page? Why/Whynot?

????

31. What are the lock-types available in ADO. Explain.

adLockReadOnly (1) - Indicates read-only records. You cannot alter the data.
adLockPessimistic (2) - Indicates pessimistic locking, record by record. The provider does what is
necessary to ensure successful editing of the records, usually by locking records at the data
source immediately after editing.
adLockOptimistic (3) - Indicates optimistic locking, record by record. The provider uses optimistic
locking, locking records only when you call the Update method.
adLockBatchOptimistic (4) - Indicates optimistic batch updates. Required for batch update mode.
adLockUnspecified (-1) - Does not specify a type of lock. For clones, the clone is created with the
same lock type as the original.

32. What are the cursor types available in ADO.Explain.

adOpenForwardOnly (0) - Default. Uses a forward-only cursor. Identical to a static cursor, except
that you can only scroll forward through records. This improves performance when you need to
make only one pass through a Recordset.
adOpenKeyset (1) - Uses a keyset cursor. Like a dynamic cursor, except that you can't see
records that other users add, although records that other users delete are inaccessible from your
Recordset. Data changes by other users are still visible.
adOpenDynamic (2) - Uses a dynamic cursor. Additions, changes, and deletions by other users
are visible, and all types of movement through the Recordset are allowed, except for bookmarks,
if the provider doesn't support them.
adOpenStatic (3) - Uses a static cursor. A static copy of a set of records that you can use to find
data or generate reports. Additions, changes, or deletions by other users are not visible.
adOpenUnspecified (-1) - Does not specify the type of cursor.

Ex: Set Rs = Server.CreateObject("ADODB.Recordset")

Rs.CursorType = adOpenDynamic

33. What is the default language of ASP.

VbScript.

34. What's name of the asp.net process ?

it's aspnet_wp.

35. Explain the differences between Server-side and Client-side code?

Server side code executes on the server and client side code runs on the client machine. Scripts
run on Client side. Client side code is written in like VBScript or JavaScript.

36. What type of code (server or client) is found in a Code-Behind


class?

Server side code


37. Should validation (did the user enter a real date) occur
server-side or client-side? Why?

The validation controls check the validity of data entered in associated server controls on the
client before the page is posted back to the server. This is an important improvement to previous
validation schemes--most validity problems can be caught and corrected by the user without a
round-trip to the server.

Server-side validation is always performed, whether or not client-side validation has


occurred. This double-checking ensures that custom validations are performed correctly and that
client-side validation has not been circumvented.

The Field validators are Require field Validator, CompareValidator, RangeValidator et

38. What does the "EnableViewState" property do? Why would I want it on or off?

EnableViewState enables the Page's ViewState to be saved between the page reuests. To turn
off state management for a server control, set the control's EnableViewState property to False.

39. Can you give an example of when it would be appropriate to use a


web service as opposed to a non-serviced .NET component?

When there is no need for a UI to perform the required task.

40. Let's say I have an existing application written using Visual


Studio 6 (VB 6, InterDev 6) and this application utilizes Windows 2000
COM+ transaction services. How would you approach migrating this
application to .NET
41. Can you explain the difference between an ADO.NET Dataset and an
ADO Recordset?

DataSet is a collection of Data Tables and its disconnected. A recordset looks like a single
table. If a recordset is to contain data from multiple database tables, it must use a JOIN query,
which assembles the data from the various database tables into a single result table. ADO is used
for Connected access.

42. Can you give an example of what might be best suited to place in
the Application_Start and Session_Start subroutines?

43. If I'm developing an application that must accomodate multiple


security levels though secure login and my ASPNET web appplication is
spanned across three web-servers (using round-robbin load balancing)
what would be the best approach to maintain login-in state for the
users?
44. What are ASPNET Web Forms? How is this technology different than
what is available though ASP (0-0)?
45. How does VBNET/C# achieve polymorphism?

Through Interface and Inheritance

46. Can you explain what inheritance is and an example of when you
might use it?
47. How would you implement inheritance using VBNET/C#?
48. Whats an assembly?
An assembly is a self-describing collection of code, resources, and metadata. The
assembly manifest contains information about what is contained within the assembly.
49. Describe the difference between inline and code behind - which is
best in a loosely coupled solution?
Code behind is loosely coupled.

Code Behind Single File


The HTML and controls are in the .aspx file, and the The code is in <script> blocks in the same
code is in a separate .aspx.vb or .aspx.cs file. .aspx file that contains the HTML and controls.
The code for the page is compiled into a separate The .aspx file derives from the Page class.
class from which the .aspx file derives.
All project class files (without the .aspx file itself) are When the page is deployed, the source code is
compiled into a .dll file, which is deployed to the deployed along with the Web Forms page,
server without any source code. When a request for because it is physically in the .aspx file.
the page is received, then an instance of the project However, you do not see the code, only the
.dll file is created and executed. results are rendered when the page runs.
50. Explain what a diffgram is, and a good use for one?

An XML format. Can be used by other platforms so send and receive data to a .NET application

51. Where would you use an iHTTPModule, and what are the limitations
of any approach you might take in implementing one
????????
52. What the disadvantages are of viewstate/what are the benefits?

Because ViewState stores data on the page, it is limited to items that can be serialized. If you
want to store more complex items in ViewState, you must convert the items to and from a string.

53. Describe session handling in a webform, how does it work and what
are the limits?
54. How would you get ASPNET running in Apache web servers - why
would you even do this?
55. Whats MSIL, and why should my developers need an appreciation of
it if at all?
56. In what order do the events of an ASPX page execute As a
developer is it important to undertsand these events?
57. Which method do you invoke on the DataAdapter control to load your
generated dataset with data?
Fill Method
58. Can you edit data in the Repeater control?
Yes
59. Which template must you provide, in order to display data in a
Repeater control?
ItemTemplate
60. How can you provide an alternating color scheme in a Repeater
control?
AlternatingItemTemplate
61. What property must you set, and what method must you call in your
code, in order to bind the data from some data source to the Repeater
control?
Set the datasource property and call the DataBind method
62. What base class do all Web Forms inherit from?
Page...but all .NET objects inherit form the Object Base Class.
63. What method do you use to explicitly kill a user s session?
Session.Contents.Remove
64. How do you turn off cookies for one page in your site?
You can't (not that I am aware of...since there is no Page level directive to do this)
65. Which two properties are on every validation control?
66. What tags do you need to add within the asp:datagrid tags to bind
columns manually?
Set AutoGenerateColumns Property to false on the datagrid tag
67. How do you create a permanent cookie?
68. What tag do you use to add a hyperlink column to the DataGrid?
69. What is the standard you use to wrap up a call to a Web service
70. Which method do you use to redirect the user to another page
without performing a round trip to the client?
71. What is the transport protocol you use to call a Web service SOAP
72. True or False: A Web service can only be written in NET
73. What does WSDL stand for?
74. What property do you have to set to tell the grid which page to go
to when using the Pager object?
75. Where on the Internet would you look for Web services?
76. What tags do you need to add within the asp:datagrid tags to bind
columns manually
77. Which property on a Combo Box do you set with a column name, prior to setting
the DataSource, to display data in the combo box?
78. How is a property designated as read-only?
79. Which control would you use if you needed to make sure the values
in two different controls matched?
80. True or False: To test a Web service you must create a windows
application or Web application to consume this service?
81. How many classes can a single NET DLL contain?
82. What is the role of global.asax?

C# Top

1. Abstract class/interface

An Abstract class is that cannot be instantiated. An abstract class is a class that must be inherited
and have the methods overridden. An abstract class is essentially a blueprint for a class without
any implementation.

An Interface is an abstract class with public abstract methods all of which must be implemented in
the inherited classes. It's a

2. Constructors/destructors

Constructors allow initialization code to perform for a class. A class constructor first creates a new
instance of that class on the heap and then performs initialization.

3. What are the diff acesss modifiers are in constructors?

Public, Private and Protected.

4. Design patterns? single ton, single class, dispose, finailize


5. Two places where “using” keyword is used?

To use namespaces in your project we use “Using”.

6. Convert string builder class to string?


A string is a sequential collection of Unicode characters, The value of the String is
the content of the sequential collection, and the value is immutable.

A String is called immutable because its value cannot be modified once it has been created.
Methods that appear to modify a String actually return a new String containing the modification.

StringBuilder class represents a string-like object whose value is a mutable sequence of


characters. The value is said to be mutable because it can be modified once it has been created
by appending, removing, replacing, or inserting characters.

Most of the methods that modify an instance of this class return a reference to that same
instance. Since a reference to the instance is returned, you can call a method or property on the
reference. This can be convenient if you want to write a single statement that chains successive
operations one after another.

A StringBuilder can allocate more memory as needed to store characters when the value
of an instance is enlarged, and the capacity is adjusted accordingly. The amount of memory
allocated is implementation-specific, and ArgumentOutOfRangeException is thrown if the amount
of memory required is greater than the maximum capacity.

The capacity of a StringBuilder is the maximum number of characters the instance can store at
any given time, and is greater than or equal to the length of the string representation of the value
of the instance. The capacity can be increased or decreased with the Capacity property or
EnsureCapacity method, but it cannot be less than the value of the Length property.

7. Base, new keywords in inheritance?

New keyword in C# is used to hide the implementation of the Base class and to provide a
new implementation. The access modifier of the new class can be different.

8. what is Class Inheritance?

We can create new classes by inheriting the features (i.e. methods and properties) of a base
class along with adding our own features to represent that class as a more realistic entity. For
example If class B inherits from class A, then B is said to be derived from A then the class B has
all the features present in class A.

9. What languages are supported in .Net?

The languages C#, C++, VB, J# are the most popular ones supported by .NET. There are around
2 dozens of languages supported by .NET to-date.

10. How do u make a function not inheritable? Sealed


11. How do u make a class not instaniable? Private
12. If a class is declared as private then who can instantiate? Where this scenario
comes? Nested classes.
13. what is Protected Internal mean? See next answer
14. If an assembly1 contains A and assembly2 contains B where B is inherited from A
and A has a function which is declared as protectedInternal, then from B can u
access that function?

(Interviewer said No, but in the book its said Yes) ProtectedInternal takes the intersection (He
said so, but book says Union) properties of Protected and Internal. An Internal function can be
accessed only from the assembly and Protected can be accessed by the types that inherit it.

15. what is inheritance and encapsulation and give examples? U know..


16. can we use a VB.net file in code behind in a C# application? No.
17. what is global.asax? what does it contain?

These files enable you to manage application-level and session-level events. These files reside in
the root directory of an ASP.NET Web application or ASP.NET Web service. The Global.asax.cs
or Global.asax.vb class file is a hidden, dependent file of Global.asax, which contains the code for
handling application events such as the Application_OnError event.

18. Can we use session variables from asp to asp.net? Yes


19. which is better? Cookies or Viewstate?

Cookies are small files which can be written to the client machine to store user preferences, login
information etc. But a user might reject cookies. So there should be an alternate method if a user
rejects them.

But View State is a hidden value which stores the state information. I think View state is better,
since a user doesn't know abt it.

20. what is caching and how many types of caching are there?

Caching is the technique of storing frequently used items in memory so that they can be
accessed more quickly. Caching is important to Web applications because each time a Web
form is requested, the host server must process the Web form's HTML and run Web form code to
create a response. By caching the response, all that work is bypassed. Instead, the request is
served from the reponse already stored in memory.

Use the @OutputCache page directive to cache a Web form in the server's memory. The
@OutputCache directive's Duration attribute controls how long the page is cached.

When used on a Web form, the OutputCache directive has two required attributes: Duration and
VaryByParam. The VaryByParam attribute lets you cache multiple responses from a single Web
form based on varying HTTP POST or query string parameters.

VaryByParam Cache multiple responses for a single Web form based on an HTTP
POST parameter or query string.
VaryByHeader Cache multiple responses for a single Web form based on the HTTP
request header sent from the client.
VaryByCustom Cache multiple responses for a single Web form based on a custom
string.
Duration Set the amount of time a response is cached.
VaryByControl Cache multiple responses for a single user control based on the value
of one or more controls contained in the user control.

Fragment caching is caching only parts of web form which don't change between the requests.
Applicaton Data can also be cached using Cache object.

21. what is CLR.CTS and CLS?

The common language runtime can be thought of as the environment that manages code
execution. It provides core services, such as code compilation, memory allocation, thread
management, and garbage collection. Through the common type system (CTS), it enforces
strict type-safety and ensures that code is executed in a safe environment by also enforcing
code access security.

The Common Language Specification (CLS) defines the minimum standards to which .NET
language compilers must conform. Thus, the CLS ensures that any source code successfully
compiled by a .NET compiler can interoperate with the .NET Framework.

22. diff of VS6.0 and VS.Net?

VS.Net uses .Net Framework VS doesnt

23. what are Page events and Page Life cycle?

A Web application lives as long as it has active sessions, whereas Web forms live for barely a
moment. The life of a Web application begins when a browser requests the start page of the
application. At that point, the Web server swings into action, starting the assembly (DLL) that
responds to that request. The executable creates an instance of the requested Web form,
generates the HTML to respond to the request, and posts that response to the browser. It then
destroys the instance of the Web form.

When the browser has the generated HTML, the user can type text in boxes, select options, and
perform other tasks until triggering a postback event, such as a button click. Postback events
cause the browser to send the page's data (view state) back to the server for event processing.
When the server receives the view state, it creates a new instance of the Web form, fills in the
data from the view state, and processes any events that occurred. (See Figure 2-13.) As soon as
the server has finished, it posts the resulting HTML back to the browser and destroys the instance
of the Web form.

When the user stops using the Web application for a period of time (the default is 20 minutes),
the user's session times out and ends. (See Figure 2-14.) If there are no other sessions from
other users, the application ends. This doesn't always happen right away. The common language
runtime (CLR) manages memory using garbage collection rather than reference counting, as OLE
did. Garbage collection means that the server periodically traces through the references between
objects. When the runtime finds an object that is no longer used, it throws the object away and
recovers the memory. This means that you don't know exactly when an Application_End event will
occur.

24. Server Controls and validation, Web Form User Controls.


25. How do u do Data Binding?
26. What are common configuration settings? Web.config, machine.config and
app.config.
27. Experience with Extending ASP.NET with HTTP Handlers.
28. Experience with Extending ASP.NET with HTTP Modules.
29. Why is multiple inheritance not supported in .net?

It is supported thru Interfaces. I don't why the feature is not there in .Net

30. what is the difference between declaring a variable as constant, static and read
only?

The first creates a compile-time constant, the second creates a run-time class constant, and the
third creates a run-time object constant.

The symbols you define for compile-time constants are replaced with the value of the constant at
compile time.

readonly values are also constants, in that they cannot be modified after the constructor has
executed. readonly values are different, however, in that they're set at run time. Secondaly, you
can use readonly values for instance constants, storing different values for each instance of a
class type. Updating the value of a public constant is really an interface change. Updating the
value of a readonly constant is easily upgradeable. Constants can be used in places where
readonly values cannot, namely attributes.

31. why as strings known as immutable?

Because the value cannot be changed once its initialized. The methods that look like changing
the string value actually creates a new instance and stores the new value.

32. how do u register .net componenet into GAC ?

Using Gacutil /I. But first the Assembly should have a Strong Name to uniquely identify the
Assembly. Strong name can be created using SN.exe

33. what is GAC?

Its Global Assembly cache where you u want to register your assemblies to share them across
applications.

34. what r the uses os GAC?


35. What is Role Based Authentication?

Role-based authorization lets you identify groups of users to allow or deny based on their role in
your organization.
36. what is a Web Garden and Web Farm?

A Web application running on a single server that has multiple CPUs is called a Web garden in
the ASP.NET documentation. A Web application running on multiple servers is called a Web farm.

37. what is the difference between unmanaged coponenet being registered into the
registry and registring managed componenet into GAC?
38. How do u maintain Session variable in WebFarm?

Session data persists as the user browses through multiple pages. Session in ASP.NET is
configured by the <sessionState> element, which you'll find in the web.config file in any ASP.NET
project.

Listing 12. Session configuration

<sessionState mode="InProc"

stateConnectionString="tcpip=127.0.0.1:42424"

sqlConnectionString="data source=localhost;

user id=sa;password="

cookieless="false" timeout="20"/>

The most important attribute in Listing 12 is mode, which can be set to InProc, StateServer, or
SQLServer. This attribute determines exactly where session data is stored.

39. what is ILDASM tool used for?

Its used to view the assembly code.

40. What are the 3 types of authenticating a user?


Windows Based, Forms Based and Passport.
Windows authentication uses the security features integrated into the Windows NT and
Windows XP operating systems to authenticate and authorize Web application users. The
advantage of Windows authentication is that your Web application can use the exact
same security scheme that applies to your corporate network--user names, passwords,
and permissions are the same for network resources and Web applications.

Forms authentication automatically displays a designated Web form to collect user name and
password information. Code associated with that Web form authenticates and authorizes users
based on a user list stored in the application's Web.config file or in a separate user database.
Passport authentication identifies users via Microsoft Passport's single sign-on service.
Microsoft Passport is meant to provide Internet users with a single identity that they can use to
visit a wide variety of Web sites that require authentication.

41. How do u make use of unmanaged componenets in managed code?

The process of executing native code from within a .NET assembly is called platform invoke, or
pinvoke for short.

1. Import the System.Runtime.InteropServices namespace.

2. Declare the unmanaged procedure using the DllImport attribute or the Declare statement.

3. Map the data types of the procedures parameters to the equivalent .NET types.

4. Call the unmanaged procedure and test its return value for success.

5. If the procedure did not succeed, retrieve and handle the exception code using the Marshal
object's GetLastWin32Error method.

42. What is a type library?


When you register a project for COM interop, Visual Studio automatically creates a type
library for the public classes and members in the .NET assembly and registers those
classes with the system registry.
43. What is Marshalling?

When you call an unmanaged procedure from a .NET assembly, the CLR collects the parameters
and converts their types in a process called Marshaling.

44. what are wrapper class used in .Net Interoperabilty?

.Net Client using COM components

o .Net uses Runtime Callable Wrapper (RCW) to communicate with COM components
o .Net client can use COM components using the following methods
▪ Using TlbImp.exe to import the type libraries
• Eg. TlbImp Mylib.tlb /out:Mylib.dll

COM Clients using the .Net components

.Net uses COM Callable Wrapper (CCW) for .Net components to be made available for COM
clients. COM Server used Service Control Manager (SCM) to identify the COM components. In
order for the SCM to locate our .Net component, it should be converted into a type library (.tlb
extension).
o Steps involved in making .Net components available for COM clients
▪ There is no special task needed at the time of creating .Net component
▪ Use TlbExp.exe to export .Net component to create type library
• Eg. TlbExp MyLib.dll /out:Mylib.tlb
▪ Use RegAsm.exe to create type library and register it in the registry
• Eg. RegAsm MyLib.dll /tlb:Mylib.tlb

45. how do u generate type library for an unmanaged componenet?


Type Library Import (Tlbimp.exe) generates an Interop assembly from a COM object
46. how do u register managed componenet into registry?
RegAsm.exe adds or removes system registration database entries for a .NET assembly
47. how do u make use of managed code in unmanaged programs like VB 6.0?
Type Library Export (Tlbexp.exe) generates a COM type library from a .NET assembly.
48. How do u sign managed library?
49. what r virtual functions?

Virtual functions let the functions to be overridden in the derived classes.

50. what is runtime polymorphism?

With runtime polymorphism based on method overriding, the decision as to which version of a
method will be executed is based on the actual type of object whose reference is stored in the
reference variable, and not on the type of the reference variable on which the method is invoked.

51. how do u make an WIN 32 API function call from managed code ?

P Invoke.

52. how do u debug a managed window service? ???


53. what is tha difference between a config file and a resource file with extension
.resx?
54. how do u tamper msil code?

You can use ILDASM.exe to view the MSIL code

55. What is a session Object.

A Session Object holds information relevant to a particular users session.

56. What's the implicit name of the parameter that gets passed into the class set
method? Value, and its datatype depends on whatever variable we're changing.
57. How do you inherit from a class in C#? Place a colon and then the name of the base
class. Notice that it's double colon in C++.
58. Does C# support multiple inheritance? No, use interfaces instead.
59. When you inherit a protected class-level variable, who is it available to? Classes in
the same namespace.
60. Are private class-level variables inherited? Yes, but they are not accessible, so
looking at it you can honestly say that they are not inherited. But they are.
61. Describe the accessibility modifier protected internal. It's available to derived classes
and classes within the same Assembly (and naturally from the base class it's declared
in).
62. C# provides a default constructor for me. I write a constructor that takes a string
as a parameter, but want to keep the no parameter one. How many constructors
should I write? Two. Once you write at least one constructor, C# cancels the freebie
constructor, and now you have to write one yourself, even if there's no implementation in
it.
63. What's the top .NET class that everything is derived from? System.Object.
64. How's method overriding different from overloading? When overriding, you change
the method behavior for a derived class. Overloading simply involves having a method
with the same name within the class.
65. What does the keyword virtual mean in the method definition? The method can be
over-ridden.
66. Can you declare the override method static while the original method is non-
static? No, you can't, the signature of the virtual method must remain the same, only the
keyword virtual is changed to keyword override. But you can do that if u do Shadowing
(VB.Net) or Hiding(C#).
67. Can you override private virtual methods? No, moreover, you cannot access private
methods in inherited classes, have to be protected in the base class to allow any sort of
access.
68. Can you prevent your class from being inherited and becoming a base class for
some other classes? Yes, that's what keyword sealed in the class definition is for. The
developer trying to derive from your class will get a message: cannot inherit from Sealed
class WhateverBaseClassName. It's the same concept as final class in Java.
69. Can you allow class to be inherited, but prevent the method from being over-
ridden? Yes, just leave the class public and make the method sealed.
70. What's an abstract class? A class that cannot be instantiated. A concept in C++ known
as pure virtual method. A class that must be inherited and have the methods over-ridden.
Essentially, it's a blueprint for a class without any implementation.
71. When do you absolutely have to declare a class as abstract (as opposed to free-
willed educated choice or decision based on UML diagram)? When at least one of
the methods in the class is abstract. When the class itself is inherited from an abstract
class, but not all base abstract methods have been over-ridden.
72. What's an interface class? It's an abstract class with public abstract methods all of
which must be implemented in the inherited classes.
73. Why can't you specify the accessibility modifier for methods inside the interface?
They all must be public. Therefore, to prevent you from getting the false impression that
you have any freedom of choice, you are not allowed to specify any accessibility, it's
public by default.
74. Can you inherit multiple interfaces? Yes, why not.
75. And if they have conflicting method names? It's up to you to implement the method
inside your own class, so implementation is left entirely up to you. This might cause a
problem on a higher-level scale if similarly named methods from different interfaces
expect different data, but as far as compiler cares you're okay.
76. What's the difference between an interface and abstract class? 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 ok in abstract classes.
77. How can you overload a method? Different parameter data types, different number of
parameters, different order of parameters.
78. If a base class has a bunch of overloaded constructors, and an inherited class has
another bunch of overloaded constructors, can you enforce a call from an
inherited constructor to an arbitrary base constructor? Yes, just place a colon, and
then keyword base (parameter list to invoke the appropriate constructor) in the
overloaded constructor definition inside the inherited class.
79. What's the difference between System.String and 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.
80. What's the advantage of using System.Text.StringBuilder over System.String?
StringBuilder is more efficient in the cases, where a lot of manipulation is done to the text.
Strings are immutable, so each time it's being operated on, a new instance is created.
81. Can you store multiple data types in System.Array? No.
82. What's the difference between the System.Array.CopyTo() and
System.Array.Clone()? The first one performs a deep copy of the array, the second one
is shallow.
83. How can you sort the elements of the array in descending order? By calling Sort()
and then Reverse() methods.
84. What's the .NET datatype that allows the retrieval of data by a unique key?
HashTable.
85. What's class SortedList underneath? A sorted HashTable.
86. Will finally block get executed if the exception had not occurred? Yes.
87. What's the C# equivalent of C++ catch (…), which was a catch-all statement for any
possible exception? A catch block that catches the exception of type System.Exception.
You can also omit the parameter data type in this case and just write catch {}.
88. Can multiple catch blocks be executed? No, once the proper catch code fires off, the
control is transferred to the finally block (if there are any), and then whatever follows the
finally block.
89. Why is it a bad idea to throw your own exceptions? Well, if at that point you know that
an error has occurred, then why not write the proper code to handle that error instead of
passing a new Exception object to the catch block? Throwing your own exceptions
signifies some design flaws in the project.
90. What's a delegate? A delegate object encapsulates a reference to a method. In C++
they were referred to as function pointers.
91. What's a multicast delegate? It's a delegate that points to and eventually fires off
several methods.
92. How's the DLL Hell problem solved in .NET? Assembly versioning allows the
application to specify not only the library it needs to run (which was available under
Win32), but also the version of the assembly.
93. What are the ways to deploy an assembly? An MSI installer, a CAB archive, and
XCOPY command.
94. What's a satellite assembly? When you write a multilingual or multi-cultural application
in .NET, and want to distribute the core application separately from the localized modules,
the localized assemblies that modify the core application are called satellite assemblies.
95. What namespaces are necessary to create a localized application?
System.Globalization, System.Resources.
96. What's the difference between // comments, /* */ comments and /// comments?
Single-line, multi-line and XML documentation comments.
97. How do you generate documentation from the C# file commented properly with a
command-line compiler? Compile it with a /doc switch.
98. What's the difference between <c> and <code> XML documentation tag? Single line
code example and multiple-line code example.
99. Is XML case-sensitive? Yes, so <Student> and <student> are different elements.
100.What debugging tools come with the .NET SDK? CorDBG - command-line debugger,
and DbgCLR - graphic debugger. Visual Studio .NET uses the DbgCLR. To use CorDbg,
you must compile the original C# file using the /debug switch.
101.What does the This window show in the debugger? It points to the object that's
pointed to by this reference. Object's instance data is shown.
102.What does assert() do? In debug compilation, assert takes in a Boolean condition as a
parameter, and shows the error dialog if the condition is false. The program proceeds
without any interruption if the condition is true.
103.What's the difference between the Debug class and Trace class? Documentation
looks the same. Use Debug class for debug builds, use Trace class for both debug and
release builds.
104.Why are there five tracing levels in System.Diagnostics.TraceSwitcher? The tracing
dumps can be quite verbose and for some applications that are constantly running you
run the risk of overloading the machine and the hard drive there. Five levels range from
None to Verbose, allowing to fine-tune the tracing activities.
105.Where is the output of TextWriterTraceListener redirected? To the Console or a text
file depending on the parameter passed to the constructor.
106.How do you debug an ASP.NET Web application? Attach the aspnet_wp.exe process
to the DbgClr debugger.
107.What are three test cases you should go through in unit testing? 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).
108.Can you change the value of a variable while debugging a C# application? Yes, if
you are debugging via Visual Studio.NET, just go to Immediate window.
109.Explain the three services model (three-tier application). Presentation (UI), business
(logic and underlying code) and data (from storage or other sources).
110.What are advantages and disadvantages of Microsoft-provided data provider
classes in ADO.NET? SQLServer.NET data provider is high-speed and robust, but
requires SQL Server license purchased from Microsoft. OLE-DB.NET is universal for
accessing other sources, like Oracle, DB2, Microsoft Access and Informix, but it's a .NET
layer on top of OLE layer, so not the fastest thing in the world. ODBC.NET is a
deprecated layer provided for backward compatibility to ODBC engines.
111.What's the role of the DataReader class in ADO.NET connections? It returns a read-
only dataset from the data source when the command is executed.
112.What does the parameter Initial Catalog define inside Connection String? The
database name to connect to.
113.What's the data provider name to connect to Access database? Microsoft.Access.
114.What does Dispose method do with the connection object? Deletes it from the
memory.
115.What is a pre-requisite for connection pooling? Multiple processes must agree that
they will share the same connection, where every parameter is the same, including the
security settings.
116.what are Virtual functions?
The virtual keyword is used to modify a method or property declaration, in which case
the method or the property is called a virtual member. When a virtual method is invoked,
the run-time type of the object is checked for an overriding member. The overriding
member in the most derived class is called, which might be the original member, if no
derived class has overridden the member. By default, methods are non-virtual. You
cannot override a non-virtual method. You cannot use the virtual modifier with the
following modifiers: static abstract override
117.what is an abstract ?

Use the abstract modifier in a class declaration to indicate that a class is intended only to be a
base class of other classes.

Abstract classes have the following features:

• An abstract class cannot be instantiated.

• An abstract class may contain abstract methods and accessors.

• It is not possible to modify an abstract class with the sealed modifier, which means that the class
cannot be inherited.

• A non-abstract class derived from an abstract class must include actual implementations of all
inherited abstract methods and accessors.

118.what are the application and session events?

Application_Start The first user visits a page within your Web application.
Application_End There are no more users of the application.
Application_BeginRequest At the beginning of each request to the server. A request happens
every time a browser navigates to any of the pages in the
application.
Application_EndRequest At the end of each request to the server.
Session_Start A new user visits a page within your application.
Session_End A user stops requesting pages from the Web application and their
session times out. Sessions time out after a period specified in the
Web.config file.
119.what are namespaces and what is namespace collision?
Namespaces are a way of organizing code. They provide protection from conflicting
names, sometimes called namespace collisions. This protection is especially necessary
in large projects in which it is very easy for two items to accidentally have the same
name.
120.what is the difference between Using and Reference?
You add project references to use namespaces outside of the current project. Use the
Imports statement to provide a shortcut to that namespace. The Imports statement simply
provides an abbreviated way to refer to a namespace in code
121.what are delegates and why are they used?

A delegate is a class that holds a reference to the method that is called when an event is
fired. Delegates are types used to invoke one or more methods where the actual method invoked
is determined at run time. This provides a safe way for derived objects to subscribe to events
provided by their base class. Delegates also provide a way for programs to respond to
asynchronous procedures.

Simply put, delegates provide a way to invoke methods by their address rather than by their
name. The delegate's declaration must match the signature of the methods invoked. This rule
ensures that delegation is type-safe. the most important reason is that delegates provide the
flexibility required for responding to events and asynchronous tasks running in separate threads.

122.what are the ways of saving state information?

1. Context.Handler object

Use this object to retrieve public members of one Web form's class from a subsequently
displayed Web form.

1. Query strings

Use these strings to pass information between requests and responses as part of the Web
address. Query strings are visible to the user, so they should not contain secure information such
as passwords.

2. Cookies

Use cookies to store small amounts of information on a client. Clients might refuse cookies, so
your code has to anticipate that possibility.
3. View state

ASP.NET stores items added to a page's ViewState property as hidden fields on the page.

4. Session state

Use Session state variables to store items that you want keep local to the current session
(single user).

5. Application state

Use Application state variables to store items that you want be available to all users of the
application.

123.what are validation controls?

RequiredFieldValidator Check whether a control contains data


CompareValidator Check whether an entered item matches an entry in another control
RangeValidator Check whether an entered item is between two values
RegularExpressionValidator Check whether an entered item matches a specified format
CustomValidator Check the validity of an entered item using a client-side script or a
server-side code, or both
ValidationSummary Display validation errors in a central location or display a general
validation error description
124.what r diff isolation levels in a tansaction.

ReadUncommitted Does not lock the records being read. This means that an uncommitted change
can be read and then rolled back by another client, resulting in a local copy of a
record that is not consistent with what is stored in the database. This is called a
dirty read because the data is inconsistent.
Chaos Behaves the same way as ReadUncommitted, but checks the isolation level of
other pending transactions during a write operation so that transactions with
more restrictive isolation levels are not overwritten.
ReadCommitted Locks the records being read and immediately frees the lock as soon as the
records have been read. This prevents any changes from being read before they
are committed, but it does not prevent records from being added, deleted, or
changed by other clients during the transaction. This is the default isolation level.
RepeatableRead Locks the records being read and keeps the lock until the transaction completes.
This ensures that the data being read does not change during the transaction.
Serializable Locks the entire data set being read and keeps the lock until the transaction
completes. This ensures that the data and its order within the database do not
change during the transaction.
125.
.NET Top

1. service components (distribted components)


2. request components in .NET
3. Managed Class vs Un-managed code? U know.
4. What is IL? And which tool u use to view the IL? When an application is compiled in .Net
then the code is converted into Intermediate Language.
5. Common API?
6. Common Types? Value type and reference type.
7. Cross Language Inheritance
8. Cross Language Debugging and profiling.
9. What are indexers? Indexers are called smart arrays. Indexers let an object to be used
like an array. The declaration is similar to the declaration of a Property.
10. what are References in .NET? References are Namespaces or COM objects etc which
you want to use in your application.
11. what is the difference between Value Type and Reference Type?

All the data associated with a value type is allocated on the stack. When a variable of a Value
Type goes out of scope, it is destroyed and its memory is reclaimed. A variable of a reference
type, on the other hand, exists in two memory locations. The actual object data is allocated on the
heap. A variable containing a pointer to that object is allocated on the stack. When that variable is
called by a function, it returns the memory address for the object to which it refers. When that
variable goes out of scope, the object reference is destroyed but the object itself is not. If any
other references to that object exist, the object remains intact. If the object is left without any
references, it is subject to garbage collection.

1. What Is NUnit?
NUnit is a unit-testing framework for all .Net languages. Initially ported from JUnit, the
current version, 2.1 is the third major release of this xUnit based unit testing tool for
Microsoft .NET. It is written entirely in C# and has been completely redesigned to take
advantage of many .NET language features, for example custom attributes and other
reflection related capabilities. NUnit brings xUnit to all .NET languages.

instead of

before aa

SQL: Top

1. How do u enforce Data Integrity in SQL?

Using Constraints.

2. what are differenet constraints? NOT NULL, CHECK, UNIQUE, PRIMARY KEY,
FOREIGN KEY
3. What is Save Point and Rollback action?

Save point is a point within a database transaction from which you can restore the database
state.

4. What are indexes, and y are they used?

Indexes are database objects designed to improve query performance. Indexes are
structured to facilitate the rapid return of result sets. The two types of indexes that SQL Server
supports are clustered and nonclustered indexes.

5. What is clustered index and non-clustered index?

A clustered index contains table records in the leaf level of the B-tree. A nonclustered index
contains a bookmark to the table records in the leaf level. If a clustered index exists on a table, a
nonclustered index uses it to facilitate data lookup. In most cases, you will create a clustered
index on a table before you create nonclustered indexes.

6. what are deadlocks?

SQL Server has an algorithm to detect deadlocks, a condition in which two connections have
blocked each other. If an instance of SQL Server detects a deadlock, it will terminate one
transaction, allowing the other to continue.

7. What are Transaction Logs?

Every SQL Server database has a transaction log that records all transactions and the database
modifications made by each transaction.

8. How many indexes you have?


9. How is error handling done?
10. what are different error codes?

The two primary categories of errors are computer errors, such as an unavailable database
server, and user errors. Return codes and the @@ERROR function are used to handle errors
that occur when a procedure is executed.

11. How do u retrieve data using Stored procedures?


12. what are different stored procedures?

There are five classes of stored procedures: system stored procedures, local stored procedures,
temporary stored procedures, extended stored procedures, and remote stored procedures.

13. what are triggers? and how many are there?what does each one do?
Triggers are a special class of stored procedure defined to execute automatically in place of or
after data modification. The three commands that fire a trigger are UPDATE, INSERT, and
DELETE. Use triggers to extend data integrity and to implement complex business logic.

14. what are locks?

A lock is an object that software uses to indicate that a user has some dependency on a
resource. The software does not allow other users to perform operations on the resource that
would adversely affect the dependencies of the user who owns the lock. Locks are managed
internally by system software and are acquired and released based on actions that the user
takes.

15. what is ddl,dml and dcl?

DataDefintion language..Create, Alter and drop.

Data Manipulation Language- Select, Insert, update

Data Control Language - Grank and Revoke

16. what is referential inregrity?

SQL Server supports four types of data integrity: entity integrity, domain integrity, referential
integrity, and user-defined integrity.

17. what is a foreign key,primary key and unique key and their differences?
18. what are Hash Tables?
19. what does delete table and trunctate table do?

The TRUNCATE TABLE statement is a fast, non-logged method of deleting all rows in a
table. This method is almost always faster than a DELETE statement with no conditions, because
DELETE logs each row deletion and TRUNCATE TABLE logs only the deallocation of whole
data pages. The TRUNCATE TABLE statement immediately frees all of the space occupied by
that table's data and indexes. The distribution pages for all indexes are also freed.

20. how do you implement multiple conditions in a stored procedure?


21. Can a Primary key be NULL? no
22. Can a Foreign key be NULL? yes
23. what is a Btree?
24. what are permisson levels on a Database?

Like authentication, system stored procedures are used to manage SQL Server authorization.
Use sp_grantdbaccess and sp_revokedbaccess to grant or revoke database access to a security
account. These system stored procedures work with all valid security accounts, Windows
accounts, and SQL Server login IDs. Granting access is also called mapping an account to a
database.

You use system stored procedures to manage SQL Server authentication. Use the sp_grantlogin,
sp_denylogin, and sp_revokelogin system stored procedures to manage Windows account
authentication. Use the sp_addlogin and sp_droplogin system stored procedures to manage SQL
Server login ID authentication.

25. What is normalization?. Explain normalization types.

26. What is the disadvantage of creating an index in every column


of a database table?

Do not create indexes for every column in a table, because too many indexes will negatively
impact performance. The majority of databases are dynamic; that is, records are added, deleted,
and changed regularly. When a table containing an index is modified, the index must be updated
to reflect the modification. If index updates do not occur, the index will quickly become ineffective.
Therefore, INSERT, UPDATE, and DELETE events trigger the Index Manager to update the table
indexes. Like tables, indexes are data structures that occupy space in the database. The larger
the table, the larger the index that is created to contain the table. Before creating an index, you
must be sure that the increased query performance afforded by the index outweighs the
additional computer resources necessary to maintain the index.

27. what is a Dead Lock?


28. How do u aquire a Lock?

29. What are different error codes?


30. what is the difference between User-defined function and a Stored procedure?

31. Diff between Delete and Truncate?


32. what is HAVING and Group by?

33. what are JOINS?


34. what does drop table?
35. Define a transaction. What are acid properties of a transaction?

A transaction is a sequence of operations performed as a single, logical unit of work. A


transaction is a process where either something completes or it fails depending on its
requirements.
ACID properties of a transaction
A - Atomicity = The entire sequence of actions must be either completed or aborted. The
transaction cannot be partially successful.
C - Consistency = The transaction takes the resources from one consistent state to another.
I - Isolation = A transaction's effect is not visible to other transactions until the transaction is
committed.
D - Durability = Changes made by the committed transaction are permanent and must survive
system failure.

36. How would you remotely administer IIS?

Administer through the web browser or through the IIS Snap-in (Microsoft Suggestions)

37. What is RAID? What is it used for?

RAID (Redundant Array of Inexpensive Disks) is used to provide fault tolerance to database
servers. (Basically for data protection just in case a hard drive or system fails)

38. What is the disadvantage of creating an index in every column of a database table?

Disadvantage is it slows down the modification of data into those columns because every time
data changes in the table, all the indexes need to be updated.

39. You have a query that runs slowly, how would you make it better.

But some general issues that you could talk about would be: No indexes, table scans, missing or
out of date statistics, blocking, excess recompilations of stored procedures, procedures and
triggers without SET NOCOUNT ON, poorly written query with unnecessarily complicated joins,
too much normalization, excess usage of cursors and temporary tables. Some of the tools/ways
that help you troubleshooting performance problems are: SET SHOWPLAN_ALL ON, SET
SHOWPLAN_TEXT ON, SET STATISTICS IO ON, SQL Server Profiler, Windows NT /2000
Performance monitor, Graphical execution plan in Query Analyzer. Download the white paper on
performance tuning SQL Server from Microsoft web site. Don't forget to check out SQL Server
2hPerformance

40. What is a bit datatype?.What is it used for?

Bit data type consists of either 1 or 0 (on or off) is generally used as a boolean type where the
answer is either true/false, on/off, yes/no, etc...

41. What are the three Objects of ADO?

Connection, Command, Recordset (There are actually more than 3 (Primary objects are
(Connection, Command, Field and Recordset) Secondary objects are (Parameters, Properties
and Errors)))

42. What is the wildcard character in SQL? Let's say you want to query database with
LIKE for all employees whose name starts with La. The wildcard character is %, the
proper query with LIKE would involve 'La%'.
43. Explain ACID rule of thumb for transactions. Transaction must be Atomic (it is one unit
of work and does not dependent on previous and following transactions), Consistent
(data is either committed or roll back, no “in-between” case where something has been
updated and something hasn't), Isolated (no transaction sees the intermediate results of
the current transaction), Durable (the values persist if the data had been committed even
if the system crashes right after).
44. What connections does Microsoft SQL Server support? Windows Authentication (via
Active Directory) and SQL Server authentication (via Microsoft SQL Server username and
passwords).
45. Which one is trusted and which one is untrusted? Windows Authentication is trusted
because the username and password are checked with the Active Directory, the SQL
Server authentication is untrusted, since SQL Server is the only verifier participating in
the transaction.
46. Why would you use untrusted verificaion? Web Services might use it, as well as non-
Windows applications.
47. where are the three places you can store Session variables?

6. Inside the ASP.NET runtime process (aspnet_wp.exe). This is the default option and is
the best choice from a performance perspective but suffers from the same problem as
ASP session storage: if the Web server crashes you will lose all information.
7. Inside a dedicated Windows Service. A Windows Service is a durable process that
usually starts when the computer boots and can survive logins and logouts (in fact, IIS
itself runs as a Windows Service). This technique is slower than the first option, because
the ASP.NET runtime must retrieve session information from the external Service, rather
than from its own process. However, this option is more durable, as session information
persists even if the Web server crashes or is restarted.
8. Inside a Microsoft® SQL Server™ database. This option is the most durable of the
three. Although the second option protects against Web server crashes, session
information is still lost if the entire machine crashes. Because this third option logs
Session to a database (as opposed to the computer's memory), it will survive even a
machine reboot. From a performance perspective, this option is by far the slowest.

48. Difference between Function and Stored Procedure?

Functions MUST return value whereas stored procedure need not. Functions have the
advantage of being able to be imbedded in a larger statement.

XML and WebServices Top

1. What is .Net Remoting?

The .NET Remoting system provides a number of services to activate objects, control the lifetime
of each object, and transport messages to and from remote objects using communication
channels. Communication channels are the objects that transport messages between the remote
objects.

2. Can remoting object pass through a firewall? using SOAP


3. what are “Serialization Formatters”?

Serialization formatters are the objects that help you to encode and decode messages that
are sent to or received from a remote object. Two kinds of encoding are possible for all
messages:

• binary and

• XML encoding.

Applications in which performance is critical use binary encoding. In cases where


interoperability with other remoting systems is essential, XML encoding is the preferred
choice

4. What are Web Services?

XML Web services are program components that allow you to build scalable, loosely
coupled, platform-independent applications. XML Web services enable disparate applications
to exchange messages using standard protocols such as HTTP, XML, XSD, SOAP, and Web
Services Description Language (WSDL).

5. what are the 2 types of Remotable Objects?

1. Marshal-by-value objects.

These objects are copied and passed by value out of the application domain.

2. Marshal-by-reference objects.

The clients that use these objects need a proxy to access the object remotely.

6. How does .NET remoting work?

To communicate between server objects and clients in .NET Remoting, you need to use object
references of the server object in the client application. When you create an instance of the
remote object using the new keyword, your client receives a reference to the server object. After
obtaining the object reference, the client can call methods on the server object as if the object
resides in the client's process and does not run on a separate computer.

.NET Remoting uses proxy objects to allow the use of the server object in the client process.
When you create an instance of the remote object type in the client application, .NET Remoting
creates a proxy object and sends it to the client application. This proxy object contains references
to all the methods and properties of the server object. When you call a method that is on that
proxy object, the remoting system receives the call, routes it to the server process, invokes the
server object, and returns the return value to the client proxy, which returns the result to the client
application.

7. what are the 2 ways of activation modes in .Net remoting system and Explain?

They are Server activation and client activation. In server activation, objects are created on
the server when you call a method in the server class. However, objects are not created when
you use the new keyword to create an instance of the server class

Client-activated objects are created on the server when you create an instance using the new
keyword.

8. Adv of getting Remoting Object??


9. What is scope of Publication in .Net remoting?

Static members You cannot export static members, such as fields and methods, remotely.
.NET Remoting needs instance members to enable communication between
the client and server objects.
Instance fields The .NET Remoting system checks whether the object that you use is
and accessors exported as a proxy object. If it is a proxy object, the client can directly access
instance fields through the proxy. If the exported object is not a proxy, the
proxy object provides instance accessors to the client.
Private members You cannot export private members of a remote object.

Delegates Delegates are marshal-by-value objects. The object in delegates can be a


remotable object, such as a serializable object, a MarshalByRef object, or a
ContextBound object.
Overriding To enhance performance, the virtual methods on an object always execute
methods on an locally in the application domain in which they are called.
object
10. what does it require to communicate between objects across diff boundaries?

1. A server object that exposes the functionality to callers outside its boundary

2. A client that makes calls to the server object


3. A transportation mechanism to pass the calls from one end to the other

11. What are XSL and XSLT? Differences?

12. XML Data Document Object?


13. Retrieving XML directly from SQL Server?
14. Creating Editing and Validating XML Documents?
15. Using XSL and XSLT Transformations?
16. what is WSDL?
WSDL stands for Web Services Description Language.
WSDL is a document written in XML. The document describes a Web service. It specifies
the location of the service and the operations (or methods) the service exposes
17. What are Singleton and SingleCall objects in Server side activation in .Net
Remoting? Which one hold ViewState Information?

Singleton objects can have only one instance regardless of the number of clients they
have. These objects also have a default lifetime. Therefore, if you create a server object as a
Singleton object, a single instance of the server object manages all the clients. When you declare
an object as a SingleCall object, the remoting system creates an object each time a client
method invokes a remote object. To register a server object as a Singleton object, you specify
the type of the object as WellKnownObjectMode.Singleton.

Singleton holds Viewstate information.

18. what does Lease Manager do?

Whenever a marshal-by-reference object is remoted outside an application domain, a lifetime


lease is created for that object. Each application domain contains a lease manager that
administers the leases in its domain. The lease manager periodically reviews the leases for
expiration. If a lease expires, the lease manager goes through its list of sponsors for that object
and asks if any of them want to renew the lease. If none of the sponsors renew the lease, the
lease manager removes the lease. The object is then deleted, and garbage collection reclaims
the object memory. The lifetime of an object can therefore be much longer than its lifetime lease.

19. What are .net Asynchronous programming?

.NET asynchronous programming enables you to call and execute a method while the
program, which calls the methods, continues to execute. This enables methods to continue
executing without waiting for the called methods to finish execution, which increases the speed of
applications. .NET Remoting supports asynchronous programming.

20. Difference between winforms and web forms?


Winforms are used for Windows based apps and WebForms are for Web based apps.
21. Difference between Server- activation and Client-activation?
Server activated objects are created when a method is called and Client activated objects
are created when u create a new object using “new” keyword.
22. What is the lifetime of Server-activation and Client-activation?
Server-activated objects are objects whose lifetimes are directly controlled by the
server. The server application domain creates these objects only when the client makes a
method call on the object, rather than when the client calls new (New() in Visual Basic) or
Activator.GetObject; this saves a network round trip solely for the purpose of instance
creation. Only a proxy is created in the client application domain when a client requests
an instance of a server-activated type.
Client-activated objects are objects whose lifetimes are controlled by the calling application
domain, just as they would be if the object were local to the client. With client activation, a round
trip to the server occurs when the client tries to create an instance of the server object, and the
client proxy is created using an object reference (ObjRef) obtained on return from the creation of
the remote object on the server.

23. What is Multi-threading and how do u do synchronizing?


Multithreading is ability to execute various threads in a program simultaneously.
24. What are the ways you host the .Net remoting Service?
25. What are the lifetime of CAOs and SAOs?
26. If there is a Dynamic Url of a webservice then how will you use it in ur program?
27. What is Thread Pooling?
28. What are the uses of “Using” keyword?
29. Which communication channel is better? TCP or http?

COM/DCOM: Top

1. When you create a DCOM dll what tings do yo need to consider?


2. Diff between DCOM dll vs VB dll
3. Deploy a DCOM component?
4. Can we use COM components from .NET? yes. Pinvoke

5. What is a COM component?

A COM component can be any type of external or internal object that is called to perform an
operation (uploading, error handling, etc...)

6. How do you register a COM component?

regsvr32 path\componentname
Ex: To register a component call Help.dll, located in C:\COMObjects folder

Regsvr32 "C:\COMObjects\Help.dll"

To unregister

Regsvr32 "C:\COMObjects\Help.dll" /u

1. Is MFC supported in .NET?

MFC are supported in .NET by using the RCW (Runtime Callable Wrappers) class which wraps
the MFC and can be called from .NET framework.

2. Is a destructor virtual?
We need to make destructor virtual in the class if that class is being inherited by another class
which has its own destructor. Else there is no need to declare destructor as virtual.

2. What are the data types in VBScript.

VBScript consists of only one data type (Variant)


9.What is a virtual root and how do you create one?

Better known as Virtual Directory. Allows you to create multiple website under 1 ip address.
Allows you reference another location (folder) to include additional functionality.
10. What is a database index, how do you create one, discuss it's pros and cons.

Clustered and non-clustered.


11. What is the default language of ASP.

VBScript
12.How do you use multiple record sets( rs.NextRecordSet ).

Using rs.NextRecordset

13. As soon as you fetch a record set, what operations would you perform.

Check to make sure records were returned...if so, then manipulate them.

IIS 6.0 Top

· IIS Architecture
· IIS Deployment
· Administration
· Administration of Web Edition
· Command line Interface
· Creating and configuring FTP Sites
· Creating and configuring Web Sites
· Creating and configuring Web Applications
· Working with Metabase
· Trobleshooting and maintenance

ASP2. Top

Briefly explain how code behind works and contrast that using the inline
style.
- Can the action attribute of a server-side <form> tag be set to a value and if not how can you
possibly pass data from a form page to a subsequent page. (Extra credit: Have you heard of com
dna. :-)
- How would ASP and ASP.NET apps run at the same time on the same server?

UML Top

1. What is a Sequence Diagram?


2. What is a Class Diagram?
3. What are Collaboration Diagrams?
4. Is Sequence Diagram static or Dynamic?
5. What are Use Cases?
6. What is the difference between Use Case and a Flow Chart?
7. What is Aggregation and Composition? How are they represented?
8. What is Generalization?
9. What does 'Uses' and 'extends' mean?
10. How do you represent Synchronous and Asynchronous Messages?

Real Interview Questions: Plano,Tx.

1. what are cursors?

2. what are Delegates?

3. what are multicast delegates?

4. what is DataReader and DataSet? which is faster?

5. How do u access DataRows?

6. How do u make changes from DATASet to Database?

7. what are 2 parameters of Command Object?

8. what are 4 database objects?

9. How do u merge 2 tables?

10. what is Inner join and Outer join?

11. How do u use Having and Group by?

12. How do u specify to sort in Ascending or Descending order?

13. What are value types and reference types?

14. How do you programmatically disable maximizing and minimizing window?


15. How do u programmatically set the icon of an application?

16. How do u catch errors?

17. How do u programmatically set a window to open at a position?

18. what is boxing and unboxing?

19. what is .Net remoting?

1. What is normalization? -
Well a relational database is basically composed of tables that contain related data. So the
Process of organizing this data into tables is actually referred to as normalization.

2. What is a Stored Procedure?


Its nothing but a set of T-SQL statements combined to perform a single task of several
tasks. Its basically like a Macro so when you invoke the Stored procedure, you actually run
a set of statements.

3. Can you give an example of Stored Procedure? - sp_helpdb , sp_who2, sp_renamedb


are a set of system defined stored procedures. We can also have user defined stored
procedures which can be called in similar way.

4. What is a trigger? - Triggers are basically used to implement business rules. Triggers is
also similar to stored procedures. The difference is that it can be activated when data is
added or edited or deleted from a table in a database.

5. What is a view?
If we have several tables in a db and we want to view only specific columns from specific
tables we can go for views. It would also suffice the needs of security some times allowing
specfic users to see only specific columns based on the permission that we can configure
on the view. Views also reduce the effort that is required for writing queries to access
specific columns every time.

6. What is an Index? - When queries are run against a db, an index on that db basically
helps in the way the data is sorted to process the query for faster and data retrievals are
much faster when we have an index.

7. What are the types of indexes available with SQL Server? - There are basically two types
of indexes that we use with the SQL Server. Clustered and the Non-Clustered.

8. What is the basic difference between clustered and a non-clustered index? - The
difference is that, Clustered index is unique for any given table and we can have only one
clustered index on a table. The leaf level of a clustered index is the actual data and the
data is resorted in case of clustered index. Whereas in case of non-clustered index the leaf
level is actually a pointer to the data in rows so we can have as many non-clustered
indexes as we can on the db.

9. What are cursors? - Well cursors help us to do an operation on a set of data that we
retreive by commands such as Select columns from table. For example : If we have
duplicate records in a table we can remove it by declaring a cursor which would check the
records during retreival one by one and remove rows which have duplicate values.

10. When do we use the UPDATE_STATISTICS command?


This command is basically used when we do a large processing of data. If we do a large
amount of deletions any modification or Bulk Copy into the tables, we need to basically
update the indexes to take these changes into account. UPDATE_STATISTICS updates the
indexes on these tables accordingly.

11. Which TCP/IP port does SQL Server run on?


SQL Server runs on port 1433 but we can also change it for better security.

12. From where can you change the default port? - From the Network Utility TCP/IP
properties -> Port number.both on client and the server.

13. Can you tell me the difference between DELETE & TRUNCATE commands? - Delete
command removes the rows from a table based on the condition that we provide with a
WHERE clause. Truncate will actually remove all the rows from a table and there will be no
data in the table after we run the truncate command.

14. Can we use Truncate command on a table which is referenced by FOREIGN KEY? - No.
We cannot use Truncate command on a table with Foreign Key because of referential
integrity.

15. What is the use of DBCC commands? - DBCC stands for database consistency
checker. We use these commands to check the consistency of the databases, i.e.,
maintenance, validation task and status checks.

16. Can you give me some DBCC command options?(Database consistency check) -
DBCC CHECKDB - Ensures that tables in the db and the indexes are correctly linked.and
DBCC CHECKALLOC - To check that all pages in a db are correctly allocated. DBCC
SQLPERF - It gives report on current usage of transaction log in percentage. DBCC
CHECKFILEGROUP - Checks all tables file group for any damage.

17. What command do we use to rename a db? - sp_renamedb 'oldname' , 'newname'

18. Well sometimes sp_reanmedb may not work you know because if some one is using
the db it will not accept this command so what do you think you can do in such cases? - In
such cases we can first bring to db to single user using sp_dboptions and then we can
rename that db and then we can rerun the sp_dboptions command to remove the single
user mode.

19. What is the difference between a HAVING CLAUSE and a WHERE CLAUSE? - Having
Clause is basically used only with the GROUP BY function in a query. WHERE Clause is
applied to each row before they are part of the GROUP BY function in a query.

20. What do you mean by COLLATION?


Collation is basically the sort order. There are three types of sort order Dictionary case
sensitive, Dictonary - case insensitive and Binary.

21. What is a Join in SQL Server? - Join actually puts data from two or more tables into a
single result set.

22. Can you explain the types of Joins that we can have with Sql Server? - There are three
types of joins: Inner Join, Outer Join, Cross Join

23. When do you use SQL Profiler? - SQL Profiler utility allows us to basically track
connections to the SQL Server and also determine activities such as which SQL Scripts
are running, failed jobs etc..

24. What is a Linked Server? - Linked Servers is a concept in SQL Server by which we can
add other SQL Server to a Group and query both the SQL Server dbs using T-SQL
Statements.

25. Can you link only other SQL Servers or any database servers such as Oracle? - We can
link any server provided we have the OLE-DB provider from Microsoft to allow a link. For
Oracle we have a OLE-DB provider for oracle that microsoft provides to add it as a linked
server to the sql server group.

26. Which stored procedure will you be running to add a linked server? -
sp_addlinkedserver, sp_addlinkedsrvlogin

27. What are the OS services that the SQL Server installation adds? - MS SQL SERVER
SERVICE, SQL AGENT SERVICE, DTC (Distribution transac co-ordinator)

28. Can you explain the role of each service? - SQL SERVER - is for running the databases
SQL AGENT - is for automation such as Jobs, DB Maintanance, Backups DTC - Is for
linking and connecting to other SQL Servers

29. How do you troubleshoot SQL Server if its running very slow? - First check the
processor and memory usage to see that processor is not above 80% utilization and
memory not above 40-45% utilization then check the disk utilization using Performance
Monitor, Secondly, use SQL Profiler to check for the users and current SQL activities and
jobs running which might be a problem. Third would be to run UPDATE_STATISTICS
command to update the indexes

30. Lets say due to N/W or Security issues client is not able to connect to server or vice
versa. How do you troubleshoot? - First I will look to ensure that port settings are proper
on server and client Network utility for connections. ODBC is properly configured at client
end for connection ----Makepipe & readpipe are utilities to check for connection. Makepipe
is run on Server and readpipe on client to check for any connection issues.

31. What are the authentication modes in SQL Server? - Windows mode and mixed mode
(SQL & Windows).

32. Where do you think the users names and passwords will be stored in sql server? -
They get stored in master db in the sysxlogins table.

33. What is log shipping? Can we do logshipping with SQL Server 7.0 - Logshipping is a
new feature of SQL Server 2000. We should have two SQL Server - Enterprise Editions.
From Enterprise Manager we can configure the logshipping. In logshipping the
transactional log file from one server is automatically updated into the backup database
on the other server. If one server fails, the other server will have the same db and we can
use this as the DR (disaster recovery) plan.

34. Let us say the SQL Server crashed and you are rebuilding the databases including the
master database what procedure to you follow? - For restoring the master db we have to
stop the SQL Server first and then from command line we can type SQLSERVER -m which
will basically bring it into the maintenance mode after which we can restore the master db.

35. Let us say master db itself has no backup. Now you have to rebuild the db so what
kind of action do you take? - (I am not sure- but I think we have a command to do it).

36. What is BCP? When do we use it? - BulkCopy is a tool used to copy huge amount of
data from tables and views. But it won't copy the structures of the same.

37. What should we do to copy the tables, schema and views from one SQL Server to
another? - We have to write some DTS packages for it.

38. What are the different types of joins and what dies each do?

39. What are the four main query statements?

40. What is a sub-query? When would you use one?


a query nested within another query.

41. What is a NOLOCK?


Do not issue shared locks, and do not honor exclusive locks. When this option is in effect, it is
possible to read an uncommitted transaction or a set of pages that are rolled back in the middle of
a read. Dirty reads are possible. This hint only applies to the SELECT statement.

42. What are three SQL keywords used to change or set someone's permissions?

43.

44. What is the difference between HAVING clause and the WHERE clause?

45. What is referential integrity? What are the advantages of it?

46. What is database normalization?

47. Which command using Query Analyzer will give you the version of SQL server and
operating system?

48. Using query analyzer, name 3 ways you can get an accurate count of the number of
records in a table?

49. What is the purpose of using COLLATE in a query?

50. What is a trigger?

51. What is one of the first things you would do to increase performance of a query? For
example, a boss tells you that “a query that ran yesterday took 30 seconds, but today it
takes 6 minutes”

52. What is an execution plan? When would you use it? How would you view the execution
plan?

53. What is the STUFF function and how does it differ from the REPLACE function?

54. What does it mean to have quoted_identifier on? What are the implications of having it
off?

55. What are the different types of replication? How are they used?

56. What is the difference between a local and a global variable?

57. What is the difference between a Local temporary table and a Global temporary table?
How is each one used?

58. What are cursors? Name four types of cursors and when each one would be applied?

59. What is the purpose of UPDATE STATISTICS?


60. How do you use DBCC statements to monitor various aspects of a SQL server
installation?

61. How do you load large data to the SQL server database?

62. How do you check the performance of a query and how do you optimize it?

63. How do SQL server 2000 and XML linked? Can XML be used to access data?

64. What is SQL server agent?

65. What is referential integrity and how is it achieved?

66. What is indexing?

67. What is normalization and what are the different forms of normalizations?

68. Difference between server.transfer and server.execute method?

69. What id de-normalization and when do you do it?

70. What is better - 2nd Normal form or 3rd normal form? Why?

71. Can we rewrite subqueries into simple select statements or with joins? Example?

72. What is a function? Give some example?

73. What is a stored procedure?

74. Difference between Function and Procedure-in general?

75. Difference between Function and Stored Procedure?

76. Can a stored procedure call another stored procedure. If yes what level and can it be
controlled?

77. Can a stored procedure call itself(recursive). If yes what level and can it be controlled.?

78. How do you find the number of rows in a table?

79. Difference between Cluster and Non-cluster index?

80. What is a table called, if it does not have neither Cluster nor Non-cluster Index?

81. Explain DBMS, RDBMS?


82. Explain basic SQL queries with SELECT from where Order By, Group By-Having?

83. Explain the basic concepts of SQL server architecture?

84. Explain couple pf features of SQL server

85. Scalability, Availability, Integration with internet, etc.)?

86. Explain fundamentals of Data ware housing & OLAP?

87. Explain the new features of SQL server 2000?

88. How do we upgrade from SQL Server 6.5 to 7.0 and 7.0 to 2000?

89. What is data integrity? Explain constraints?

90. Explain some DBCC commands?

91. Explain sp_configure commands, set commands?

92. Explain what are db_options used for?

93. What is the basic functions for master, msdb, tempdb databases?

94. What is a job?

95. What are tasks?

96. What are primary keys and foreign keys?

97. How would you Update the rows which are divisible by 10, given a set of numbers in
column?

98. If a stored procedure is taking a table data type, how it looks?

99. How m-m relationships are implemented?

100. How do you know which index a table is using?

101. How will oyu test the stored procedure taking two parameters namely first name and
last name returning full name?

102. How do you find the error, how can you know the number of rows effected by last
SQL statement?
103. How can you get @@error and @@rowcount at the same time?

104. What are sub-queries? Give example? In which case sub-queries are not feasible?

105. What are the type of joins? When do we use Outer and Self joins?

106. Which virtual table does a trigger use?

107. How do you measure the performance of a stored procedure?

108. Questions regarding Raiseerror?

109. Questions on identity?

110. If there is failure during updation of certain rows, what will be the state?

Potrebbero piacerti anche