Ans)
Development Environment – It is the place where we develop our application/product. Here all the coders or programmers develops the application/product by writing code.
Production Environment – When the application/product is ready for release to the end-users. When that application/product executes or run in the target machine live.
Ans)
Development Environment – It is the place where we develop our application/product. Here all the coders or programmers develops the application/product by writing code.
Production Environment – When the application/product is ready for release to the end-users. When that application/product executes or run in the target machine live.
----------------------------------------------------
----------------------------------------------------
Sql Server Interview questions part-1
Ans)
Primary Key Restrict duplicate values and null values each table can have only one primary key,default clustered index is the primary key.
unique key restrict duplicate values and allow only one null value. default non clustered index is an unique key
------------------------------------
2)What is the clause that specifies a condition for a group or an aggregate?
Ans)
Select from following answers:
A. Distinct
B. Where clause
C. Exists
D. Having Clause
Having Clause
This is how we can create a condition laid on a group or aggregate
Example :
SELECT column_name, aggregate_function(column_name)
FROM table_name
WHERE column_name operator value
GROUP BY column_name
HAVING aggregate_function(column_name) operator value
------------------------------------------------------------------------
3) Which command removes all the rows from the table without logging individual row deletions ?
Ans)
Select from following answers:
A. Truncate
B. delete
C. drop
D. Alter
Truncate will not log individual row deletion.
Here is an example of how we can count the rows before and after truncate
SELECT COUNT(*) AS BeforeTruncateCount FROM MyTable.MyJob;
TRUNCATE TABLE MyTable.MyJob;
SELECT COUNT(*) AS AfterTruncateCount FROM MyTable.MyJob;
---------------------------------------------------------------------
4) What is the command that is used to set a set of privileges that can be granted to users or different roles?
Ans)
Select from following answers:
A. Create Authority
B. Create Grant
C. Create Role
D. Create Authentication
Role Command is used to set the set of privileges which can be granted to users.
An example:
CREATE ROLE editors AUTHORIZATION db_SecurityServices;
Ans)
Primary Key Restrict duplicate values and null values each table can have only one primary key,default clustered index is the primary key.
unique key restrict duplicate values and allow only one null value. default non clustered index is an unique key
------------------------------------
2)What is the clause that specifies a condition for a group or an aggregate?
Ans)
Select from following answers:
A. Distinct
B. Where clause
C. Exists
D. Having Clause
Having Clause
This is how we can create a condition laid on a group or aggregate
Example :
SELECT column_name, aggregate_function(column_name)
FROM table_name
WHERE column_name operator value
GROUP BY column_name
HAVING aggregate_function(column_name) operator value
------------------------------------------------------------------------
3) Which command removes all the rows from the table without logging individual row deletions ?
Ans)
Select from following answers:
A. Truncate
B. delete
C. drop
D. Alter
Truncate will not log individual row deletion.
Here is an example of how we can count the rows before and after truncate
SELECT COUNT(*) AS BeforeTruncateCount FROM MyTable.MyJob;
TRUNCATE TABLE MyTable.MyJob;
SELECT COUNT(*) AS AfterTruncateCount FROM MyTable.MyJob;
---------------------------------------------------------------------
4) What is the command that is used to set a set of privileges that can be granted to users or different roles?
Ans)
Select from following answers:
A. Create Authority
B. Create Grant
C. Create Role
D. Create Authentication
Role Command is used to set the set of privileges which can be granted to users.
An example:
CREATE ROLE editors AUTHORIZATION db_SecurityServices;
Ans) inetinfo.exe is theMicrosoft 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.
*************************************************************************
Q 3) Can we declare event and delegates in an interface?
Ans)No,we cannot declare delegates in interface however we can declare events in interface.
So interface can only contains the signature of the following members
Methods
Properties
Indexers
Events
*************************************************************************
Q4) Difference between catch(Exception error) and catch?
Ans)
The code below explains the difference between catch(Exception error) and catch
try
{
//Code that might generate error
}
catch(Exception error)
{
//Catches all Cls-complaint exceptions
}
catch
{
//Catches all other exception including the Non-Cls complaint exceptions
}
Ans) inetinfo.exe is theMicrosoft 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.
*************************************************************************
Q 3) Can we declare event and delegates in an interface?
Ans)No,we cannot declare delegates in interface however we can declare events in interface.
So interface can only contains the signature of the following members
Methods
Properties
Indexers
Events
*************************************************************************
Q4) Difference between catch(Exception error) and catch?
Ans)
The code below explains the difference between catch(Exception error) and catch
try
{
//Code that might generate error
}
catch(Exception error)
{
//Catches all Cls-complaint exceptions
}
catch
{
//Catches all other exception including the Non-Cls complaint exceptions
}
Next Questions
1)What is Marshaling?
Ans)
The process of establishing a Remote Proxy Server object which resides at the client side and act as if it was the server.Which in turn handles the communication between the real server object and client object. This process of monitoring is said to be Marshaling.
--------------------------------------------------
2)What is Smart Navigation ?
Ans)
When ever there is a request from a web browser which is IE 5.0 or greater Smart Navigation enhances the user feel of the page.
These are the different functions which this smart navigation performs.
1) It Persists the element focus between navigation's.
2) It also persists the scroll position when user traversing from one page to another.
3) It eliminates the flash content which was caused by navigation.
4) Most important feature is retaining the last page state in the browsers history.
This is how we can set the Smart Navigation :
We can set SmartNavigation attribute at the @ page directive in the .aspx page. So when the page is requested the dynamically generated class sets this attribute.
Note : This property is best useful when a particular web site has frequent postbacks.
---------------------------------------------------
3)In C# how do you find the last error which occurred ?
Ans)
This can be done by implementing a method called GetLastError(). Generally this returns a ASPError object stating the error condition that has occurred. This method will work only before the .ASP page sent any content to the Client.
Sample Code
Exception LastErrorOccured;
String ShowErrMessage;
LastErrorOccured = Server.GetLastError();
if (LastErrorOccured != null)
ShowErrMessage = LastErrorOccured.Message;
else
ShowErrMessage = "No Errors";
Response.Write("Last Error Occured = " + ShowErrMessage);
---------------------------------------------------
4)What is the difference between OLEDB Provider and SqlClient ? Which is more productive to use for Dot Net application?
Ans)
Generally SQLClient .NET classes are highly optimized for the .net / sqlserver combination which in-turn gives accurate results. The SqlClient data provider is fast. It works faster than the Oracle provider, and even more faster than accessing database through the OleDb layer.
Reason for being faster is, it access the native library which generally gives you a better performance and it has also got a lot of support from SQL Server team online.
----------------------------------------------------
5)which is server side state management technical?
Ans)
Select from following answers:
a)cookies
b)hidden fields
c)session
d)view state
session is the server side state management and other 3 r client side state management
6) What is the name given to a type of assembly which contains localized resources?
Ans)
Select from following answers:
A. a) Satellite
B. b)Spoke
C. c)Sputnik
D. d)Hub
satellite
We can deploy our application's resources in satellite assemblies. Generally by definition, satellite assemblies contains only resource files. They do not contain any application code.
In the satellite assembly deployment model, we create an application with one default assembly (which is the main assembly) and several satellite assemblies.
-------------------------------------------------------------------
7) In Singleton Pattern, how will you make sure that threading is done with minimal overhead
Ans)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''
public sealed class Singleton
{
private static volatile Singleton instance;
private static object syncRoot = new Object();
private Singleton() {}
public static Singleton Instance
{
get
{
if (instance == null)
{
lock (syncRoot)
{
if (instance == null)
instance = new Singleton();
}
}
return instance;
}
}
}
'''''''''''''''''''''''''''''''''''''''''''''''''''''
In the above code, when the Singleton instance is created for the first time then it is locked and synchronized but next call or successive calls make sure that the lock is not checked anymore because an instance already exists. This way the overhead of checking the lock minimizes.
The double-check locking approach solves the thread concurrency problems while avoiding an exclusive lock in every call to the Instance property method.
Previous Questions
Next Questions
Next Questions
1)What is Marshaling?
Ans)
The process of establishing a Remote Proxy Server object which resides at the client side and act as if it was the server.Which in turn handles the communication between the real server object and client object. This process of monitoring is said to be Marshaling.
--------------------------------------------------
2)What is Smart Navigation ?
Ans)
When ever there is a request from a web browser which is IE 5.0 or greater Smart Navigation enhances the user feel of the page.
These are the different functions which this smart navigation performs.
1) It Persists the element focus between navigation's.
2) It also persists the scroll position when user traversing from one page to another.
3) It eliminates the flash content which was caused by navigation.
4) Most important feature is retaining the last page state in the browsers history.
This is how we can set the Smart Navigation :
We can set SmartNavigation attribute at the @ page directive in the .aspx page. So when the page is requested the dynamically generated class sets this attribute.
Note : This property is best useful when a particular web site has frequent postbacks.
---------------------------------------------------
3)In C# how do you find the last error which occurred ?
Ans)
This can be done by implementing a method called GetLastError(). Generally this returns a ASPError object stating the error condition that has occurred. This method will work only before the .ASP page sent any content to the Client.
Sample Code
Exception LastErrorOccured;
String ShowErrMessage;
LastErrorOccured = Server.GetLastError();
if (LastErrorOccured != null)
ShowErrMessage = LastErrorOccured.Message;
else
ShowErrMessage = "No Errors";
Response.Write("Last Error Occured = " + ShowErrMessage);
---------------------------------------------------
4)What is the difference between OLEDB Provider and SqlClient ? Which is more productive to use for Dot Net application?
Ans)
Generally SQLClient .NET classes are highly optimized for the .net / sqlserver combination which in-turn gives accurate results. The SqlClient data provider is fast. It works faster than the Oracle provider, and even more faster than accessing database through the OleDb layer.
Reason for being faster is, it access the native library which generally gives you a better performance and it has also got a lot of support from SQL Server team online.
----------------------------------------------------
5)which is server side state management technical?
Ans)
Select from following answers:
a)cookies
b)hidden fields
c)session
d)view state
session is the server side state management and other 3 r client side state management
6) What is the name given to a type of assembly which contains localized resources?
Ans)
Select from following answers:
A. a) Satellite
B. b)Spoke
C. c)Sputnik
D. d)Hub
satellite
We can deploy our application's resources in satellite assemblies. Generally by definition, satellite assemblies contains only resource files. They do not contain any application code.
In the satellite assembly deployment model, we create an application with one default assembly (which is the main assembly) and several satellite assemblies.
-------------------------------------------------------------------
7) In Singleton Pattern, how will you make sure that threading is done with minimal overhead
Ans)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''
public sealed class Singleton
{
private static volatile Singleton instance;
private static object syncRoot = new Object();
private Singleton() {}
public static Singleton Instance
{
get
{
if (instance == null)
{
lock (syncRoot)
{
if (instance == null)
instance = new Singleton();
}
}
return instance;
}
}
}
'''''''''''''''''''''''''''''''''''''''''''''''''''''
In the above code, when the Singleton instance is created for the first time then it is locked and synchronized but next call or successive calls make sure that the lock is not checked anymore because an instance already exists. This way the overhead of checking the lock minimizes.
The double-check locking approach solves the thread concurrency problems while avoiding an exclusive lock in every call to the Instance property method.
Previous Questions
Next Questions