Saturday, April 14, 2012

ASP.Net Interview Question

What is ViewState?

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

What is ASP.NET 2.0 Page Life Cycle?

Main Events 
============= 
1. OnPreInit 
2. OnInit 
3. OnInitComplete 
4. LoadViewState 
5. OnPreLoad 
6. OnLoad 
7. RaisePostBackEvent 
8. OnLoadComplete 
9. OnPreRender 
10. OnPreRenderComplete 
11. SaveViewState 
12. OnRender 
13. OnUnload 

Detailed Events 
============ 
1. Constructor 
2. Construct 
3. TestDeviceFilter 
4. AddParsedSubObject 
5. DeterminePostBackMode 
6. OnPreInit 
7. LoadPersonalizationData 
8. InitializeThemes 
9. OnInit 
10. ApplyControlSkin 
11. ApplyPersonalization 
12. OnInitComplete 
13. LoadPageStateFromPersistenceMedium 
14. LoadControlState 
15. LoadViewState 
16. ProcessPostData1 
17. OnPreLoad 
18. OnLoad 
19. ProcessPostData2 
20. RaiseChangedEvents 
21. RaisePostBackEvent 
22. OnLoadComplete 
23. OnPreRender 
24. OnPreRenderComplete 
25. SavePersonalizationData 
26. SaveControlState 
27. SaveViewState 
28. SavePageStateToPersistenceMedium 
29. Render 
30. OnUnload

What is difference between Trace and Debug?

Use Debug class to debug builds 
Use Trace class for both debug and release builds.

Difference between DataSet and DataReader

DataReader 
=========== 
DataReader is like a forward only recordset. It fetches one row at a time so very less network cost compare to DataSet(Fethces all the rows at a time). DataReader is readonly so we can't do any transaction on them. DataReader will be the best choice where we need to show the data to the user which requires no transaction. As DataReader is forward only so we can't fetch data randomly. .NET Data Providers optimizes the datareader to handle huge amount of data. 

DataSet 
======= 
DataSet is an in memory representation of a collection of Database objects including tables of a relational database schemas. 
DataSet is always a bulky object that requires a lot of memory space compare to DataReader. We can say that the DataSet is a small database because it stores the schema and data in the application memory area. DataSet fetches all data from the datasource at a time to its memory area. So we can traverse through the object to get the required data like querying database.

What is custom tag in web.config file?

Custom tag allows you to create your own tag and specify key value pair for it.

[ASP.Net][Interview Question][ASP Interview Question]

Database Interview Question Part 2


What is the purpose of UPDATE STATISTICS?


Updates information about the distribution of key values for one or more statistics groups (collections) in the specified table or indexed view.

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

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

Grant, Deny and Revoke

What is DTC?

The Microsoft Distributed Transaction Coordinator (MS DTC) is a transaction manager that allows client applications to include several different sources of data in one transaction. MS DTC coordinates committing the distributed transaction across all the servers enlisted in the transaction

How to get GUID in sql server?

select newid(). 
This will return you GUID

What is Check Constraint?

Check constraint specifies a condition that is enforced for each row of the table on which the constraint is defined. Once constraint is defined, insert or update to the data within the tables is checked against the defined constraint.


Can we create a Foreign Key with out Primary Key?

Yes. If the table has Unique Key then it is posible to create a Foreign key constraint


Difference between varchar and char:

varchar are variable length strings with a maximum length specified. If a string is less than the maximum length, then it is stored verbatim without any extra characters. 
char are fixed length strings with a set length specified. If a string is less than the set length, then it is padded with extra characters so that it's length is the set length. 

Use varchar when your strings do not have a fixed length (e.g. names, cities, etc.) 

Use char when your strings are always going to be the same length (e.g. phone numbers, zip codes, etc).

[Database Interview Question][Database][Interview Question][SQL Server]

Database Interview Question

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.

What is a deadlock?

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

What is ACID?

ACID (an acronymn for Atomicity Consistency Isolation Durability) is a concept that Database Professionals generally look for when evaluating databases and application architectures. For a reliable database all this four attributes should be achieved. 

Atomicity is an all-or-none proposition. 

Consistency guarantees that a transaction never leaves your database in a half-finished state. 

Isolation keeps transactions separated from each other until they're finished. 

Durability guarantees that the database will keep track of pending changes in such a way that the server can recover from an abnormal termination. 

Above four rules are very important for any developers dealing with databases

What Is DTS?

DTS is a set of tools you can use to import, export, and transform heterogeneous data between one or more data sources, such as Microsoft SQL Server, Microsoft Excel, or Microsoft Access. Connectivity is provided through OLE DB, an open-standard for data access. ODBC (Open Database Connectivity) data sources are supported through the OLE DB Provider for ODBC.

What is Log Shipping?

In Microsoft SQL Server, you can use log shipping to feed transaction logs from one database to another on a constant basis. Continually backing up the transaction logs from a source database and then copying and restoring the logs to a destination database keeps the destination database synchronized with the source database. This allows you to have a backup server and also provides a way to offload query processing from the main computer (the source server) to read-only destination servers.

What are sequence diagrams? What you will get out of this sequence diagrams?

Sequence diagrams document the interactions between classes to achieve a result, such as a use case. Because UML is designed for object-oriented programming, these communications between classes are known as messages. The sequence diagram lists objects horizontally, and time vertically, and models these messages over time.

What is a tuple?

A tuple is an instance of data within a relational database.

[Database Interview Question][Database][Interview Question][SQL Server]