You are on page 1of 21

Csharp.

NET-2 Test Breakdown:


1. Which of the following characters ends every C# statement? Correct answer: Semicolon (;) 2. Your company uses Visual Studio.NET 2005 as its application development platform. You are developing an application using the .NET Framework 2.0. You are required to use a datatype that will store only numbers ranging from -32,768 to 32,767. Which of the following datatypes will you use to accomplish the task? Correct answer: a and c 3. You work as a Software Developer for uCertify Inc. You create an application using Visual Studio .NET 2005. You want to implement classes of the System.Collections namespace in the application. You also want to define size, enumerators, and synchronization methods for all nongeneric collections. Which of the following interfaces will you use to accomplish the task?

Correct answer: ICollection interface 4. You need to identify a type that meets the following criteria: Is always a number Is not greater than 65,535 Which type should you choose? Correct answer: System.UInt16 5. What is MSIL? Correct answer: Microsoft Intermediate Language 6. An assembly is Correct answer: A collection of files that appear to the programmer to be a single DLL or EXE. 7. Which of following is correct: Correct answer: enum Day{Sunday= 01,Monday= 02,Tuesday= 03,Wednesday=04,Thursday= 05,Friday= 06,Saturday=07} 8. In C#, by default structs are passed how?

Correct answer: By value. 9. What is boxing? Correct answer: Encapsulating a copy of a value type in an object. 10. Which method do you invoke on the SQLDataAdapter object to load your dataset with data? Correct answer: Fill 11. A class that cannot be inherited is what type of class? Correct answer: Sealed

12. What is the wild card character in the SQL "like" statement? Correct answer: % (Percent) 13. Managed methods will be marked as ------------ in MSIL code

cil dgclr mscorjit none

14. A master page is merged with a content page ________ in the page execution life cycle Correct answer: Very early 15. Identify which is true Correct answer: DataView ia subset of row and not columns 16. Which property will you use to process different server paths in a page?

Correct answer: Server 17. Which file contains configuration data for each unique URl resource used in project? Correct answer: web.config 18. Automatic paging is possible in Correct answer: datatabel 19. In data reader, what can be used before read method? Correct answer: None 20. What object can help you maintain data across users? Correct answer: Application Object 1.Choose the form in which Postback occurs. Correct answer: Webforms 2. Web.config file is used... Correct answer: To store the global information and variable definitions for the application 3. Which of the following object is not an ASP component? Correct answer: LinkCounter

4. The first event triggers in an aspx page is.

Page_Init() Page_Load() Page_click() 5. Difference between Response.Write() andResponse.Output.Write(). Correct answer: Response.Output.Write() allows you to write formatted output 6. Which of the following method must be overridden in a custom control?

The Paint() method The Control_Build() method The default constructor The Render() method 7. How do we create a FileSystemObject? Correct answer: Server.CreateObject("Scripting.FileSystemObject") 8. Which of the following tool is used to manage the GAC? Correct answer: GacUtil.exe 9. What class does the ASP.NET Web Form class inherit from by default? Correct answer: System.Web.UI.Page 10. We can manage states in asp.net application using

Session Objects Application Objects Viewstate All of the above

11. Attribute must be set on a validator control for the validation to work. Correct answer: ControlToValidate 12. Caching type supported by ASP.Net

Output Caching

DataCaching a and b none of the above

13. What is used to validate complex string patterns like an e-mail address?

Extended expressions Basic expressions Regular expressions Irregular expressions

14. File extension used for ASP.NET files. .aspx 15. An alternative way of displaying text on web page using Correct answer: asp:label 16. Why is Global.asax is used? Correct answer: Implement application and session level events 17. Which of the following is not a member of ADODBCommand object? Correct answer: Open 18. Which DLL translate XML to SQL in IIS? Correct answer: SQLISAPI.dll 19. Default Session data is stored in ASP.Net. Correct answer: InProcess 20. Default scripting language in ASP. Correct answer: VBScript 21. How do you get information from a form that is submitted using the "post" method? Correct answer: Request.Form 22. Which object can help you maintain data across users? Correct answer: Application object 23. Which of the following ASP.NET object encapsulates the state of the client? Correct answer: Session object

24. Which of the following object is used along with application object in order to ensure that only one process accesses a variable at a time?

Correct answer: Synchronize() 25. Which of the following control is used to validate that two fields are equal? Correct answer: CompareValidator 26. Mode of storing ASP.NET session Correct answer: All of the above 27. Which of the following is not the way to maintain state?

View state Cookies Hidden fields Request object

28. You can have only one Global.asax file per project. ,yes 29. ______________ element in the web.config file to run code using the permissions of a specific user

Correct answer: < identity> element 30. __________________ is a special subfolder within the windows folder that stores the shared .NET component.

Correct answer: GAC 31. Which of the following is the performance attributes of processModel?

Correct answer: All 32. Which of the following is faster and consume lesser memory?

SQLDataReader Data Set

33. Which of the following is the way to monitor the web application? You answered: MMC Event viewers

Incorrect Correct answer: ALL 34. The ________________ property affects how the .Net Framework handles dates, currencies, sorting and formatting issues.

CurrentUICulture CurrentCulture

35. Where do we include the user lists for windows authentication? Correct answer: < authorization> 36. Where do we include the user lists for Form authentication?

< credential> < authorization> < Identity> < authentication>

37. Which of the following authentication is best suited for a corporate network?

Windows Form User All

38. What attributes do you use to hide a public .Net class from COM?

Correct answer: ComVisible attributes 39. By default, code written with the Debug class is stripped out of release builds. yes 40. ___________________ tests make sure that new code does not break existing code.

Correct answer: Integration tests 41. Which of the following is used to cache multiple responses for a single web form based on

HTTP POST parameter or query string?

VaryByParams VaryByHeaders SetCacheability SetVaryByCustom

ASP.NET-1 Test Breakdown:


By default, ASP.NET store SessionIDs in _________________

Cookies Cache Database Global variable

Correct answer: Cookies 2. Which one of the following is the last stage of the Web forms lifecycle?

Page_Load Event Handling Page_Init Validate Page_Unload

Correct answer: Page_Unload 3. Which of the following base class do all Web Forms inherit from?

Window class Web class Form class

Page class Document class

Correct answer: Page class 4. _____________is a property common in every validation control.

ValidationExpression InitialValue ValueToCompare ControlToCompare ControlToValidate

Correct answer: ControlToValidate 5. Which one of the following is used to obtain performance information about a Web Application?

Performance Counters Data Performance Counters Web Performance Counters Data Readers Correct answer: Performance Counters 6. ______________is the first method that is fired during the page load.

PreRender() Load() Unload() Init() Correct answer: Init() 7. What namespace does the Web page belong in the .NET Framework class hierarchy?

System.Web.Control System.Web.RootBuilder System.Web.UserControl

System.Web.UI.Page

Correct answer: System.Web.UI.Page 8. Which one of the following is the fastest way to concat strings in ASP.NET?

Concat method of the String object

Append method of the StringBuilder object

Plus sign operator to concatenate the strings

Substring method of the String object 1. Correct answer: Append method of the StringBuilder object 9. When does Garbage collector run?

When application is running low of memory It runs random When application is running for more than 15 minutes None of the above

Correct answer: When application is running low of memory 10. Which of the following object encapsulates the state of the client and the browser?

Server object Request object Response object Session object Application object

Correct answer: Session object 11. Which one of the following is the type of assembly that contains localized resources?

Satellite

Shared Hub localized

Correct answer: Satellite 12. __________________ method(s) are used with Application object to ensure only one process accesses a variable at a time.

Correct answer: Lock() and UnLock() 13. Which one of the following is to be implemented for .NET remote server object?

ISerializable ISingleCall IUnknown IMarshalByValue Correct answer: ISerializable 14. ______________ is the DataType return in IsPostback property.

bit boolean int object string

15. ____________ is the Microsoft IIS server running, handling ASP.NET requests among other things

aspnet_isapi.dll aspnet_wp.exe inetinfo.exe

16. By default, a .Net web site is configured with which of the following authentication types?

Anonymous Basic Digest Integrated Windows authentication a and d Correct answer: a and d

Csharp.NET Test Breakdown:


1. A variable which is declared inside a method is called a________variable

Serial Local Private Static

Correct answer: Local 2. Feature of a local variable

It can be used anywhere in the program

It must accept a class

It must be declared within a method

It represent a class object

Correct answer: It must be declared within a method 3. Two methods with the same name but with different parameters.

Overloading Loading Multiplexing

Duplexing Correct answer: Overloading 4. Is there any errors in this -> EmployeeMgmt constructor: Public int EmployeeMgmt { emp_id = 100; }

Return type No errors Formal parameters Name Correct answer: Return type 5. If a class is using an interface, it must

inherit the properties of the interface contain the same methods as the interface create an interface object all of the above Correct answer: all of the above 6. What is the output of the code public class B : A { }

Errors

It defines a class that inherits the public methods of A only.

It defines a class that inherits all the methods of A but the private members cannot be accessed.

b and c

Correct answer: It defines a class that inherits all the methods of A but the private members cannot be accessed. 7. Sealed Classes cannot be a base class.

Correct answer: True

8. ___________________ allow to encapsulate discrete units of functionality and provide a graphical representation of that functionality to the user

controls object class graphics 9. Features of Read only variables

It is allocated at compile time Declaration and initialization is separated It is allocated at runtime all of these

Correct answer: all of these 10. An Event has _____ as default return type

No return type for events Double Integer String

11. int keyword targets to which .Net type?

Correct answer: System.Int32 12. How many web.config files that can be there an ASP.NET application?

only one only two upto 10 more than one Correct answer: more than one

13. Difference between Convert.ToString() and ToString()

Convert.ToString() handle null values but ToString() don't ToString() output as per format supplied Convert.ToString() only handle null values ToString() handle null values but Convert.ToString() don't Correct answer: Convert.ToString() handle null values but ToString() don't 14. Boxing in .Net allows the user to convert

a interger type to double a reference type to a value type a value type to a reference type a double type to interger Correct answer: a value type to a reference type 15. The RangeValidator control supports the following data types

Integer only Date, Integer and String only string Date and Integer Correct answer: Date, Integer and String 16. How to kill a user session explicitly?

Session.Close() Session.Discard() Session.kill() Session.Abandon() Correct answer: Session.Abandon()

17. Convert vs. Parse methods

Convert allows null values, Parse cannot Convert converts the value, Parse is for parsing Both are same None of these Correct answer: Convert allows null values, Parse cannot 18. Different ways a method can be overloaded in C#.NET

Different parameter data types Different number of parameters Different order of parameters All of above Correct answer: All of above 19. Can you store multiple data types in System.Array? yes 20. Which of the following is incorrect about System.Text.StringBuilder and System.String?

Correct answer: Strings are mutable in .Net 21. What is accessibility modifier protected internal?

It is available to classes that are within the same assembly and derived from the specified base class. It is available within the class definition It is the most permissive access level It is the least permissive access level 22. What is the .NET collection class that allows an element to be accessed using a unique key?

HashTable ArrayList SortedList

Correct answer: HashTable 23. Can you inherit multiple interfaces? Correct answer: Yes 24. What does the keyword virtual mean in the method definition?

The method is public The method can be derived The method is static The method can be over-ridden

Correct answer: The method can be over-ridden 25. _______________ represents a drawing surface and provides methods for rendering to that drawing surface.

Graphic object Pens object Brushes object Colors object Correct answer: Graphic object

ASP.NET-3 Test Breakdown:


What is the best way to store the connection strings?

Config files Database text file session

Correct answer: Config files 2. In which event are the controls fully loaded?

Page_Init Page_Load Control events Page_Unload events

Correct answer: Page_Load 3. What is the name of the property of ASP.NET page that you can query to determine that a ASP.NET page is being requested not data being submitted to web server?

FirstGet Initialized IncludesData IsPostBack

Correct answer: IsPostBack 4. For separating server-side code from client-side code on a ASP.NET page, what programming model should you use?

Separation model

Code-Behind model

In-Line model

ClientServer model

Correct answer: Code-Behind model 5. To perform asynchronous data access, what must be added to the connection string?

BeginExecute=true MultiThreaded=true MultipleActiveResultSets=true Asynchronous=true

6. You are writing ASP.NET 2.0 Web site that collects lots of data from users, and the data collection forms spreads over multiple ASP.NET Web pages. When the user reaches the last page, you need to gather all of data, validate the data, and save the data to the SQL Server database. You have noticed that it can be rather difficult to gather the data that is spread over multiple pages and you want to simplify this application. What is the easiest control to implement that can be used to collect the data on a single Web page?

The View control The TextBox control The Wizard control The DataCollection control

Correct answer: The Wizard control 7. In your ASP.NET web application you want to display a list of clients on a Web page. The client list displays 10 clients at a time, and you require the ability to edit the clients. Which Web control is the best choice for this scenario?

The DetailsView control The Table control The GridView control The FormView control

Correct answer: The GridView control 8. While developing ASP.NET 2.0 web application you have a DataSet containing a Customer DataTable and an Order DataTable. You want to easily navigate from an Order DataRow to the Customer who placed the order. What object will allow you to easily navigate from the Order to the Customer?

The DataColumn object

The DataTable object

The DataRow object

The DataRelation object

9. While developing ASP.NET 2.0 web application you want to display a list of parts in a master/detail scenario where the user can select a part number using a list that takes a minimum amount of space on the Web page. When the part is selected, a DetailsView control displays all the information about the part and allows the user to edit the part. Which Web control is the best choice to display the part number list for this scenario?

10. How to implement authentication via web.config?

Include the authentication element. Include the authorization element. Include the identity element. Include the deny element.

Correct answer: Include the authorization element. 11. In the Design view in Visual Studio 2005 of an ASP.NET web page, what is the easiest way to create an event handler for the default event of a ASP.NET server control?

Open the code-behind page and write the code. Right-click the control and select Create Handler. Drag an event handler from the ToolBox to the desired control. Double-click the control.

Correct answer: Double-click the control. 12. While writing code in Visual Studio 2005 you creates a new instance of a ASP.NET TextBox server control, what do you need to do to get the TextBox to display on the Web page?

Call the ShowControl method on the TextBox. Set the VisibleControl to true on the TextBox. Add the TextBox instance to the form1.Controls collection. Execute the AddControl method on the Web page.

Correct answer: Add the TextBox instance to the form1.Controls collection. 13. Session_End fires in which of these SessionState modes?

Inproc StateServer

SQLServer None

Correct answer: Inproc 14. Cache["dd"]="asp.net"; What is the timeperiod of this Cache object?

Infinite

0 seconds

None of these

Correct answer: 0 seconds 15. You are developing a web application that is retrieving historical library information from database server and displays it to the users of your application. What cache strategy will give you the best performance?

Use the output cache

Use a cache object

Use the ASP.NET central cache

Use the client cache

16. What ASP.NET object encapsulates the state of the client and the browser?

Application Object

Session Object

Response Object

Request Object Correct answer: Session Object 17. You need to store state data that is accessible to any user who connects to your Web application. Which object should you use?

Session Application Response.Cookies Response.ViewState 18. When you have a complex control, like DataGrid, writing an event processing routine for each object (cell, button, row, etc.) is quite tedious. The controls can ___________________ their eventhandlers, allowing the main DataGrid event handler to take care of its constituents.

invoke event raise event bubble event instantiate event Correct answer: bubble event 19. __________________ is the Microsoft IIS server running, handling ASP.NET requests among other things

Correct answer: inetinfo.exe