Explore topic-wise MCQs in Computer Science Mcqs.

This section includes 228 Mcqs, each offering curated multiple-choice questions to sharpen your Computer Science Mcqs knowledge and support exam preparation. Choose a topic below to get started.

101.

You need to programmatically configure page output caching. Which object would you use?

A. Request
B. Response
C. Application
D. Server
Answer» C. Application
102.

Which Data Provider gives the maximum performance when connect to SQL Server?

A. The SqlClient data provider.
B. The OLE DB data provider.
C. The Oracle data provider
D. All of the above.
Answer» B. The OLE DB data provider.
103.

To create your application on a remote server which option you will choose in ASP.NET?

A. File System
B. FTP
C. HTTPS
D. None of the above.
Answer» C. HTTPS
104.

Which of the following is a valid skin code inside a skin file?

A. None of the above.
Answer» C.
105.

What are the client-side state management options that ASP.NET supports?

A. Application
B. Session
C. Querystring
D. Option a and b are correct
Answer» D. Option a and b are correct
106.

What is Multiple Active Result Sets (MARS)?

A. It allows execution of multiple batches against Database on a single connection.
B. New feature of SQL SERVER 2005. Previous version of SQL Server does not support this feature.
C. Option A and B are correct.
D. None of the above.
Answer» D. None of the above.
107.

What property do you modify on a server control to minimize the size of the ViewState data?

A. ViewState=”true”
B. Set EnableViewState to false
C. Set EnableViewState to true
D. None of the above
Answer» C. Set EnableViewState to true
108.

How many types of parameter supported by OutputCache?

A. VaryByParam
B. VaryByControl
C. VaryByHeader
D. VaryByCustom
E. All of the above
Answer» F.
109.

In ASP.NET application DLL files are stored in which folder?

A. App_Code
B. App_Data
C. Bin
D. App_LocalResources
Answer» D. App_LocalResources
110.

Which ADO.NET class provide Disconnected Environment?

A. DataReader
B. DataSet
C. Command
D. None of the above.
Answer» C. Command
111.

Which ADO.NET class provide Connected Environment?

A. DataReader
B. DataSet
C. Command
D. None of the above
Answer» B. DataSet
112.

What are the steps to create a DataTable programmatically?

A. Instantiate a new DataTable and add DataColumn objects to the DataTable. Columns Collection.
B. Run the Data Source Configuration Wizard.
C. Instantiate a new DataSet object.
D. None of the above.
Answer» B. Run the Data Source Configuration Wizard.
113.

What types of data can you store in the Cache collection?

A. Only String Type of Data
B. You can store any type of data in the Cache collection.
C. Only DataSet Object
D. All of the above.
Answer» C. Only DataSet Object
114.

The three statements are given below about DataSet and DataReader, choose the correct option according to the statement. Statement 1: DataSet Provides Disconnected environment but DataReader provides Connected environment. Statement 2: DataSet Provides Connected environment but DataReader provides Disconnected environment. Statement 3: DataSet Can store multiple table simultaneously but DataReader Supports a single table based on a single SQL query.

A. Only Statement 1 is correct.
B. Statement 1 and 2 is correct.
C. Statement 2 and 3 is correct.
D. Statement 1 and 3 is correct.
Answer» E.
115.

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

A. ImageMap
B. Panel
C. Wizard
D. None of the above.
Answer» D. None of the above.
116.

Which control is required of every AJAX page to manage the JavaScript files sent to the client and the communication between client and server?

A. UpdatePanel
B. ScriptManager
C. AsyncPostBackTrigger
D. None of the above.
Answer» C. AsyncPostBackTrigger
117.

The UpdatePanel supports two types of triggers: AsyncPostBackTrigger and PostBackTrigger. Choose the correct option regarding working of these triggers.

A. AsyncPostBackTrigger causes an asynchronous (Ajax) postback.
B. PostBackTrigger causes a normal entire-page postback.
C. AsyncPostBackTrigger causes a normal entire-page postback.
D. Option A and B are Correct.
Answer» E.
118.

Choose the correct option about DataReader object.

A. DataReader object is a forward-only object.
B. It provides connection oriented environment.
C. DataReader is read only object.
D. All of the above
Answer» E.
119.

What is the difference between a Local Transaction and a Distributed Transaction?

A. Local transactions are performed on a single database table, but distributed transactions are performed on more than one database tables.
B. Local transactions are performed on a single database server, but distributed transactions can be performed across multiple database servers.
C. Local transactions are performed on a database on the local machine, but distributed transactions are performed on a database on a remote machine.
D. None of the above.
Answer» C. Local transactions are performed on a database on the local machine, but distributed transactions are performed on a database on a remote machine.
120.

Using which type of stylesheet we can change the style of an element in the entire website?

A. Internal Stylesheet
B. External Stylesheet
C. Inline stylesheet
D. None of these above
Answer» C. Inline stylesheet
121.

Clicking a CheckBox does not cause an automatic PostBack. How do you make the CheckBox cause an automatic PostBack?

A. Set the AutoPostBack property to true.
B. Add JavaScript code to call the ForcePostBack method.
C. Set the PostBackAll property of the Web Page to true.
D. None of the above
Answer» B. Add JavaScript code to call the ForcePostBack method.
122.

How do you create a TextBox for retrieving a password from a user?

A. Set TextMode property of the TextBox control to Secret.
B. Set Mode property of the TextBox control to Password.
C. Set Text property of the TextBox control to Password.
D. Set TextMode property of the TextBox control to Password.
Answer» E.
123.

What is the easiest way in Design view to create an event handler for the default event of a server control?

A. Open the code-behind page and write the code.
B. Right-click the control and select Create Handler.
C. Drag an event handler from the Toolbox to the desired control.
D. Double-click the control.
Answer» E.
124.

What is/are the advantages of Session State?

A. It helps to maintain user data to all over the application and can store any kind of object.
B. Stores every client data separately.
C. Session is secure and transparent from user.
D. All of the above
Answer» E.
125.

Why should you write the cleanup code in Finally block?

A. Compiler throws an error if you close the connection in try block.
B. Resource cannot be destroyed in catch block.
C. Finally blocks run whether or not exception occurs.
D. All of the above
Answer» D. All of the above
126.

How you can merge the results from two separate LINQ queries into a single result set.

A. Use the ToList method.
B. Use the DataContractJsonSerializer class.
C. Use the XElement class.
D. Use the Concat method.
Answer» E.
127.

What happen in the Web Page when Init event occur?

A. ViewState is loaded on the page.
B. Each child control of the page is initialized to its design time values.
C. HTML is rendered.
D. None of the above
Answer» C. HTML is rendered.
128.

What are the Command Object Methods?

A. ExecuteNonQuery
B. ExecuteReader
C. ExecuteScalar
D. All of the above
Answer» E.
129.

Which object in ASP.NET provides a global storage mechanism for state data that needs to be accessible to all pages in a given Web application?

A. Session
B. Application
C. ViewState
D. None of the above
Answer» C. ViewState
130.

Choose the correct option about Master Page and Theme.

A. A Master Page enables you to share content across multiple pages in a website and A Theme enables you to control the appearance of the content.
B. Theme enables you to share content across multiple pages in a website and A Master Page enables you to control the appearance of the content.
C. App_Themes folder contains skin files.
D. Option A and C are correct.
Answer» E.
131.

Which of the following statements about referencing master page methods and properties is true?

A. Content pages can reference controls in the master page.
B. Content pages can reference public properties in the master page.
C. Content pages can reference public methods in the master page.
D. All of the above.
Answer» E.
132.

Which Session Mode Serialization is not required to store the data?

A. Off
B. InProc
C. StateServer
D. SQLServer
Answer» C. StateServer
133.

In a SQL Statement while working with SqlCommand it returns a single value, at that time which method of Command Object will be used?

A. ExecuteNonQuery
B. ExecuteReader
C. ExecuteScalar
D. All of the above
Answer» D. All of the above
134.

When should you use HTML Server control rather than Web Server controls?

A. You are migrating existing, classic ASP pages over to ASP.NET pages.
B. The control needs to have custom client-side JavaScript attached to the control’s events.
C. The Web page has lots of client-side JavaScript that is referencing the control.
D. All of the above.
Answer» E.
135.

Which interface defines the basic extension methods for LINQ?

A. IComparable
B. IList
C. IEnumerable
D. IQueryable
Answer» D. IQueryable
136.

Which query expression is used to limit the number of results?

A. Skip
B. Take
C. Where
D. Select
Answer» C. Where
137.

Which LINQ statement defines the range variable in a LINQ query?

A. from
B. select
C. join
D. where
Answer» B. select
138.

Choose the correct one 1) XML serialization serializes the public fields and properties of an object. 2) XML serialization serializes the private fields and properties of an object. 3) XML serialization serializes only the public methods.

A. Only 1
B. Only 2
C. Only 1 & 2
D. All of the above
Answer» B. Only 2
139.

Which of the following objects represents a LINQ to SQL O / R map?

A. DataSet
B. XElement
C. ObjectContext
D. DataContext
Answer» E.
140.

LINQ query can work with?

A. DataSet
B. List
C. Array
D. All of the above
Answer» E.
141.

What is lamda expression? 1. Anonymous function 2. Can be used to create delegates 3. Named function 4. None

A. 1, 2
B. 1, 2, 3
C. 1, 3
D. 4
Answer» B. 1, 2, 3
142.

Debug class is available in which namespace?

A. System.Debug
B. System.Data
C. System.Diagnostics
D. None of the above
Answer» D. None of the above
143.

An interface can contain declaration of?

A. Methods, properties, events, indexers
B. Methods
C. Static members
D. All of the above
Answer» B. Methods
144.

Which of the following are correct? 1. An interface can be instantiated directly. 2. Interfaces can contain constructor. 3. Interfaces contain no implementation of methods. 4. Classes and structs can implement more than one interface. 5. An interface itself can inherit from multiple interfaces.

A. 3,4,5
B. 1,2,3
C. 2,3,4
D. All of the above
Answer» B. 1,2,3
145.

Properties in .NET can be declare as 1. Static, Protected internal, Virtual 2. Public, internal, Protected internal 3. Only public 4. None

A. 1, 2
B. 3
C. 1, 2, 3
D. 4
Answer» B. 3
146.

Which of the following are correct? 1. Delegates are like C++ function pointers. 2. Delegates allow methods to be passed as parameters. 3. Delegates can be used to define callback methods. 4. Delegates are not type safe.

A. 1,3,4
B. 1,2,3
C. 2,3,4
D. All of the above
Answer» C. 2,3,4
147.

Choose the correct one 1) Sealed class can be declared as abstract 2) Abstract class cannot be declared as abstract 3) Abstract class can be declared as abstract

A. Only 1
B. Only 2
C. Only 1 & 2
D. All of the above
Answer» B. Only 2
148.

A write - only property can be specified if the following is present.

A. The set modifier only
B. The get modifier only
C. Both the modifiers
D. None of the modifiers
Answer» B. The get modifier only
149.

For locking the data with synchronization which class will be used?

A. Lock
B. Moniter
C. SyncLock
D. Deadlock
Answer» C. SyncLock
150.

Which of the following are reference types?

A. String
B. Exception
C. Class
D. All of the above
Answer» E.