Explore topic-wise MCQs in Computer Science.

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

51.

Which object works on client side in state management system?

A. ViewState
B. cookies
C. Query strings
D. All of the above
Answer» E.
52.

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
53.

Which object data is included in bookmarks and e-mailed URLs?

A. ViewState
B. cookies
C. Query strings
D. All of the above
Answer» D. All of the above
54.

Which method is used to dynamically register client script from code?

A. Page.ClientScript.RegisterClientScriptBlock
B. RegisterScript
C. Page.ClientScript
D. None of the above
Answer» B. RegisterScript
55.

Which LINQ statement is used to merge two data sources to perform queries?

A. where
B. select
C. join
D. group
Answer» D. group
56.

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

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

Which LINQ keyword is used to categorize results in a query?

A. where
B. select
C. join
D. group
Answer» E.
58.

Which is the mandatory property for all validation controls?

A. ControlToValidate
B. Message
C. EnableClientScript
D. EnableServerScript
Answer» B. Message
59.

Which is the first event of ASP.NET page, when user requests a web page ?

A. PreLoad
B. Load
C. Preinit
D. Init
Answer» D. Init
60.

Which is the first event of ASP.NET page, when user requests a web page?

A. PreLoad
B. Load
C. Preinit
D. Init
Answer» D. Init
61.

Which interface you will use wrap an AJAX client control into a custom server control?

A. IScriptManager
B. IScriptControl
C. IScriptAJAX
D. None of the above
Answer» B. IScriptControl
62.

Which interface defines the basic extension methods for LINQ?

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

Which file you should write for the connection string, so that you can access it in all the web pages for the same application?

A. In App_Data folder
B. In Web.config file
C. In MasterPage file
D. None of the above
Answer» C. In MasterPage file
64.

Which file is used to write the code to respond to the Application_Start event?

A. Any ASP.NET web page with an .aspx extension
B. Web.config
C. Global.asax
D. None of the above.
Answer» D. None of the above.
65.

Which file contains settings for all .NET application types, such as Windows, Console, ClassLibrary, and Web applications?

A. Web.config
B. Machine.config
C. Global.asax
D. All of the above
Answer» C. Global.asax
66.

Which delegate is required to start a thread with one parameter?

A. ThreadStart
B. ParameterizedThreadStart
C. ThreadStartWithOneParameter
D. None of the above
Answer» C. ThreadStartWithOneParameter
67.

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.
68.

Which data provider gives the maximum performance from a connection to SQL Server?

A. The OLE DB data provider.
B. The JDBC data provider.
C. The SqlClient data provider.
D. The Oracle data provider
Answer» D. The Oracle data provider
69.

Which control is required inside a content page to reference ContentPlaceHolder control inside the master page?

A. Content control on a content page.
B. ContentPlaceHolder on a content page.
C. PlaceHolder control is required on content page.
D. None of the above.
Answer» B. ContentPlaceHolder on a content page.
70.

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
71.

Which control is required for every page that have AJAX Extensions for ASP.NET?

A. UpdatePanel
B. ScriptManager
C. ContentPanel
D. None of the above
Answer» C. ContentPanel
72.

Which control can be used to update only the portion of the page?

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

Which CommandType value is incorrect?

A. StoredProcedure
B. TableDirect
C. TableSchema
D. Text
Answer» D. Text
74.

Which attribute is necessary for HTML control to work as a HTML server control?

A. runat=”server”
B. runat=”web-server”
C. ID=”server”
D. ID=”web-server”
Answer» B. runat=”web-server”
75.

Which ado.net class provide disconnected environment?

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

Which ADO.NET class provide Connected Environment?

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

Where do we include the user lists for Form authentication?

A. < credential>
B. < authorization>
C. < Identity>
D. < authentication>
Answer» B. < authorization>
78.

When would you typically use an Input parameter? 1. When the parameter value is created based on user input 2. When the parameter is used to send data from the application to the database 3. When the command is set to execute a statement with a WHERE clause 4. When the parameter value is passed to an INSERT statement

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

When user request a web page by entering Uniform Resource Locator (URL) then which method /verb/command is used in ASP.NET?

A. POST
B. SET
C. GET
D. All of the above.
Answer» D. All of the above.
80.

When the garbage collector runs.

A. It runs automatically
B. EveryDay
C. Every alternate day
D. When IIS restart.
Answer» B. EveryDay
81.

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.
82.

When should you use the OleDbConnection object?

A. When connecting to an Oracle database.
B. When connecting to an Office Access database
C. When connecting to SQL Server 2000
D. None of the above
Answer» C. When connecting to SQL Server 2000
83.

When does Garbage collector run?

A. When application is running low of memory
B. It runs random
C. When application is running for more than 15 minutes
D. None of the above
Answer» B. It runs random
84.

When do LINQ queries actually run?

A. When they are iterated over in a foreachloop
B. When calling the ToArray() method on the range variable
C. When calling the ToList() method on the range variable
D. All of the above
Answer» E.
85.

When a User’s Session times out which event should you respond to?

A. Application_Start
B. Session_End
C. Session_Start
D. Application_End
Answer» C. Session_Start
86.

What types of Objects can you query using LINQ?

A. DataTables and DataSets
B. Any .NET Framework collection that implements IEnumerable(T)
C. Collections that implement interfaces that inherit from IEnumerable(T)
D. All of the above
Answer» E.
87.

What types of shapes can LINQ query results be shaped into? 1. Collections of primitive types 2. Collections of complex types 3. Single types 4. Collections of anonymous types

A. 1, 2, 4
B. 1,2,3
C. 1,3,4
D. None of the above
Answer» B. 1,2,3
88.

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
89.

What type of data can Cookies store?

A. String
B. DateTime
C. System.Int32
D. None of the above.
Answer» B. DateTime
90.

What should you do to access the returned tabular data after starting execution of a command that runs asynchronously? (Choose all that apply.) 1. Call the EndExecuteNonQuerymethod. 2. Call the EndExecuteReadermethod. 3. Wait for the StatementCompletedevent to fire and iterate through the DataReader. 4. Wait for the StatementCompletedevent to fire, call the EndExecuteReadermethod, and then iterate through the DataReader.

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

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.
92.

What property contains the actual error message returned by SQL Server? 1. SqlException.Source 2. SqlException.Message 3. SqlError.Class 4. SqlError.Message

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

What property and method of the Page object do you use to register client script dynamically from code?

A. ScriptManager control is used to dynamically register client script from code.
B. The Page.ClientScript.RegisterClientScriptBlock is used to dynamically register client script from code.
C. ScriptManagerProxy control is used to dynamically register client script from code.
D. None of the above.
Answer» D. None of the above.
94.

What LINQ expressions are used to shape results in a query? 1. where 2. select 3. join 4. group

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

What is/are true about master page?

A. Master page contains a <%@ Master %> directive instead of the normal <%@ Page %> directive.
B. ContentPlaceHolder control can be added only on master page.
C. You can add as many ContentPlaceHolders to a Master Page as you need.
D. All of the above.
Answer» E.
96.

What is/are true about master page? Choose the correct option.

A. You can add more than one master page in a website.
B. Master page can be nested.
C. ContentPlaceHolder control is required on a content page.
D. Both A and B options are correct.
Answer» E.
97.

What is/are the advantages of StateServer session mode?

A. Its keeps the data separate from IIS so; if any Issue comes with IIS it will not hamper Session data.
B. It is useful in web farm and web garden scenarios.
C. Process is fast due to serialization and de-serialization.
D. A and B are the correct option.
Answer» E.
98.

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.
99.

What is/are the advantages of master page?

A. It helps to display common content in multiple pages.
B. They allow you to centralize the common functionality of your pages so that you can make updates in just one place.
C. It helps to create a common page layout.
D. All of the above.
Answer» E.
100.

What is the use of VaryByParam attribute in OutputCache directive?

A. You can neglect VaryByParam attribute while using Page output caching.
B. The VaryByParam attribute determines which versions of the page output are actually cached.
C. The VaryByParam attribute determines which web page is cached in database.
D. None of the above.
Answer» C. The VaryByParam attribute determines which web page is cached in database.