0% found this document useful (0 votes)
30 views30 pages

Day30 Upto 60

The document contains a series of questions and answers related to programming concepts, particularly in C# and SQL. It covers topics such as thread-safe singleton instantiation, asynchronous I/O operations, SQL GROUP BY with ROLLUP, and the use of the PIVOT operator. Additionally, it addresses .NET Framework details, properties in C#, exception handling, and the Common Language Runtime.

Uploaded by

nssvp1208
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views30 pages

Day30 Upto 60

The document contains a series of questions and answers related to programming concepts, particularly in C# and SQL. It covers topics such as thread-safe singleton instantiation, asynchronous I/O operations, SQL GROUP BY with ROLLUP, and the use of the PIVOT operator. Additionally, it addresses .NET Framework details, properties in C#, exception handling, and the Common Language Runtime.

Uploaded by

nssvp1208
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

31 How do you ensure thread-safe singleton ioStantiation in C# without using • 2 Marks

locks?

Use a static constructor

Use the ThreadStatic attribute

Use the Lazy<T> type with apprepri@tenppåe Correct Answer

Implement double-checked locking


32 What is the benefit of using asynchronous over synchronous I/O operations e 2Marks
in a web application?

Reduces CPU usage

Improves scalability by freeing up threads Correct Answer

Increases data transfer speed

Simplifies error handling


33 What is the use of the WITH ROLLUP option in a SQL GROUP BY clause? • 2Marks

To include additional rows that represent summary totals Correct Answer

To perform hierarchical grouping

V To roll back transactions if an error occurs

To optimaze group by operations using indexing


What is the purpose of using the PIVOT operator in SQL? • 0 Marks

To rotate rows into columns Correct Answer

To combine multiple rows into a single row Your Answer

To generate summary reports

To normalize denormalized data


35 What are the performance implications of using scalar-valued functions in • OMarks
SQL Server?

Can lead to slower query execution due to row-by-towprocessing Correct Answer

Improves performance by reducing code complexity

No Impact on performance

O Scalar-valued functions are optimized automatically by SQU Server Answer


36 How can you optimize a query that ireååéntly reads a heavily updated table • 0Marks
in SQL Server?

Use the NOLOCK hint Correct Answer

Increase the isolation level

Use indexed views

Implement query caching Your Answer


37 In SQL, how can you perform a recursive query on a hierarchical dataset? • 2Marks

Use a self-join with UNION

Implement a loop within a stored procedure

Use a Common Table Expression (CTE) Correct Answer

Recursive queries are not possible in SQL


38 is a code that consists of CPU and platform-independentset of • 2 Marks
instructions, which can be easily converted to native code.

Answer
39 Which of the following statements is correct about the .NET Framework? • 0M

.NET Framework is built on the DCOM technology.

.NET Framework uses DCOM for creating unmanaged applications.

.NET Framework uses COM+ services while creating Distributed Applications. Answer

.NET Framework uses DCOM for making transition between managed and unmanaged code. C.vrect Answer
40 Which of the following statements are correct about a .NET Assembly? • 2Marl

1. It is the smallest deployable unit,


2. Each assembly has only one entry point - Main(), WinMain() or DLLMainO.
3. An assembly can be a Shared assembly or a Private assembly.
4. An assembly can contain only code and data.
5. An assembly is always in the form of an EXE file.

Statements 1, 2 3

Statements I, 2 Correct Answer


41 Is the Reset Button used to reset all other HTML form elements on a form to
a default value0

TRUE Correct Answer

0 FALSE YourAosw«
A web page has lots of input data, and you want the data input to be spread • 2tv
across multiple screens. What is the best control to implement this solution
on a single Web page?

ImageMap

Panel

Wizard Correct Answer

None
Day 30

43 The three statements are given below about DataSet andDataReadef, • 0Marks
choose the correct option according to the statement.

Statement 1'.DataSet Provides Discohnected environment but DataReader


provides Connected environment.
Statement 2: DataSet Provides Connected environment but DataReader
provides Disconnected environment.
Statement 3: DataSet Can store multip!? t? Fimujtaneously but
DataReader Supports a single table $ingle SQL query.

Only Statement 1 is correct.

Statement 1 and 2 is correct.

Statement2 and 3 is correct. Your Answer

Statement 1 and 3 is correct, Correct Answer


Day 30

44 true about master page? • 2 Marks

Master page contains a <%@ Master %> directive instead of the normal <%@ Page %> directive.

ContentPlaceHolder control can be added only on master page.

You can add as many ContentPlaceHolders to a Master Page as you need.

All of the above Correct Answer


45 How will you store and retrieve value in viewstate? • 2 Marks

// Storing the data in viewstate

// Retrieving Value from a View State


Labell .Text = Correct Answer

// Storing the data in viewstate


ViewState obj=new ViewState
ViewState
// Retrieving Value from a View State
Labell ,Text =

// Storing the data in viewstate

// Retrieving Value from a View State


Labell ,Text ViewState.ToString();

None
Day 30

46 In order to prevent a browser from caching a page which Of these • 2 Marks


xstatements should be written?

Response.Cache.SetNoStore(); Correct Answer

Response.Cache.SetNoServerCaching();

Response.Cache.SetNoCaching();

None
47 Which type of processing model does asp.net stimulate? • 2Marks

Static

Linear

.1
Bottom up

Eventdriven Correct Answer


48 You want to make a configuration setting change that will affect only the • 2 Marks
current Web application. Which file will you change?

Global esax

Web config in the root ot the Web application

MeChtneconfig

of above
There is a button on page name cancel and it should bypass validation when • 2 Mark
cancel button is clicked. What will you do?

set CausesValidation = false Correct Answer

set RemoveValidation=true

set cancel-true

None
Whichof the following is a valid skin code inside a skin file?

< asp:TextBox BorderStyle='Dotted"

< asp:TextBox BackColor="Yellow" BorderStyle=T'Dötted' /> Correct Angwet!l/j/D/

< asp:TextBox

None
Day 30

51 Shared Assemblies can be stored in Global Assembly Cache. • 2 Marks

TRUE Correct Answer

FALSE
52 Choose the wrong statement about properties used in C#,Net? • 2Marks

Each property consists of accessor as getting and set.

A property cannot be either read or write-only Correct Answer

Properties can be used to store and retrieve values to and from the data members of a class.

Properties are like actual methods that work like data members.
53 Which of these keywords are used to implement synchronization?

synchronize

syn

synch

synchronized Correct Answer


54 Which type of exception handling uses a try-catch block? • 0 Marks

Unchecked

Implicit

Explicit Your Answer

Checked Correct Answer


55 Which of the following is the correct way to define an anonymous method in • 2Marks

s/ delegate void() { )

func void() { }

delegate() { ) Correct Answer

delegate void { }
56 By using which of the following attribute, HTML elements are transformed to • 2 Marks
HTML server control?

runat=Userver" Correct Answer

runat=Uhostn
AccessDataSource Control work with which of the following file types? • 2 Marks

.mdf file Correct Answer

.mpd file

myd file

mdb file
58 A module which is a collection of functions and da!a; designed to be used by • OMarks
anotherapplication is called

DLL Correct Answer

Abandon

PICS

LCID Yout Answer


59 The @lmplements directive • 2 Marks

assigns a class or virtual path used to type the Master property of a page

imports a namespace into current page page or user control

indicates that a page or user control implements a specified .NET Framework interface Correct Answer

None
Day 30

60 Which of the following statements about Commo Language Runtime (CLR) • 2Mark$
is false?

CLR provides automatic memory management through garbqpe collection

CLR allows multiple programming languages to be used within the same application

CLR converts the Intermediate Language (IL) code into machine t compile time Correct Answer

CLR provides exception handling and security services for managed code

You might also like