<< All Upwork (oDesk) and Elance Tests << Upwork (oDesk) test answers << General Programming category
See all 6 tests answers updated
Find Upwork (oDesk) and Elance test answers on this website:
1. ____ is a subset of the CTS.
• None of these
2. Which of the following is not correct about DataReader?
• It provides a forward-only and read-only row set of data from a data source
• Its CursorType property is adOpenForwardOnly
• Its LockType property is adLockReadOnly
• None of the above
3. Which of the following classes is not associated with System.IO?
4. You are building a VB.NET application for an ISP company. The receptionist has to fill a customer registration form for dealing with walk-in customers. The form retrieves all the available products from the database into a ComboBox named "cbProducts". It uses a ListItem to add the "ProductID" and "ProductName" of each record to the combo box. The values on the form should finally be inserted into the Customer table. How will you retrieve the "ProductID" of the selected product for the update?
• CType(cbProducts.Items(cbProducts.SelectedIndex), ComboBox).ID
• CType(cbProducts.Items(cbProducts.SelectedIndex), ListItem).Value
• CType(cbProducts.Items(cbProducts.SelectedIndex), ListItem).ID
5. A programmer wrote a small function to return the sum of two bytes: Public Function add(ByVal b1 As Byte, ByVal b2 As Byte) As Byte Return b1 + b2 End Function What will happen when add(200, 80) is called by the program?
• The result returned will be 280
• An exception will be thrown
• A syntax error will stop the execution
• Bytes cannot be passed by value
6. In .NET generics, the type parameter:
• Needs to be constrained in container classes
• Needs to be constrained in all the classes
• Cannot be constrained in container classes
• Cannot be constrained in any class
7. Which of the following is not used for searching for an item within an array?
8. Which of the following methods is useful for searching within a list box?
9. You have to update some values in the database. Which method will you execute on a command object named "cmdUpdate"?
10. Which of the following statements is correct with regard to Windows process memory allocation?
• Each process (instance of an application) gets its own RAM and saves the OS from crashing if the process crashes
• RAM is shared between the processes. This saves the OS from crashing when a process crashes
• Each process gets its own RAM and causes the OS to crash when the process crashes
• RAM is shared between the processes and causes the OS to crash when a process crashes
11. You have created a SQlCommand object using "con" as an open connection object: Dim cmd as New SqlCommand("Select CategoryID, CategoryName FROM Categories", con) Which method will you use to run the query?
12. How many classes can a single .NET DLL contain?
13. What is a delegate?
• A strongly typed function pointer
• A light weight thread or process that can call a single method
• A reference to an object in a different process
• An inter-process message channel
14. Code Manager is a part of:
15. Which of the following methods is not provided with a "RichTextBox" class?
16. In .NET framework, reflection is used to:
• Create metadata of the modules/assemblies
• Get metadata of the modules/assemblies
• Reengineer the corrupted assemblies
• Destroy the corrupted assemblies
17. The ___________ namespace is not defined in the base class library.
18. The .NET framework comes with a few CLR hosts. Which of the following is a CLR host?
• Shell Executables
• All of the above
19. The global assembly cache:
• Can store two dll files with the same name
• Can store two dll files with the same name, but different versions
• Can store two dll files with the same name and same version
• Can not store dll files with the same name
20. You defined a data adapter as follows: Dim adap As New SqlDataAdapter("select * from products;select * from customers", New SqlConnection(ConnectionString)) Dim DataSt As New DataSet adap.Fill(DataSt) How will you pass the data of "customers" to a data grid named as "dGrid"?
• dGrid.DataSource = DataSt.Tables(1)
• dGrid.DataSource = DataSt.Tables(2)
21. A programmer wrote the following subroutine to calculate the area and circumference of a circle for a given radius: Public sub SetValues(ByVal r1 As Double, ByVal r2 As Double) If (r1 > 1 And r2 > 1) Then cir1 = (2 * Math.PI * r1): cir2 = (2 * Math.PI * r2): area1 = (Math.PI * r1 * r1) End Sub Here cir1, cir2 and area1 are global variables of type double. Which of the following are true with regard to the above 'if' statement?
• If r1 > 1 then cir1=(2 * Math.PI * r1) will be executed
• If r2 > 1 then cir1=(2 * Math.PI * r2) will be executed
• If (r1 or r2) > 1 then cir1=(2 * Math.PI * r1) and cir2 = (2 * Math.PI * r2) will be executed
• If (r1 and r2) > 1 then all the three statements will be executed
22. Which of the following is not a feature of .NET 2.0?
• Partial classes
• Multiple Inheritance
• Partial Methods
23. How can you make a form scrollable?
• Set its Scrollable property to true
• Set its AutoScrolling property to true
• Set its Scroll property to true
• Set its AutoScroll property to true
24. Which of the following Visual Studio projects is not available in the "New Project" dialog box?
• Console application
• Class library
• Wireless application
• .Net web service
25. Which of the following is true for overriding?
• The behavior of the derived class function is changed
• The behavior and name of the derived class function are changed
• The name of the derived class function is changed
• The name and arguments of the derived class function are changed
26. With VB.Net, controls can be created at run time. The statement that can be used to add events to such runtime controls is:
27. You have placed an OpenFileDialog control to let users select image files. How will you set the filter to display image files only? The name of the control is "ofdImage".
• ofdImage.Filter = "Image Files|*.BMP;*.GIF;*.JPG"
• ofdImage.Filter = "Images*;*.BMP|*.GIF|*.JPG"
• ofdImage.Filter = "*.BMP;*.GIF;*.JPG| Images"
• ofdImage.Filter = "Image Files|BMP.*;GIF.*;JPG.*"
28. Which of the following statements is correct with regard to .NET framework managed web pages?
• They interact directly with the runtime
• They do not execute in the native code language
• They are interpreted and scripted
• All of the above
29. You have made a form named "frmEdit" with the following menu and submenu items: File Edit ------------------- New Copy Open Cut Exit Paste The reference created for the frmEdit is "frmEd". How will you access the name of the submenu item 'Paste' within the code?
30. What will be the result of the following code: Dim employeeDS As DataSet employeeDS.Tables.Add(new DataTable("FirstQTR"))
• It will create a table named FirstQTR
• It does nothing because an object reference has not been set to an instance of the DataSet object
• It will produce an error because an object reference has not been set to an instance of the DataSet object
• None of the above
31. Which of the following is used as a Serializer for the web services?
32. Which of the following datatypes are new in Visual Basic .Net?
• float, short
• decimal, char
33. Which of the following is not correct for using binary search with an array?
• It is the fastest method of searching
• It works well with unsorted arrays
• It can search array lists of up to 100,000 elements or more
• It compares the search string with the middle array element
34. Consider the following small concatenation function: Public Function concat(ByVal st1 As String, ByVal st2 As String) As String concat = st1 + st2 st1 = "" st2 = "" End Function The original encrypted strings passed to the function were: s1="James" s2="Bond" If the resultant string is s3, what would be the value of s1, s2, s3 after the function has been called?
• s1="James" s2="Bond" s3="JamesBond"
• s1="James" s2="Bond" s3="James"
• s1="" s2="" s3="JamesBond"
• s1="James" s2="Bond" s3=""
35. A hashtable is serialized by using:
• XmlSerializer or SoapFormatter
• XmlSerializer and SoapFormatter
36. Which of the following statements is correct with regard to a CommandBuilder object?
• It creates update/delete commands based on the primary key column
• It creates update/delete commands based on all the identity columns
• It creates update/delete commands based on original values of all the selected columns
• It creates update/delete commands according to its internal algorithm
37. Asynchronous execution is supported in ADO.NET 2.0 for ExecuteReader, ExecuteScalar, and ExecuteNonQuery.
38. Which of the following keywords does not work with methods?
39. Where is the shared assembly generally stored?
• The application's directory
• Global assembly cache
• C drive
• None of the above
40. Which of the following options represents the possible values for the 'DataRowVersion' class?
• Current, Revised, Original, Modified
• Revised, Default, Original, Modified
• Current, Default, Edited, Proposed
• Current, Default, Original, Proposed
41. Consider the following definition of a subroutine: Public Sub SetAmount(Rate As Double, ItemCount As Integer, ItemName As String) Which of following is the correct way to call the sub?
• SetAmount(525.50, "CD Player", 2)
• SetAmount(2, 525.50, "CD Player")
• SetAmount(ItemCount:2, Rate:525.50, ItemName:"CD Player")
• SetAmount(Rate:=525.50, ItemName:="CD Player", ItemCount:=2)
42. Which of the following statements is not correct with regard to .NET assemblies?
• Static assemblies can include classes, JPEG files, resource files etc.
• Static assemblies are stored on disk in PE files
• The .NET Framework can create dynamic assemblies
• Dynamic assemblies are automatically saved to disk before execution
43. You are designing a testing application where every participant has to submit his/her answers. The test takers are ranked according to the correctness of the answers. All those who score the same marks are ranked according to the quickness in submitting the answer sheet. Which collection is best for your application?
44. You designed a user login screen for a new management system written in VB.Net. What should be the signatures of the Login button's click event, if the button name is "bLogin"?
• Private function bLogin_Click(ByVal sender As System.Attribute, ByVal e As System.EventArgs) Handles Button.Click
• Private Sub bLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bLogin.Click
• Private Sub bLogin_Click(ByVal sender As System.Attribute, ByVal e As System.EventHandler) Throws Exception
• Private Sub bLogin_Click(ByVal sender As System.Object, ByVal e As System.EventHandler) As Button.Click
45. Which of the following is not correct for an Exception?
• It should be handled using Try Catch blocks
• A maximum of five catch blocks can be declared
• The Finally block is optional
• You can throw new exceptions using: Throw : new Exception("description")
46. Which one of the following statements is true about MSIL code?
• It is compiled to native code by JIT compilers
• It is source code-specific
• It is only found in static assemblies
• It is architecture-specific
47. What is the nominal storage allocation for the Byte data type?
• 2 byte
• 1 byte
• 8 byte
• 16 byte
48. What does Managed Data refer to?
• The data stored by CLR
• The data allocated by CLR GC
• The data de-allocated by CLR GC
• The data allocated and de-allocated by CLR GC
49. Which of the following is not correct with regard to DataReader and DataSet?
• DataReader reads one row from the database
• DataSet retrieves the complete set of data from the database
• DataReader can only get its data from a data source through a managed provider
• DataReader closes its connection automatically
50. Which of the following collections exposes the capacity method?
51. .NET Framework programs are compiled into a CPU independent instruction set named:
• Microsoft Interpreted Language
• Microsoft Intermediate Language
• Microsoft Virtual Language
• Microsoft Common Language
52. Which of the following should you use to serialize instances of a class?
• It depends on the situation
53. You have created a guest book which uses an XML document. Initially, the XML file is uploaded into a data table and as the records increase, the value of the 'GuestID' column should be incremented. Which properties of a column will be used to implement auto increment functionality?
54. The code written to target common language runtime services is called:
• Generated Code
• Managed Code
• Unmanaged Code
• CLR Code
• Service Code
55. Which of following methods is not provided by the "Directory" class?
56. Which of the following is not correct with regard to shared assembly?
• Its version can be controlled by the author only
• It can be shared by many applications
• It must get registered with the machine registry
• It is installed in the global assembly cache
57. In a subroutine, a programmer defined the 'for' loop as follows: Dim count, endAt As Integer endAt=5 For count = 0 To endAt If (getValue() = True) Then endAt = 10 Next How many times will the loop execute, if the getValue() function returns true at count=0?
58. One of your forms displays the list of all the Customers in a list box and all their details in the text boxes. On selecting a Customer from the list box, the text boxes should show details of that customer. Which of the following will be useful?
• Me.BindingContext(TableName, DataSet).Position
• Me.BindingContext(TableName, DataSet)
59. Which of these files is used for debugging an application?
• Any of these can be used
60. You have defined a class to calculate the bonus paid to the employees of a company: Public Class Bonus Public Function GetBonus(ByVal sal As Double) As Double Dim bonus as Double . . . . . . . . . . 'Complex calculations to calculate it Return bonus End Function End Class Now some employees get an additional sum of $100 as special bonus on top of this. How will you design a class without changing the existing class?
• Public class BonusMod
• Public class BonusMod Inherits Bonus
• Public class BonusMod Extends Bonus
• Public class BonusMod Overrides Bonus
61. Which of the following types of inheritance is not supported by .Net?
• Implementation inheritance
• Multiple inheritance
• Visual inheritance
• Interface inheritance
62. What is the syntax to create a SQL connection in VB.Net?
• Dim str As string Str = "server = ads; uid = ads ; pwd = ghf; database = bvb" Dim con as new sqlConnection(str)
• Dim str as string Str = "server = ads; pwd = ghf; database = bvb" Dim con as new sqlConnection(str)
• Dim str As string Str = "uid = ads ; pwd = ghf; database = bvb" Dim con as new sqlConnection(str)
• Dim str As string Str = "server = ads; uid = ads ; pwd = ghf" Dim con as new sqlConnection(str)
63. How many bits does the int datatype use in .NET?
• 16 bits
• 32 bits
• 64 bits
• None of the above
64. While working with collections, sometimes it is necessary to persist objects. Which method will be suitable to store a HashTable named "hash" to a file Stream named "fileStr" using a BinaryFormatter named "BF"?
• BF.Serialize(fileStr, hash)
• BF.SerializeGroup(fileStr, hash)
• BF.Serialize(hash, fileStr)
• BF.SerializeGroup(hash, fileStr)
65. You have an array list named "alCustomer" containing 200 items. The array list is sorted, and you want to copy customers 21 to 50 from this list to a new array list named "alSpecial". Which of the following methods will you use?
• alSpecial.Insert(0, alCustomer.SetRange(20, 30))
• alSpecial.InsertRange(0, alCustomer.GetRange(20, 30))
• alSpecial.Add(0, alCustomer.SetRange(21, 50))
• alSpecial.Add(0, alCustomer.GetRange(21, 50))
66. Consider the following definition of an overloaded function: Public Overloads Function Join(ByVal st As String, ByVal no As Integer) As Double Which of the following does not represent a valid overloaded method with respect to the above declaration?
• Public Overloads Function Join(ByVal str As String, ByVal num As Integer) As String
• Public Overloads Function Join(ByVal num As Integer, ByVal str As String) As String
• Public Overloads Function Join(ByVal str As String, ByVal num String) As String
• Public Overloads Function Join(ByVal str As Integer, ByVal num Integer) As Double
67. What kind of object is a string considered to be?
68. Which one of the following statements is true about garbage collection?
• It is invoked every 40 seconds until the process is destroyed
• It is invoked every time a constructor is called
• It only occurs when the Collect method is explicitly invoked in the System.GC class
• It is invoked when generation 0 does not have room for the newly created object
69. Which of these assemblies is used for doing localization?
• Both Public and Private
70. ______________ is self-describing code.
• Unmanaged Code
• Managed Code
• High Level Code
• Secured COde
71. A DataSet:
• Can derive data from a database
• Can derive data from an XML file
• Can derive data from both an XML file and a database
• Can be used to view data only
72. You want to compile your Visual Basic .NET source code. Which command-line tool will you use?
73. Which transport protocol is used to call a Web Service?
• Any of these can be used
74. Which one of the following is a value type?
75. Which method of the FormsAuthentication class is used to read user ids and passwords from the web.config file automatically
76. Which Portable Executable (PE) file does not contain the assembly manifest?
77. Which of the following is used to return only the time of the current day?
78. Delay signing allows a shared assembly to be signed with:
• A private key at the initial stage
• Private and public keys at the initial stage
• A private key at a later stage
• A public key at a later stage
79. You declared an object variable named 'obj'. How will you check if it is initialized or not?
• if (obj == null) then
• if(obj) then
• if(obj is nothing) then
• if (IsNull(Obj)) then
80. Which of the following is true for the 'instance' methods?
• They must be invoked by calling the new constructor
• Their instance is saved by the system for performance reasons
• They can be invoked by using the class name followed by the method name
• They are defined using the keyword 'instance'
81. Which of these are runtime hosts in .NET Framework?
82. Which of the following are valid methods of the SqlTransaction class?
83. _____________ helped overcome the DLL conflict (faced by the versions prior to .NET).
• Strong-named assemblies
• Version-aware code storage
• Components executing in isolation
• All of the above
84. Which namespace contains the DataSet class?
85. An application reads stock listings from a text file and displays them in a combo box. Since the text file contains at least 8000 records at a given time, the default property of the combo box is set to 'sorted'. The list is cleared before each reload and the new stock listing file is loaded by the user via a load button. The user complains that loading is very sluggish. Which is the most effective and user friendly solution to address this problem?
• Remove sorting from the combo box
• Increase the RAM of the system
• Reduce the number of file uploads
• Enable sorting on the combo box only after each load
86. What is the value range of the Boolean data type?
• True or False
87. Which of the following helps assemblies become self describing?
• Application Domain
88. .NET framework has data providers for:
• ODBC and SQl Server
• Sql Server, OleDb, and ODBC
• Sql Server,OLeDb, and Oracle
• Oracle, OleDb, Sql Server, and ODBC
89. You have a table named 'FirstQTR' and want to create another table named 'SecondQTR' which is exactly the same as 'FirstQTR', including DataTable schema and constraints. Which of the following methods will fulfill this requirement?
90. A class contains an overridable method "getBalance(utype as Integer)". Its derived class also has the same method, but with a different implementation. How can the parent and child classes refer to their own methods explicitly?
91. How is an assembly unloaded?
• By using the static method Unload()
• By using the non static method Unload()
• By unloading its application domain
• By unloading CLR
92. Dot Net Framework consists of:
• Common language runtime
• Set of class libraries
• Common language runtime and set of class libraries
• Common language runtime, set of class Libraries, and ADO.NET
93. In which file can you define the "Process Model" attribute?
• In both files
• In neither file
94. Which of the following benefits is not related to CLR?
• Ability to use components developed in different language
• Garbage collection
• IDL (interface definition language) use is promoted by restricting self describing objects
• Ability to compile once and run on any computer having CLR
95. Which of the following manages the code during execution?
• Coding Manager
• Code Manager
• Coder Manager
96. Which of the following methods is not correct for clipping an image?
97. The following function is defined in a class called "StringFormatter": Public Shared Function HasLettersOnly(ByVal str As String) As Boolean If (str.Length > 0) Then Dim i As Int64 For i = 0 To str.Length - 1 If Not Char.IsLetter(str.Chars(i)) Then Return False Next i End If Return True End Function How will you call this function if the string to be validated is defined as "UserString"?
• Dim sf as new StringFormatter("UserString") sf.HasLettersOnly()
• Dim sf as StringFormatter(UserString) sf.HasLettersOnly(UserString)
• Dim sf as new StringFormatter(UserString) sf.HasLettersOnly()
98. How does CLR allow multiple applications to be run in a single process?
• By running them in a special application domain
• By making sub processes for each process
• By loading them in separate application domains
• None of the above
99. Which of the following should be inserted in the constructor to refer to the super/parent class?
100. You have written a function to generate a unique bill number for every new bill: 1 Public Function getNewBillNo() As Integer 2 Dim cm As New SqlCommand("select max(billno) from bill", con) 3 con.Open() 4 5 6 End Function You want to return "1" as the bill number if no record exists in the database. Otherwise, the return value should be the maximum bill number plus one. What should follow in line 4, if you want to check for Null values as well?
• Return (IIf(IsNull(cm.ExecuteNonQuery), 1, cm.ExecuteNonQuery +1))
• Return (IIf(IsDBNull(cm.ExecuteScalar), 1, cm.ExecuteScalar +1 ))
• Return (IIf(IsNull(cm.ExecuteScalar), 1, cm.ExecuteScalar))
• Return (IIf(IsDBNull(cm.ExecuteNonQuery), cm.ExecuteNonQuery ,1))
101. For MSIL code to be executed in a PE file, it is necessary to have:
• Assembly manifest
102. Which of the following is not associated with the command object in ADO.NET 2.0?
103. You want to open a form named 'frm' from a MDI form. This is the first line of code that you have written: Dim frm as new ApplicationForm Which of the following will make the form visible?
104. Which of the following tools assists in Assembly Signing?
105. You have written a simple function to multiply two integers: Line 1 Public Function multiply(ByVal a As Int32, Line 2 ByVal b As Int32) As Int32 Line 3 return (a * b) Line 4 End Function What will happen on running the program?
• The program will compile and run successfully
• The compilation error produced will be fixed by changing As Int32' to 'As Integer' in line 2
• The compilation error produced will be fixed by replacing line 3 with Return CType(a * b, Int32)
• The compilation error produced will be fixed by appending "_" (underscore) to the end of line 1
106. You assigned the version number - 220.127.116.11 to your assembly. The four digits stand for:
• Revision, Built, Major Version, and Minor version
• Revision, Built, Minor Version, and Major version
• Built, Major version, Minor Version, and Revision
• Major version, Minor Version, Built, and Revision
107. In a list box control, the property named "SelectionMode" controls the selection of the items. Which of the following is not correct for the "SelectionMode" property?
• MultiSimple allows multiple item selection
• MultiExtended allows extended multiple selection
• Default allows single item selection
• None prohibits any selection
108. You passed an array as an argument to the following function: Public Function Modify(ByVal ar as Integer) as Boolean What will happen to the original value of the array (ar), if the function modified the values?
• The original value of the passed array will be modified permanently
• The original value of the passed array will not be modified
109. Which of the following is a must for a private assembly?
• Cryptographically strong name
• Unique name
• Cryptographically light name
• Global assembly cache
110. Which of the following declarations is not valid?
• Dim x, y, z As Integer
• Dim x As int32, y As Int32, z As int32
• Dim x%, y%, z%
• Dim a As Int32, b As Short
111. Which of the following statements about ADO.NET is not correct?
• ADO uses recordsets whereas ADO.NET uses datasets
• The ADO navigation approach is non-sequential whereas in ADO.NET it is sequential
• Disconnected access in ADO has to be coded explicitly whereas ADO.NET handles it with the adapter
• ADO offers hierarchal recordsets for relating multiple tables whereas ADO.NET provides data relations
112. A __________ assembly can be used to deploy language-specific resources for an application.
113. Which of the following is true for "shadowing" a function belonging to the parent class?
• The derived class must have the same method type, scope, name and parameters
• The derived class must have the same method type, scope and name
• The derived class must have the same method type and name
• The derived class must have the same name