You are on page 1of 5

1. Which of the following are not examples of built -in generic types?

A. Nullable
B. Boolean
C. EventHandler
D. All the Above

Ans: B. Boolean

2.Statement1: Value Types are garbage collected
Statement2: Reference types are garbage collected
A. Statement 1 & 2 are correct
B. Statement 1 & 2 are Wrong
C. Statement 1 is wrong, Statement 2 is correct
D. Statement 1 is wrong, Statement 2 is correct

Ans: C. Statement 1 is wrong, Statement 2 is correct

3.
Class Base()
Class Child:Base()
Statement1: Base b=new Child();
Statement2: Child c=new Base();
Which of the following are true?

A. Both statements are correct
B. Both statements are wrong
C. Statement1 is correct but statement2 is wrong
D. Statement2 is correct but statement1 is wrong

Ans: C. Statement1 is correct but statement2 is wrong

4.
int? d = 1;
Type findType = d.GetType();
What value does findType contain?

A. System.Int64
B.System.Int16
C.System.Int32
D.System.nullable<Int32>

Ans: C.System.Int32





5. Statement1: Truncate table <Table Name> the operation can be rolled back
Statement2: Delete table <Table Name> the operation cannot be rolled back
Choose the correct one.
A. Statement 1 & 2 are correct
B. Statement 1 & 2 are wrong
C. Statement 1 is correct & Statement 2 is wrong
D. Statement 1 is wrong & Statement 2 is correct

Ans: B. Statement 1 & 2 are wrong

6. To which column types a default value cant be bound (Choose all that apply)
A. Text
B. Identity
C. Timestamp
D. nvarchar

Ans: B. Identity, C. Timestamp

7. Choose the isolation levels from lowest to highest
1 - Read Committed
2 Repeatable Read
3 Serializable
4 Read Uncommitted
A. 1,4,2,3
B. 4,1,2,3
C. 4,2,1,3
D. 4,1,3,2
Ans: B. 4,1,2,3

8. What is a table called, if it does not have either Cluster or Non-cluster Index?
A.No Such table exist
B. Stack
C.Heap
D.Cluster table

Ans: C. Unindexed table or Heap

9. Suppose there is a scenario to persist the session state even if the IIS server is restarted.
Which session mode one can use(Choose all that apply)?
A. InProc
B. SQL Server
C. State Server
D. All the Above

Ans: B .SQL Server & C. State Server


10.Assume a scenario you do not want to cache a particular page. Select the different options
(Select all that apply)
A. Call Response.Cache.SetNoStore();
B. Set Response.CacheControl=set-nostore;
C. Set the location attribute to none in OutputCache directive
D. Response.CacheExpires=true;

Ans:
A. Call Response.Cache.SetNoStore();
C. Set the location attribute to none in OutputCache directive


11. What is the default identity of an Application Pool in IIS?

A. LocalSystem
B. IUSER_SystemName
C. NetworkService
D. LocalService

Ans: C. NetworkService


12. You are creating a WCF service by using .NET framework 3.5. You need to host the service
in a medium trust environment on a web server. Which two bindings should you use? (Each
correct answer presents a complete solution)

A. NetMsmqBinding
B. BasicHttpBinding
C. WSDualHttpBinding
D. NetTcpBinding
E. WebHttpBinding

Ans:

13.
class SampleClass
{
static int Main(string[] args)
{
int i, j;
i = 1;
j = 10;
try
{
i = i - 1;
j = j / i;
}
catch (DivideByZeroException Ex)
{
//Handle the excepotion;
return -1;
}
finally
{
Console.WriteLine("In Side");
}
Console.WriteLine("Out Side");
return 0;
}
}
What is the output?



A. In Side & Out Side
B. In Side
C. Out Side
D. None of the above

Ans: B.In Side

14.
Statement1: HttpHandler handles the request before HttpModule
Statement2: I can have any number of HttpModules in an application

A. Statement 1 & 2 are correct
B. Statement 1 & 2 are wrong
C. Statement 1 is correct, statement 2 is wrong
D. statement 1 is wrong, statement 2 is correct

Ans:
D. statement 1 is wrong, statement 2 is correct


15.
Statement 1:

try
{
int i = 10 / 0;
}
catch(Exception ex)
{
//do some local cleanup
throw ex;
}

Statement 2:

try
{
int i = 10 / 0;
}
catch (Exception ex)
{
//do some local cleanup
throw;
}
Choose all that apply

A. Statement1 throws the exception and the stack trace is maintained
B. Statement1 throws the exception and the stack trace is truncated
C. statement2 throws the exception and the stack trace is maintained
D. Statement2 throws the exception and the stack trace is truncated

16. Assume a scenario where I want to catch the unhandled exception in the entire application.
What should I do to do this?

A. catch the unhandled exception in System_Error event
B. catch the unhandled exception in the Application_Error event
C. catch the unhandled exception in the Application_End even t
D. catch the unhandled exception in the Application_Errorend event

Ans:

B.catch the unhandled exception in the Application_Error event

17. Which of the fallowing is true if you want to store session data in a state server(Choose all
that apply)

A. Objects should be serializable
B. All the classes should be public
C. <machineKey> elements in web.config should be identical across all servers
D. All the above

Ans: A. Objects should be serializable

18. PostCache substitution method should contain the following characteristics(Choose all
that apply)
A. implement the interface ISubstitution
B. Should be static
C. The method signature should match the HttpResponseSubstitutionCallback delegate
signature
D. All the above




19. Assume I have enabled SQLServer Session mode in my application. I want to persist the
session state when my SQL Server is restarted. What should be done (Choose all that apply)?
A. Objects should be serializable
B. Store the session data in a clustered environment
C. Store the session data in a different database instead of tempdb
D. Back up your database periodically

20. How can you secure the web service(Choose all that apply)
A. Forms Authentication
B. Passport Authentication
C. X.509 Certificate
D. Security Token

Ans:
C. X.509 Certificate
D. Security Token

You might also like