Posts Tagged ‘interview questions’

SQL Interview Questions

Sunday, December 28th, 2008

What’s the difference between a primary key and a unique key?
Both primary key and unique enforce uniqueness of the column on which they are defined. But by default primary key creates a clustered index on the column, where are unique creates a nonclustered index by default. Another major difference is that, primary key doesn’t allow NULLs, but unique key allows one NULL only.

How do you implement one-to-one, one-to-many and many-to-many relationships while designing tables?
One-to-One relationship can be implemented as a single table and rarely as two tables with primary and foreign key relationships.
One-to-Many relationships are implemented by splitting the data into two tables with primary key and foreign key relationships.
Many-to-Many relationships are implemented using a junction table with the keys from both the tables forming the composite primary key of the junction table.

Define candidate key, alternate key, composite key?
A candidate key is one that can identify each row of a table uniquely. Generally a candidate key becomes the primary key of the table. If the table has more than one candidate key, one of them will become the primary key, and the rest are called alternate keys.

A key formed by combining at least two or more columns is called composite key. 

What are defaults? Is there a column to which a default can’t be bound?
A default is a value that will be used by a column, if no value is supplied to that column while inserting data. IDENTITY columns and timestamp columns can’t have defaults bound to them.

What is a transaction and what are ACID properties?
A transaction is a logical unit of work in which, all the steps must be performed or none. ACID stands for Atomicity, Consistency, Isolation, Durability. These are the properties of a transaction.

What’s the maximum size of a row?
8060 bytes.

What’s the difference between DELETE TABLE and TRUNCATE TABLE commands?
DELETE TABLE is a logged operation, so the deletion of each row gets logged in the transaction log, which makes it slow. TRUNCATE TABLE also deletes all the rows in a table, but it won’t log the deletion of each row, instead it logs the deallocation of the data pages of the table, which makes it faster. Of course, TRUNCATE TABLE can be rolled back.

What are user defined datatypes and when you should go for them?
User defined datatypes let you extend the base SQL Server datatypes by providing a descriptive name, and format to the database. Take for example, in your database, there is a column called Flight_Num which appears in many tables. In all these tables it should be varchar(8). In this case you could create a user defined datatype called Flight_num_type of varchar(8) and use it across all your tables.

What is bit datatype and what’s the information that can be stored inside a bit column?
Bit datatype is used to store boolean information like 1 or 0 (true or false). Until SQL Server 6.5 bit datatype could hold either a 1 or 0 and there was no support for NULL. But from SQL Server 7.0 onwards, bit datatype can represent a third state, which is NULL.

What is OLAP?
On-Line Analytical Processing (OLAP) and the advantages of analysis using multi-dimensional, pre-aggregated data. Maybe you’ve even thought about creating your own multidimensional cubes to give your end users true ad hoc capabilities, including the creation of calculated measures/KPIs. If you’ve relegated that task to the back burner because it was too complex, you’ll be happy to know that SQL 2005 has made the process easier.

Why Use OLAP?
OLAP is useful because it provides fast and interactive access to aggregated data and the ability to drill down to detail. OLAP lets users view and interrogate large volumes of data (often millions of rows) by pre-aggregating the information. It puts the data needed to make strategic decisions directly into the hands of the decision makers, not only through pre-defined queries and reports, but also because it gives end users the ability to perform their own ad hoc queries, minimizing users’ dependence on database developers.

What’s the Secret?
OLAP leverages existing data from a relational schema or data warehouse (data source) by placing key performance indicators (measures) into context (dimensions). Once processed into a multidimensional database (cube), all of the measures are pre-aggregated, which makes data retrieval significantly faster. The processed cube can then be made available to business users who can browse the data using a variety of tools, making ad hoc analysis an interactive and analytical process rather than a development effort. SQL Server 2005’s BI Workbench substantially improves upon SQL Server 2000’s BI capability.

What are constraints? Explain different types of constraints?
Constraints enable the RDBMS enforce the integrity of the database automatically, without needing you to create triggers, rule or defaults.
Types of constraints: NOT NULL, CHECK, UNIQUE, PRIMARY KEY, FOREIGN KEY.

What is an index? What are the types of indexes? How many clustered indexes can be created on a table? I create a separate index on each column of a table. what are the advantages and disadvantages of this approach?
Indexes in SQL Server are similar to the indexes in books. They help SQL Server retrieve the data quicker.
Indexes are of two types. Clustered indexes and non-clustered indexes. When you craete a clustered index on a table, all the rows in the table are stored in the order of the clustered index key. So, there can be only one clustered index per table. Non-clustered indexes have their own storage separate from the table data storage. Non-clustered indexes are stored as B-tree structures (so do clustered indexes), with the leaf level nodes having the index key and it’s row locater. The row located could be the RID or the Clustered index key, depending up on the absence or presence of clustered index on the table.
If you create an index on each column of a table, it improves the query performance, as the query optimizer can choose from all the existing indexes to come up with an efficient execution plan. At the same time, data modification operations (such as INSERT, UPDATE, DELETE) will become slow, as every time data changes in the table, all the indexes need to be updated. Another disadvantage is that, indexes need disk space, the more indexes you have, more disk space is used.

What is RAID and what are different types of RAID configurations?
RAID stands for Redundant Array of Inexpensive Disks, used to provide fault tolerance to database servers. There are six RAID levels 0 through 5 offering different levels of performance, fault tolerance. MSDN has some information about RAID levels and for detailed information, check out the RAID advisory board’s homepage.

What are the steps you will take to improve performance of a poor performing query?
There could be a lot of reasons behind the poor performance of a query. 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.

What are the steps you will take, if you are tasked with securing an SQL Server?
Here are some things you could talk about: Preferring NT authentication, using server, databse and application roles to control access to the data, securing the physical database files using NTFS permissions, using an unguessable SA password, restricting physical access to the SQL Server, renaming the Administrator account on the SQL Server computer, disabling the Guest account, enabling auditing, using multiprotocol encryption, setting up SSL, setting up firewalls, isolating SQL Server from the web server etc.

What is a deadlock and what is a live lock? How will you go about resolving deadlocks?
Deadlock is a situation when two processes, each having a lock on one piece of data, attempt to acquire a lock on the other’s piece. Each process  would wait indefinitely for the other to release the lock, unless one of the user processes is terminated. SQL Server detects deadlocks and terminates one user’s process.
A livelock is one, where a  request for an exclusive lock is repeatedly denied because a series of overlapping shared locks keeps interfering. SQL Server detects the situation after four denials and refuses further shared locks. A livelock also occurs when read transactions monopolize a table or page, forcing a write transaction to wait indefinitely.

What is blocking and how would you troubleshoot it?
Blocking happens when one connection from an application holds a lock and a second connection requires a conflicting lock type. This forces the second connection to wait, blocked on the first.

Explain CREATE DATABASE syntax?
Many of us are used to creating databases from the Enterprise Manager or by just issuing the command: CREATE DATABAE MyDB. But what if you have to create a database with two filegroups, one on drive C and the other on drive D with log on drive E with an initial size of 600 MB and with a growth factor of 15%? That’s why being a DBA you should be familiar with the CREATE DATABASE syntax.

How to restart SQL Server in single user mode? How to start SQL Server in minimal configuration mode?
SQL Server can be started from command line, using the SQLSERVR.EXE. This EXE has some very important parameters with which a DBA should be familiar with -m is used for starting SQL Server in single user mode and -f is used to start the SQL Server in minimal confuguration mode.

As a part of your job, what are the DBCC commands that you commonly use for database maintenance?
DBCC CHECKDB, DBCC CHECKTABLE, DBCC CHECKCATALOG, DBCC CHECKALLOC, DBCC SHOWCONTIG, DBCC SHRINKDATABASE, DBCC SHRINKFILE etc. But there are a whole load of DBCC commands which are very useful for DBAs.

What are statistics, under what circumstances they go out of date, how do you update them?
Statistics determine the selectivity of the indexes. If an indexed column has unique values then the selectivity of that index is more, as opposed to an index with non-unique values. Query optimizer uses these indexes in determining whether to choose an index or not while executing a query.
Some situations under which you should update statistics:
1) If there is significant change in the key values in the index
2) If a large amount of data in an indexed column has been added, changed, or removed (that is, if the distribution of key values has changed), or the table has been truncated using the TRUNCATE TABLE statement and then repopulated
3) Database is upgraded from a previous version

What are the different ways of moving data/databases between servers and databases in SQL Server?
There are lots of options available, you have to choose your option depending upon your requirements. Some of the options you have are: BACKUP/RESTORE, dettaching and attaching databases, replication, DTS, BCP, logshipping, INSERT…SELECT, SELECT…INTO, creating INSERT scripts to generate data.

Explian different types of BACKUPs avaialabe in SQL Server? Given a particular scenario, how would you go about choosing a backup plan?
Types of backups you can create in SQL Sever 7.0+ are Full database backup, differential database backup, transaction log backup, filegroup backup.

What is database replicaion? What are the different types of replication you can set up in SQL Server?
Replication is the process of copying/moving data between databases on the same or different servers. SQL Server supports the following types of replication scenarios:

Snapshot replication
Transactional replication (with immediate updating subscribers, with queued updating subscribers)
Merge replication

How to determine the service pack currently installed on SQL Server?
The global variable @@Version stores the build number of the sqlservr.exe, which is used to determine the service pack installed.

What are cursors? Explain different types of cursors?What are the disadvantages of cursors? How can you avoid cursors?
Cursors allow row-by-row prcessing of the resultsets.
Types of cursors: Static, Dynamic, Forward-only, Keyset-driven.

Disadvantages of cursors: Each time you fetch a row from the cursor, it results in a network roundtrip, where as a normal SELECT query makes only one rowundtrip, however large the resultset is. Cursors are also costly because they require more resources and temporary storage (results in more IO operations). Further, there are restrictions on the SELECT statements that can be used with some types of cursors.
Most of the times, set based operations can be used instead of cursors. Here is an example:

If you have to give a flat hike to your employees using the following criteria:

Salary between 30000 and 40000 — 5000 hike
Salary between 40000 and 55000 — 7000 hike
Salary between 55000 and 65000 — 9000 hike

In this situation many developers tend to use a cursor, determine each employee’s salary and update his salary according to the above formula. But the same can be achieved by multiple update statements or can be combined in a single UPDATE statement as shown below:

UPDATE tbl_emp SET salary =
CASE WHEN salary BETWEEN 30000 AND 40000 THEN salary + 5000
WHEN salary BETWEEN 40000 AND 55000 THEN salary + 7000
WHEN salary BETWEEN 55000 AND 65000 THEN salary + 10000
END

Another situation in which developers tend to use cursors: You need to call a stored procedure when a column in a particular row meets certain condition. You don’t have to use cursors for this. This can be achieved using WHILE loop, as long as there is a unique key to identify each row. For examples of using WHILE loop for row by row processing.

Write down the general syntax for a SELECT statements covering all the options?
Here’s the basic syntax:

SELECT select_list
[INTO new_table_]
FROM table_source
[WHERE search_condition]
[GROUP BY group_by_expression]
[HAVING search_condition]
[ORDER BY order_expression [ASC | DESC] ]

What is a join and explain different types of joins?
Joins are used in queries to explain how different tables are related. Joins also let you select data from a table depending upon data from another table.

Types of joins: INNER JOINs, OUTER JOINs, CROSS JOINs. OUTER JOINs are further classified as LEFT OUTER JOINS, RIGHT OUTER JOINS and FULL OUTER JOINS.

Can you have a nested transaction?
Yes,we can have a nested transaction.

What is an extended stored procedure? Can you instantiate a COM object by using T-SQL?
An extended stored procedure is a function within a DLL (written in a programming language like C, C++ using Open Data Services (ODS) API) that can be called from T-SQL, just the way we call normal stored procedures using the EXEC statement.
Yes, you can instantiate a COM (written in languages like VB, VC++) object from T-SQL by using sp_OACreate stored procedure.

What is the system function to get the current user’s user id?
USER_ID(). Also check out other system functions like USER_NAME(), SYSTEM_USER, SESSION_USER, CURRENT_USER, USER, SUSER_SID(), HOST_NAME().

What are triggers? How many triggers you can have on a table? How to invoke a trigger on demand?
Triggers are special kind of stored procedures that get executed automatically when an INSERT, UPDATE or DELETE operation takes place on a table.
In SQL Server 6.5 you could define only 3 triggers per table, one for INSERT, one for UPDATE and one for DELETE. From SQL Server 7.0 onwards, this restriction is gone, and you could create multiple triggers per each action. But in 7.0 there’s no way to control the order in which the triggers fire. In SQL Server 2000 you could specify which trigger fires first or fires last using sp_settriggerorder
Triggers can’t be invoked on demand. They get triggered only when an associated action (INSERT, UPDATE, DELETE) happens on the table on which they are defined.
Triggers are generally used to implement business rules, auditing. Triggers can also be used to extend the referential integrity checks, but wherever possible, use constraints for this purpose, instead of triggers, as constraints are much faster.
Till SQL Server 7.0, triggers fire only after the data modification operation happens. So in a way, they are called post triggers. But in SQL Server 2000 you could create pre triggers also.
There is a trigger defined for INSERT operations on a table, in an OLTP system. The trigger is written to instantiate a COM object and pass the newly insterted rows to it for some custom processing.

What do you think of this implementation? Can this be implemented better?
Instantiating COM objects is a time consuming process and since you are doing it from within a trigger, it slows down the data insertion process. Same is the case with sending emails from triggers. This scenario can be better implemented by logging all the necessary data into a separate table, and have a job which periodically checks this table and does the needful.

What is a self join? Explain it with an example.
Self join is just like any other join, except that two instances of the same table will be joined in the query. Here is an example: Employees table which contains rows for normal employees as well as managers. So, to find out the managers of all the employees, you need a self join.

CREATE TABLE emp
(
empid int,
mgrid int,
empname char(10)
)

INSERT emp SELECT 1,2,’Vyas’
INSERT emp SELECT 2,3,’Mohan’
INSERT emp SELECT 3,NULL,’Shobha’
INSERT emp SELECT 4,2,’Shridhar’
INSERT emp SELECT 5,2,’Sourabh’

SELECT t1.empname [Employee], t2.empname [Manager]
FROM emp t1, emp t2
WHERE t1.mgrid = t2.empid

Here’s an advanced query using a LEFT OUTER JOIN that even returns the employees without managers (super bosses)

SELECT t1.empname [Employee], COALESCE(t2.empname, ‘No manager’) [Manager]
FROM emp t1
LEFT OUTER JOIN
emp t2
ON
t1.mgrid = t2.empid

General Dot Net Interview Questions

Friday, December 12th, 2008

Key differences in features of .NET 2.0 and 3.5? 
.NET 3.5 has more advanced feature than .NET 2.0.They are WCF, WPF, WCS,WF and LINQ.

Is Dot-Net platform dependent or platform indipendent?
Net is not platform independent as it needs .Net framework to run. As MS is the owner, so it is including .Net frameworks in latest versions of Windows.MS is providing service pack using which you can manage old versions of Windows and other operating systems like Unix, Linux. But not yet, .Net is running in UNIX and Linux. So it is not platform independent. As it comprises of lot of languages, you can say it as language independent.
MS is saying Windows is best operating system but they are developing Windows OS on Unix platform.Also Java, it is also not platform independent as it requires JVM (Java Virtual Machine to run). But the case is JVM is coming in all operating systems by default. So you can take it as platform independent.

What is CAS? 
CAS: CAS is the part of the .NET security model that determines whether or not a piece of code is allowed to run, and what resources it can use when it is running. For example, it is CAS that will prevent a .NET web applet from formatting your hard disk. How does CAS work? The CAS security policy revolves around two key concepts - code groups and permissions. Each .NET assembly is a member of a particular code group, and each code group is granted the permissions specified in a named permission set. For example, using the default security policy, a control downloaded from a web site belongs to the ‘Zone - Internet’ code group, which adheres to the permissions defined by the ‘Internet’ named permission set. (Naturally the ‘Internet’ named permission set represents a very restrictive range of permissions.) 

IIS port number? How We get it? 
IIS default port numbers for http is 80 , for https 81, and for ftp its 21. These are the default port numbers but we can override this port numbers while creating a website (either SSL or normal) and while creating a ftp folder. 

What is postback form and what is autopostback? 
PostBack: It means page automatically goes to server and we can just make a check whther our page is on server for the first time or not.
Propert Page.IspostBack== true means your page has made a server visit. It is only a readOnly property i.e. we can only check that, cannot set this property accordingly.
AutoPostBack: It is property for .net controls to allow them to post the page to server and execute code-behind code at their events.
By Default,Button has this property set to true. For other controls like DropDownList,RadioButtonList etc., we have to set set it to true if we want to perform an action at their events like selectedIndexChanged etc.

How can you tell the application to look for assemblies at the locations other than its own install? 
Use the directive in the XML .config file for a given application. Make Your Homepage.

VB.Net Interview Questions

Thursday, October 16th, 2008

What is the purpose of .net frame work? 
.Net Framework is an umbrella technology and has a lot of different technologies under it. For example, it
1. introduces Asp.net for web development
2. has languages to write Windows program, Windows services, Web Services.
3. pre-coded solutions to common programming problems     called base class library. It includes user interface data accessdatabase connectivity cryptography web application development, numeric algorithms, and network communications
4. a runtime or virtual machine that manages the execution of programs written specifically for the framework,
5. and a set of tools for configuring and building applications  like visual studio.
It also introduces language independence by introducing common language runtime. You can write code in any language.
The .NET Framework is a key Microsoft offering and is intended to be used by most new applications created for the Windows platform.

What is the difference between visual basic and visual basic dot net?
VB.NET is Microsoft’s Visual Basic implemented onto their .NET Framework. While Visual Basic is part of Visual Studio, VB.NET is also part of the Visual Studio.NET release.

What is JIT(Just In Time) and How it works? 
Before the code can be executed,the .NET framework needs to convert the IL into CPU-specific code.the Just-In-Time(JIT) compiler translates the code from IL into managed native code.During the compilation,the JIT compiler compiles only the code that is required during execution instead of compiling the complete IL code.when an uncompiled method is invoked during execution,the JIT compiler converts the IL for that method into native code.during this  the code is also checked for type safety,Type safety ensures that objects are always accessed in a compilation way.

Crystal Reports

How to Pass string value to crystal report 11?
Code for this

Dim crParameterFieldDefinitions As ParameterFieldDefinitions
Dim crParameterFieldDefinition AsParameterFieldDefinition
Dim crParameterValues As New ParameterValues
Dim crParameterDiscreteValue1 As NewParameterDiscreteValue

crParameterDiscreteValue1.Value = Trim(tbPRAM.Text) — text box to hold value

crParameterFieldDefinitions =cryRpt.DataDefinition.ParameterFields()
crParameterFieldDefinition = crParameterFieldDefinitions.Item(”PRAM”)
crParameterValues =crParameterFieldDefinition.CurrentValues

crParameterValues.Clear()
crParameterValues.Add(crParameterDiscreteValue1)

crParameterFieldDefinition.ApplyCurrentValues(crPar ameterValues)

parameter PRAM must be set in your report.

How does VB.NET/C# achieve polymorphism? 
You can achive polymorphism by doing overloading and overwriting.
 

ASP.Net Interview Questions

Saturday, October 11th, 2008

ASP.Net is a language or not? 
ASP.NET is not a language.It’s a frame work we can use to develop websites.

What is aspx? 
aspx is the extension used for Microsoft ASP.NET web pages.
ASP.NET is a framework that runs on the MS web server and allows for rich dynamic content. aspx files are compiled rather than interpreted, and run much faster than other scripted files.

What is the difference between ASP.NET &VB.NET?
Asp.net and vb.net both are in dot net family but asp.net is used to develop web site(web application) and vb.net is used to create a windows application.

What is the major difference between asp.net and c#.net? 
Asp.net is used to develop a web application by either using vb or c# based syntax. C#.net is used to develop a windows application.

What is the .net,why we use .net.what is the advantage to using .net other programming languages? 
.net is not a technology or language .it is an environment to develop an application either web/window/console based
It provide the ability to achieve versioning.
Remove legacy/dependancy over os end the com based componet.
Can acheieve side by side exceution.

How to publish my asp .net project on web site?
1.Rename to your home page as index.aspx

2.Open internet explorer and type the url ftp://xxxxx.xxx (your url).

3.You shoud enter the user name and password.

4.You can get some folders, in that open httpdocs, in this you have to paste the all pages.You can also paste the folders also but you should paste the all pages must directly but don’t paste in other folders.

What is Web.config file in ASP.NET? 
Web.config file, as it sounds like is a configuration file for the Asp .net web application.An Asp.net application has one web.config file which keeps configurations required for the corresponding application.Web.config file is written in XML with specific tags having specific meanings.We have Machine.config file also. As web.config file is used to configure one asp .net web application, same way Machine.config file is used to configure the application according to a particular machine. That is, configuration done in machine.config file is affected on any application that runs on a particular machine. Usually, this file is not altered and only web.config is used which configuring applications. 

What is the trace in ASP.NET? 
ASP.NET introduces new functionality that allows you to view diagnostic information about a single request for an ASP.NET page simply by enabling it for your page or application. Called tracing, this feature also allows you to write debug statements directly in your code without having to remove them from your application when it is deployed to production servers. You can write variables or structures in a page, assert whether a condition is met, or simply trace through the execution path of your page or application.  

What is Viewstate? 
View state is used by the ASP.NET page framework to automatically save the values of the page and of each control just prior to rendering to the page.When the page is posted, one of the first tasks performed by page processing is to restore view state. State management is the process by which you maintain state and page information over multiple requests for the same or different pages. 

Diffrence Between ServerSide and ClientSideCode ? 
server side code is responsible to execute and provide the executed code to the browser at the client side. The executed code may be either in XML or Plain HTML the executed code only have the values or the results that are executed on the server. The clients browser executes the HTML code and displays the result where as the client side code executes at client side and displays the result in its browser.The client side core consist of certain functions that are to be executed on server then it places request to the server and the server responses as the result in form of HTML.
 

Diffrence Between ServerSide and ClientSideCode ? 
Server side code is responsible to execute and provide the executed code to the browser at the client side. The executed code may be either in XML or Plain HTML the executed code only have the values or the results that are executed on the server. The clients browser executes the HTML code and displays the result where as the client side code executes at client side and displays the result in its browser.The client side core consist of certain functions that are to be executed on server then it places request to the server and the server responses as the result in form of HTML. 
 

Define three test cases you should go through in unit testing? 
1)Positive test cases (correct data, correct output).
2)Negative test cases (broken or missing data,proper handling).
3)Exception test cases (exceptions are thrown and caught properly).

What debugging tools come with the .NET SDK?
1. CorDBG – command-line debugger. To use CorDbg, you must compile the original C# file using the /debug switch.
2. DbgCLR – graphic debugger. Visual Studio .NET uses the DbgCLR. 
 
Where are shared assemblies stored ? 
Global assembly cache.

What is a web services? 
Web services is a excellent way of performing remote method calls.
Its a platform independent one because it follows the xml standards.
We can find the available services in http://uddi.org/ is the place for universal description,discovery and integration of web services.

Why web services are used in asp.net?
It is a specification to achieve cross language,cross pltform and cross device integration (or)it can be considered as a class definition  where the definitions is maintained with in the web server as a service such that the definitions  can be accessed from any application developed using any language for any platform or device.

What is the transport protocol you use to call a Web service? 
SOAP is the preferred protocol.

How can you debug failed assembly binds? 
Use the Assembly Binding Log Viewer (fuslogvw.exe) to find out the paths searched.  

What is the purpose of .net frame work? 
Net Framework is an umbrella technology and has a lot of different technologies under it. For example, it
1. Introduces Asp.net for web development
2. Has languages to write Windows program, Windows services, Web Services.
3. Pre-coded solutions to common programming problems   called base class library. It includes user interface data accessdatabase connectivity cryptography web application development, numeric algorithms, and network communications
4. A runtime or virtual machine that manages the execution of programs written specifically for the framework,and a set of tools for configuring and building applications  like visual studio.

It also introduces language independence by introducing common language runtime. You can write code in any language.
The .NET Framework is a key Microsoft offering and is intended to be used by most new applications created for the Windows platform. 

What is the difference between Server.Transfer and Response.Redirect? Why would I choose one over the other? 
Server.Transfer is used to post a form to another page. Response.Redirect is used to redirect the user to another page or site. 

Name two properties common in every validation control?
ControlToValidate property and Text property.

What is Satellite Assemblies?
Satellite assemblies are often used to deploy language-specific resources for an application. These language-specific assemblies work in side-by-side execution because the application has a separate product ID for each language and installs satellite assemblies in a language-specific subdirectory for each language. When uninstalling, the application removes only the satellite assemblies associated with a given language and .NET Framework version. No core .NET Framework files are removed unless the last language for that .NET Framework version is being removed. For example, English and Japanese editions of the .NET Framework version 1.1 share the same core files. The Japanese .NET Framework version 1.1 adds satellite assemblies with localized resources in a \\ja subdirectory. An application that supports the .NET Framework version 1.1, regardless of its language, always uses the same core runtime files. 

What data type does the RangeValidator control support?
Integer,String and Date.

What is Web.config file in ASP.NET? 
Web.config file, as it sounds like is a configuration file for the Asp .net web application. An Asp .net application has one web.config file which keeps configurations required for the corresponding application. Web.config file is written in XML with specific tags having specific meanings.We have Machine.config file also. As web.config file is used to configure one asp .net web application, same way Machine.config file is used to configure the application according to a particular machine. That is, configuration done in machine.config file is affected on any application that runs on a particular machine. Usually, this file is not altered and only web.config is used which configuring applications.

What do you mean Class?
Class is an organized store-home in object-oriented programming that gives coherent functional abilities to a group of related code. Its are definition of an object, made up of software code. Using classes, you may wrap data and behavior together (Encapsulation).you may define classes in terms of classes (Inheritance).We can also override the behavior of a class using an alternate behavior (Polymorphisms).

Difference between Abstract and Interface?  
1.We can’t create instances for both
2.Single inheritance in abstract class, multiple inheritance in interface
3.We can have concrete method in abstact class but not in the interface
4.Any class that needs to use abstract must extent
5.Any class that needs to use interface must implement
6.Interface all the variables are static and final.

What’s the difference between private and shared assembly?
Private assembly is used inside an application only and does not have to be identified by a strong name. Shared assembly can be used by multiple applications and has to have a strong name.

In your asp.net application there is a textbox, How can clear the textbox with out round trip?
Assume that your textbox ID is txt. And the button ID is btn. If you want to clear the text from textbox by clicking the button without refresh then do the following steps.

1) In Page_Load  write

btn.Attributes.Add(\”OnClick\”,\”clearIt();\”);

2) In javascript write the function

function clearIt()

{

document.getElementById(\’txt\’).value = \”\”;

}

Can we use http handlers to upload a file in asp.net? 
You can use HttpHandlers. But it is very limited. You can not get response back (status) if you use it. And it is very complex also. Generally we use Http Handlers to handle requests at Server Side like Putting common Authentication on Web services whole organization wide like this.

What is user control? 
User Control are the controls created by user. User Controls are created with the file .ascx extension. Suppose if same controls are to be repeated in several pages,we can create a user control and display it in all those pages. They have to be registered in the page with @Register directive.

Suppose you want a certain ASP.NET function executed on MouseOver for a certain button. Where do you add an event handler? 
Add an OnMouseOver attribute to the button.
Example: btnSubmit.Attributes.Add(”onmouseover”,”someClientCodeHere();”).

Whats an assembly? 
Assemblies are the building blocks of .NET Framework applications; they form the fundamental unit of deployment, version control, reuse, activation scoping, and security permissions. An assembly is a collection of types and resources that are built to work together and form a logical unit of functionality. An assembly provides the common language runtime with the information it needs to be aware of type implementations. To the runtime, a type does not exist outside the context of an assembly.

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? 
DataTextField property.

How to dynamically change connection string in web.config? 
In web.config
<appsetting>
<add key =\”constr\” value =\”Persist Security Info=False;User ID=sa;password=sa;Initial Catalog=Database Name;Data Source=server Name\”/>
</appSettings>
in aspx page
string _constr;
_constr=ConfigurationManager.AppSettings[\"constr\"].ToString().

What is Flex-Grid in ASP.NET? 
In .net all data controls (GridView,Repeater,Datalist) are act like Flex grid.

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.

What is the trace in ASP.NET? 
ASP.NET introduces new functionality that allows you to view diagnostic information about a single request for an ASP.NET page simply by enabling it for your page or application. Called tracing, this feature also allows you to write debug statements directly in your code without having to remove them from your application when it is deployed to production servers. You can write variables or structures in a page, assert whether a condition is met, or simply trace through the execution path of your page or application.  

What is delay signing? 
Delay signing allows you to place a shared assembly in the GAC by signing the assembly with just the public key. This allows the assembly to be signed with the private key at a later stage, when the development process is complete and the component or assembly is ready to be deployed. This process enables developers to work with shared assemblies as if they were strongly named, and it secures the private key of the signature from being accessed at different stages of development.

What is the use of AutoWireup in asp.net? 
AutoEventWireup attribute is used to set whether the events needs to be automatically generated or not.

What base class do all Web Forms inherit from? 
The Page class.

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? 
You must set the DataSource property and call the DataBind method.

How to give hyperlink to a file in “asp net”? 
Use <a href=\”file:///hello.txt\”>Open file</a>

What are Codes Refactoring? 
It feature of Visual Web Express.Codes Refactoring Codes Refactoring enables we to easily and systematical makes changes to your code. Code Refactoring is support everywhere that you can writes codes including both code-behind and single-file ASP.NET pages. automatically promote a public field to a full property.

What is ASP.Net Web Matrix? 
This is a free ASP.NET development environment from Microsoft. As well as a GUI development environment, download includes simple web server that can be used instead of IIS to host ASP.NET apps. This opens up ASP.NET development to users of Windows XP Home Edition, which cannot run IIS.

What’s a strong name ? 
A strong name includes the name of the assembly, version number, culture identity, and a public key token.

What’s a bubbled event? 
When you have a complex control, like DataGrid, writing an event processing routine for each object (cell, button, row, etc.) is quite tedious. The controls can bubble up their eventhandlers, allowing the main DataGrid event handler to take care of its constituents.

What are the different types of sessions in ASP.Net? Name them? 
1.In Proc mode: stores session state in a web server by default.
2.State server mode: stores session state in a separate process called asp.net state services. Ensure that session state is preserved when web application is restarted and make session state available to multiple webservers within a web farm.
3.Sql server mode: stores session state in sql server database. State is preserved when application is restarted and available to multiple webservers.
4.Custom mode: enables you to store a custom session storage provider.
5.OFF mode: disable session state.

Difference between session and cookie? 
Cookies will set the same value for the variable or string throught the whole application when ever it is being run.But session sets or stores the value only till the time period when the application is running once if the application is closed the session value also willl become null.

Explain what a diffgram is? and a good use for one? 
The DiffGram is one of the two XML formats that you can use to render DataSet object contents to XML. For reading database data to an XML file to be sent to a Web Service.

Describe the role of inetinfo.exe, aspnet_isapi.dll andaspnet_wp.exe in the page loading process? 
inetinfo.exe is the Microsoft IIS server running, handling ASP.NET requests among other things.When an ASP.NET request is received (usually a file with .aspx extension),the ISAPI filter aspnet_isapi.dll takes care of it by passing the request tothe actual worker process aspnet_wp.exe. 

How to make Virtual Directory? 
Click “Start > settings> control Panel > Administrative Tools > internet information services”.Expand Internet Information Server. Expand the server name. In the left pane, right-click Default Web Site, point to New, and then click Virtual Directory. . In the first screen of the New Virtual Directory Wizard, type an alias, or name, for the virtual directory (site name), and then click Next. . In the second screen, click Browse. Locate the content folder that you created to hold the Web content. Click Next. In the third screen, click to select Read and Run scripts (such as ASP). Make sure that the other check boxes are cleared. Click Finish to complete the wizard.

Which method do you invoke on the DataAdapter control to load your generated dataset with data? 
The .Fill() method

Where are shared assemblies stored ? 
Global assembly cache.

Can I dynamically set the Image URL for Image Control? A)No B)Yes 
YES Why Not.
Hint: Use eval

How are you Write to XML File ? 
XmlTextWriter textWriter=new XmlTextWriter(’filename.xml’);
 
//WriteStartDocument and WriteEndDocument methods open and close a document for writing textWriter.WriteStartDocument()
//write comment text Writer. Write Comment(’this is my first xml file.’) textWriter.WriteComment(’i'm lovin it’) textWriter.WriteStartElement(’studentDB’) //

write first elementtextWriter.WriteStartElement(’student’) textWriter.WriteStartElement(’name’,”);
textWriter.WriteString(’sourabh’);
textWriter.WriteEndElement();
textWriter.WriterEndElement();
textWriter.WriteEndDocument();
textWriter.Close();
}

Whats the significance of Request.MapPath( ) ?
Maps the virtual path in the requested URL to a physical path on the server for the current request.

What type of code (server or client) is found in a Code-Behind class ? 
Server-side code.

How to connect asp.net with sql server ? 
It can be done through ADO.Net(Connected or Disconnected Architecture).

How long the value session variable has an effect when it not used by the program ? 
20 Minutes.

Where’s global assembly cache located on the system ? 
Usually C:\\winnt\\assembly or C:\\windows\\assembly.

Automatic Memory Management ? 
It’s entirely too easy for a small mistake to cause a program to chew up memory and crash, sometimes bringing the operating system to a screeching halt in the process. Programmers understand that they’re responsible for releasing any memory that they allocate, but they’re not very good at actually doing it. In addition, functions that allocate memory as a side effect abound in the Windows API and in the C runtime library. It’s nearly impossible for a programmer to know all of the rules. Even when the programmer follows the rules, a small memory leak in a support library can cause big problems if called enough. The .NET Framework solves the memory management problems by implementing a garbage collector that can keep track of allocated memory references and release the memory when it is no longer referenced. A large part of what makes this possible is the blazing speed of today’s processors. When you’re running a 2 GHz machine, it’s easy to spare a few cycles for memory management. Not that the garbage collector takes a huge number of cycles–it’s incredibly efficient. The garbage collector isn’t perfect and it doesn’t solve the problem of mis-managing other scarce resources (file handles, for example), but it relieves programmers from having to worry about a huge source of bugs that trips almost everybody up in other programming environments. On balance, automatic memory management is a huge win in almost every situation.

What is the base class of the .Net ? 
System.Object.

What technology is used to seperate the code from asp.net page ? 
Partial page class.

True or False: A Web service can only be written in .NET ? 
False

Which template must you provide, in order to display data in a Repeater control ? 
ItemTemplate.

Describe the difference between inline and code behind ?  
The main difference comes in that inline code is executed at a certain event level in the page lifecycle whether code-behind can be bounded to different levels of events (PreInit, Init, PreLoad, Load, DataBound, Unload, PreRender and so on)
Inline code written along side the html in a page. Code-behind is code written in a separate file and referenced by the .aspx page.

How can you tell the application to look for assemblies at the locations other than its own install ? 
Use the directive in the XML .config file for a given application.

Which control would you use if you needed to make sure the values in two different controls matched ? 
CompareValidator Control.

Define a transaction. What are acid properties of a transaction ? 
Transaction is a sequence of operation performed as single unit of work. The sequence in which the operation are performed have the importance.
ACID (Atomicity,Consistency,Isolation and Durability) properties of a transaction are as follows:
Atomicity : Either all the operation of the transaction must be completed successfully or none of the operation is done at all.
Consistency: Completion of transaction must have the data in a consistent state.
Isolation: Changes made current transaction must be isolated from any other transaction running simultaneously.
Durability : Once the transaction is complete, it;s changes must persist permanently in the system.

What is the Global.asax used for? 
The Global.asax (including the Global.asax.cs file) is used to implement application and session level events. It resides in the root directory of the application. The .asax file extension signals that it’s an application file rather than an ASP.NET file that uses aspx. The Global.asax file is the central point for ASP.NET applications. It provides numerous events to handle various application-wide tasks such as user authentication, application start up, and dealing with user sessions. You should be familiar with this optional file to build robust ASP.NET-based applications.

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? 
You must set the DataSource property and call the DataBind method.

Does ASP.NET supports Linux Environment? 
Mono provides the necessary software to develop and run .NET client and server applications on Linux, Solaris,Mac OS X, Windows, and Unix. Sponsored by Novell, the Mono open source project has an active and enthusiasticcontributing community and is positioned to become the leading choice for development of Linux applications.

Name two properties common in every validation control? 
ControlToValidate property and Text property.

What is the importance of HTML in web applications? 
It is important.But now-a-days due to other languages its use is decreasing.Earlier it was highly used for all sites.

How to attach javascript code into asp.net code?
Inorder to use script in your asp.net page place the script under head tag of ur aspx source page like this:
<head>
<script type=\”text/javascript\”>

———————-

—————–(place the script components here)

————————

—————————
</script>
</head>
 
Call the script functions from any control events called \”onclick()\” or \”onclientclick()\”

How ASP .NET different from ASP? 
Difference between ASP and ASP.NET

ASP stands for Active Server Pages. ASP.NET is the next
generation of ASP. After the introduction of ASP.NET, old
ASP is called ‘Classic ASP’.

Classic ASP uses vb script for server side coding. Instead,
ASP.NET supports more languages including C#, VB.NET, J#
etc. VB.NET is very similar to vb script, so it should be
easy for old Visual Basic or ASP programmers to switch to
VB.NET and ASP.NET

VB Script is a simple scripting language, where as VB.NET
or C# are modern, very powerfull, object oriented
programming languages. Just for that reason, you will be
able to write much more robust and reliable programs in
ASP.NET compared to ASP.

In classic ASP, there was no server controls. You have to
write all html tags manually. ASP.NET offers a very rich
set of controls called Server Controls and Html Controls.
It is very easy to drag and drop any controls to a web
form. The VS.NET will automatically write the required HTML
tags automatically for you.

ASP is interpreted, ASP.NET is compiled.

What is difference between Webportal and website?
A Website is all the pages, images and files contained under a domain name - such as www.happy-online.co.uk
A Web Portal is a type of Website. A Web Portal acts as a gateway to the internet. (A typical dictionary definition of the word portal would be - a doorway or a grand entrance.)
Take the website www.yahoo.com, this is a website, all the pages under the domain www.yahoo.com combine to make the website. However, Yahoo is often referred to as a Web Portal, if you have a look at the Yahoo Website you can see why it has often been called a Portal. The Website acts as a doorway (Portal) to the Internet, from the website you can search the web, go shopping, take part in auctions, read your email etc.

Key differences in features of .NET 2.0 and 3.5? 
.NET 3.5 has more advanced feature than .NET 2.0.They are WCF, WPF, WCS,WF and LINQ

What is cache?
A temporary data storage location, or the process of storing data temporarily. A cache is typically used for quick data access.

How to connect to sql server using windows authentication in asp?
In <Connection string> of web config file:
Write:
\”server=servername;datasource=databaseName;IntegratedSecurity=true\”
Done

What is Remoting? 
Remoting i s communication between  computers which are connect to each other through lan.

What is the .net,why we use .net.what is the advantage to using .net other programming languages? 
.net is not a technology or language .It is an environment to develop an application either web/window/console based.
It provide the ability to achieve versioning.
Remove legacy/dependancy over os end the com based componet.
Can acheieve side by side exceution.

How can you tell the application to look for assemblies at the locations other than its own install? 
Use the directive in the XML .config file for a given application.

Should validation (did the user enter a real date) occur server-side or client-side? Why? 
Client-side. This reduces an additional request to the server to validate the users input.

What is benefit of using grid? 
Main advantage with the grid is we can write bubble events means if we want to place some controls like text box, dropdownlist.To capture those child control events we can write only one single method for column of the grid.

How can i get the next records in gridview by clicking on “next”button using asp.net with C#? 
Gridview.selectedindex=girdview.selectedindex+1.

How to pass values from one form to another form? 
We can send information from one form to another using Cookies,Session,POST and GET methods in the form.

You have a query that runs slowly, how would you make it better? 
By creating index for the table to run the query fast and better.

Where do you store the information about the user’s locale? 
System.Web.UI.Page.Culture.

How to select ,edit,delete data through the datagrid control? 
There is a property name called CommandName in the Data Grid row item. With you can differentiate the select wdit and delete.

What does WSDL stand for? 
Web Services Description Language.

What is global.asax? 
Event procegars as to be placed with in specal file called as glob al.asax.

How many config files are there in Asp.net? 
THERE IS ONLY ONE CONFIGURATION FILE i.e web.config file for an application.The web.config file mantains configuration settings of an application.It is written in xml.

How to get the individual control index inside an item template of a datagrid as my item template have more than one web controls? 
Suppose you have many controls in datagrid itemtemplate. If you want to find any of them you can simple follow following synatax
ControlType NameOfControl = e.Item.FindControl(\”ActualNameofControlInDataGrid \”) as ControlType.

Example:
Lets further explain it with example.
Suppose you have a checkbox named \”chkBoxMessage\” in your datagrid and you want to find it. You simply write following code.

CheckBox chkBoxMessage = e.Item.FindControl(\”chkBoxMessage\”) as CheckBox.

What does the term immutable mean? 
It means to create a view of data that is not modifiable and is temporary of data that is modifiable. Immutable means you can’t change the currrent data,but if you perform some operation on that data, a new copy is created. The operation doesn’t change the data itself. Like let’s say you have a string object having ‘hello’ value. Now if you say temp = temp + ‘new value’ new object is created, and values is saved in that. The temp object is immutable, can’t be changed. An object qualifies as being called immutable if its value cannot be modified once it has been created. For example, methods that appear to modify a String actually return a new String containing the modification. Developers are modifying strings all the time in their code. This may appear to the developer as mutable - but it is not. What actually happens is your string variable/object has been changed to reference a new string value containing the results of your new string value. For this very reason .NET has the System.Text.StringBuilder class. If you find it necessary to modify the actual contents of a string-like object heavily, such as in a for or foreach loop, use the System.Text.StringBuilder class. 

What is the differences between release and debug in asp.net?
Actually the diffrence between the debug and release mode is, in debug mode the advance version of the .exe file could not replaced while in release mode it is replaced to the new .exe.

How we implement Web farm and Web Garden concept in ASP.NET?At least give an example.
When an application is hosted by multiple processes on the same server it is said to be a web garden environment.Also if an application is hosted by multiple servers then it is said to be web farm environment.

Is it possible to make windows application in asp.net if not then what kind of software use or technique use for making windows application?
We can make windows application on Asp.Net with VB.Net or C#