1.You need to identify
Is Always a number
Is Always greater than
a.int32
b.int64
c.system.unit16
d.system.unit32
2.You
have created an assembly that utilizes unmanaged code to access external
resources. You need to deploy the assembly with the appropriate permissions.
Which permission set should you use?
- safe
- unsafe
- EXTERNAL_ACCESS
- Default Permission set
3.You have an application that
is used by international clients. All clients connect by using Windows
Authentication. You need to ensure that system and user-defined error messages
are displayed in the localized language for the clients.
- Use @@LANGUAGE function
- Use the "set language" option of sp_configure
- Use default language for each login
Use default language for each login and another option is Use @lang parameter
of sp_addmessage
Use default language for each login and another option is Use @lang parameter of sp_addmessage
4.Your application uses two
threads, named threadOne and threadTwo.
You need to modify the code to prevent the execution of threadOne
until threadTwo completes execution.
What should you do?
- Configure threadOne to run at a lower priority.
- Call the Sleep method of threadOne.
- Configure threadTwo to run at a higher priority.
- Use a WaitCallback delegate to synchronize the threads.
you have to use a waitcallback delegate to synchronize the threads
you have to use a waitcallback delegate to synchronize the threads
5.You need to create a method
to clear a Queue named q.
- foreach(object e in q){q.Dequeue();
- foreach(object e in q){q.Enqueue(null);
- q.clear();
- q.Dequeue();
Queue method will clear while using q.clear();
Queue method will clear while using q.clear();
6.You need to write a
multicast delegate that accepts a DateTime argument
which code type you can choose
- public delegate int PowerDeviceOn(bool result, DateTime
autoPowerOff);
- public delegate void PowerDeviceOn(DataTime
autoPowerOff);
- public delegate bool PowerDeviceOn(object sender,
EventsArgs autoPowerOff);
- public delegate bool PowerDeviceOn(DataTime
autoPowerOff);
public delegate void PowerDeviceOn(DataTime autoPowerOff);
public delegate void PowerDeviceOn(DataTime autoPowerOff);
7.Differentiate between a page
theme and a global theme?
Page Theme:
Where as Page theme applies to a particular web pages of the project. It is
stored inside a subfolder of the App_Themes folder.
Global Theme:
Where as Global theme applies to all the web applications on the web server. It
is stored inside the Themes folder on a Web server.
8.Which of the following is
NOT used for getting auto-incremented value of a IDENTITY Column in SQL Server?
- SCOPE_IDENTITY()
- @@IDENTITY
- IDENT_CURRENT('TableName')
- MAX(id).
SCOPE_IDENTITY(), @@IDENTITY, IDENT_CURRENT('TableName') are used for getting
auto incremented value from recent INSERT statement in SQL Server
SCOPE_IDENTITY(), @@IDENTITY, IDENT_CURRENT('TableName') are used for getting auto incremented value from recent INSERT statement in SQL Server
9.ASP .Net Page class, in
which of them would you attach an event handler to an event published by a
control on the web page?
- onload()
- OnPageload()
- OnInit().
- OnPostback()
OnInit() method is called when an ASP.Net page is intialized , this would be the most
appropriate place to attach an event to its event handler.
OnInit() method is called when an ASP.Net page is intialized , this would be the most appropriate place to attach an event to its event handler.
10.Why can't you open a new
browser window from within server code?
Server code executes on
the server, where as the new window is created on the client.You need to use
the client-side code to do things that affect the client,such as upload
Files ,display new windows or navigate back in history.
11.What is the main difference
between the Button server control and the Button Html control?
when clicked the Button
server control triggers are asp.net click event procedure on the
server.The Button HTML control triggers the event procedure indicated in the
buttons onclick attribute,which runs on the client.
12.List the EmpNo,EName,Sal
Daily Sal of all Emps in the ascending order of annual salary?
Select
EmpNo,EName,Sal,Sal/30,12 * Sal annual salary from Emp order by annual salary
you can detect by this query.
13.write a query the name ends
with 'i' using sql server?
select * from emp where name
like '%i'
output:
aswini
aluri
devi
the query displays the person name ends with i only
14.write a query name starts
with 's' using sql server?
select * from emp where name
like 's%'
output:
siri
spandu
seshu
The query displays the name starts with s only
15.write a query allow only 4
characters in name column using sql server?
select name from salary where name like '____'
after like 4 dashes with in
single quote
o/p::ashu
siri
hari
the output will shown like that it can show only 4 characters.
16.How to allow only alphabets
using regular expression validator?
- "[a-zA-Z]"
- "^[a-zA-Z]+$".
- [A-za-z]
Validation Expression="^[a-zA-Z]+$"
it can allow only alphabets
Validation Expression="^[a-zA-Z]+$"
it can allow only alphabets
17.How many generations in Gc
within managed heap and what are the default sizes?
- 3geneartions, sizes-45kb.45mb,7mb
- 3Generations Sizes-128kb,2mb&10 mb.
- 2 Generations Sizes-222kb,455mb
Maximum number of generations allowed are only three
In general always generation 2memory size is bigger than the generation 1
memory size and generation 1 memory size is bigger than the generation 0 memory
size.
Maximum number of generations allowed are only three
In general always generation 2memory size is bigger than the generation 1 memory size and generation 1 memory size is bigger than the generation 0 memory size.
18.what
is the max size of rows in a particular table
- 1024
- 8060.
- 1824
8060 rows only
8060 rows only
19.how
to detect the product level,product version and edition in sql server 2008
select serverproperty('product
level')
select serverproperty('productversion')
select serverproperty('edition')
By using three queries you can get the product level,product version and
edition
20.In.Net
which is the parent class to create all windows service?
- Eventloginstaller
- Service Installer
- servicebase.
The service base class is the parent class to create all windows service
21.how to change the database
owner?
- sp_helptext owner
- sp_changeowner
- sp_changeDBowner 'sa'.
sp_changeDBowner 'sa'
22.What is the maximum size of columns in a particular table?
- 65,535
- 8060
- 1024.
for a table it can allow only 1024 columns in sql server
The service base class is the parent class to create all windows service
sp_changeDBowner 'sa'
for a table it can allow only 1024 columns in sql server
23.What is the maximum size of
columns in a particular table?
- 65,535
- 8060
- 1024.
for a table it can allow only 1024 columns in sql server
for a table it can allow only 1024 columns in sql server
24.How to convert server name
to host name?
convert server name to host name using
this query
sp_drop server hcl
sp_add server'hcl/infotech','local'
sp_drop server hcl
sp_add server'hcl/infotech','local'
25.How can you detect the host
name and Ip address?
>xp_cmdshell hostname--for hostname
-->xp_cmdshell Ipconfig---for ip address.
-->xp_cmdshell Ipconfig---for ip address.
26.How can you detect the
servername ?
- select* servername
- select @servername
- select@@servername
to detect server name using this query on your db
select@@ servername
to detect server name using this query on your db
select@@ servername
27.How can you detect the
version properties?
by using this query you can achieve.
-->select @@ version
-->select @@ version
28.How can you detect the how
many mdf & ndf & ldf files in your database?
- sp_helptext
- sp_helpindex
- sp_helpdb'text'
by using sp_helpdb'text' you can detect your mdf&ndf&ldf files
by using sp_helpdb'text' you can detect your mdf&ndf&ldf files
29.can one dll contain the
compiled code of more than one programming language?
- Yes
- No
- both a&b
no,a dll file contain the compiled code of only one programming language.
no,a dll file contain the compiled code of only one programming language.
30.How many web servers are
needed for a web site?
There is only one web server are required
for a web site.But large web sites like
yahoo ,google,msn etc will have millions of visitors every minute one computer
cannot process such huge data ,so they will have a hundreds of servers then it
can give the fast response
31.How many web sites can be
hosted in one server?
A web server can host hundreds
of web sites.Most of the small web sites
in the Internets are shared on web servers.They are several web hosting
companies who offer shared web
hosting from a web hosting
company,they will host your web site along with their web server along with
several other web sites.
Ex Of web servers applications are:
1.IIS
2,Apache
32.Is validation is done by
server side or client side validation?
Server side Validation
- ClientSide validation
- both 1&2.
by default it is done by client side ,server side validation is possible
when you switch off the client side.
by default it is done by client side ,server side validation is possible when you switch off the client side.
33.Difference between Typed
DataSet and UnTypedDataSet
Typed DataSet is a Custom class generated
by visual studio
It adds things like named properties that match column and row data in the tables. It's generated code and
not a part of .NET, so you can't use typed datasets without Visual studio unless you copy all of the code and
manually customize it for your project. An untyped dataset is an object of the
DataSet class. It's a part of .NET and you can use it even if you don't have
Visual Studio.
typed dataset is generally used as it is easy to use and moreover gives errors
at compile time...compared to untyped which gives on run time
It adds things like named properties that match column and row data in the tables. It's generated code and not a part of .NET, so you can't use typed datasets without Visual studio unless you copy all of the code and manually customize it for your project. An untyped dataset is an object of the DataSet class. It's a part of .NET and you can use it even if you don't have Visual Studio.
typed dataset is generally used as it is easy to use and moreover gives errors at compile time...compared to untyped which gives on run time
34.Difference between label and
literal controls in asp.net?
label:
Label control renders text within span tag to
browser. It is possible to apply style and style sheet class to label.
Literal:
Literal will render it's text that is assign to text property. It cannot render
any additional html tag. Default mode for literal is “Transform”. Best practice
to set Mode="Encode" for literal control
It is best practice to use literal instead of Label control wherever it
possible in asp.net application..
Label control renders text within span tag to browser. It is possible to apply style and style sheet class to label.
Literal:
Literal will render it's text that is assign to text property. It cannot render any additional html tag. Default mode for literal is “Transform”. Best practice to set Mode="Encode" for literal control
It is best practice to use literal instead of Label control wherever it possible in asp.net application..
35.If i write system.exit(0);at
the end of try block is finally block will execute?
No,the finally block can't execute in this case because when you mention
system.exit(0);
the control goes out of the program and the finally block never execute.
the control goes out of the program and the finally block never execute.
36.How to find out which index
is defined on table?
- sp_tablename
- sp_helpindex
- sp_helpindextablename.
sp_helpindextablename
sp_helpindextablename
37.In which events controls are
fully loaded?
In page load events all controls are
loaded
controls are accessed in
page_init event but you see that view state is not fully loaded during this
event
controls are accessed in page_init event but you see that view state is not fully loaded during this event
38.which statements is used to
replace multiple if-else statements in code?
In Vb.net the select case statement is used to replace
multiple if-else statement.
and in c# the switch-case statement is used to replace multiple if-else
statement.
and in c# the switch-case statement is used to replace multiple if-else statement.
39.Is it possible to host web
site from desktop?
- No
- Yes.
- Some Times It can be
Yes you can host web site from desktop
Yes you can host web site from desktop
40.why we are using distinct
keyword in sql server?
The DISTINCT keyword in SQL allows you to
select only those records that contain unique values for the columns requested in a Select statement,. Duplicate
values are ignored and only displayed once.
Ex:- using emp table
Emp ID EmpName
1 Aswini A
2 Aswini A
3 Aluri
then
select distinct EmpName from emp
then it displays
only
EmpName
Aswini A
Aluri
Ex:- using emp table
Emp ID EmpName
1 Aswini A
2 Aswini A
3 Aluri
then
select distinct EmpName from emp
then it displays
only
EmpName
Aswini A
Aluri
41.ACID rules in sql server?
Atomicity
Consistency
Isolation
Durablity
Atomicity:
Modification on the data in the
database either fail or succeed. The beginning of such a modification starts
with a transactionand ends when a transaction finishes (either by a commit or
arollback). A software crash entails an implicit rollback.
Consisyency:
Modification on the data in the database either fail or succeed. The beginning
of such a modification starts with a transactionand ends when a transaction
finishes (either by a commit or arollback). A software crash entails an
implicit rollback.
Isolation:
One transaction does not interfere with another. The 'executor' of a
transaction has the feeling that he has the entire database for himeself.
Durablity:
A commited transaction will not be lost.
Durablity
Atomicity:
Modification on the data in the database either fail or succeed. The beginning of such a modification starts with a transactionand ends when a transaction finishes (either by a commit or arollback). A software crash entails an implicit rollback.
Consisyency:
Modification on the data in the database either fail or succeed. The beginning of such a modification starts with a transactionand ends when a transaction finishes (either by a commit or arollback). A software crash entails an implicit rollback.
Isolation:
One transaction does not interfere with another. The 'executor' of a transaction has the feeling that he has the entire database for himeself.
Durablity:
A commited transaction will not be lost.
42.What is the difference
between Dot Net 4.0 and 4.5 Framework .
As practically the difference between dot
net 4.0 and 4.5 are mentioned below-
>> You can compile an application for .NET 4.5 and run it on the 4.0
runtime – that is a new feature of 4.5, that doesn’t exist on 4.0.
<configuration>
<startup>
<supportedRuntime version="v4.0"
sku=".NETFramework,Version=v4.5" />
</startup>
>> You can compile an application for .NET 4.5 and run it on the 4.0 runtime – that is a new feature of 4.5, that doesn’t exist on 4.0.
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
43.Can you split the one column
in to two columns
For Ex:FullName:Aswini Aluri
It must split into firstname: Aswini.
LastName :Aluri
Create splitS(FullName
NVARCHAR(50))
select LEFT(fullname, CHARINDEX(' ', fullname + ' ') -1),
STUFF(fullname, 1, Len(FullName) +1- CHARINDEX(' ',Reverse(fullname)), '')
from splits.
I hope it will help you
This questions are asked in many interviews.