Ads by Google
Get This Adsense Pop-up Window


Thursday, 17 March 2016

Dot Net 2.0 using C# upwork Test 2016 Answer

1.Which of the following are true when comparing built in types for equality?
Answers:
  1. Integral types are considered equal if they represent the same value.
  2. Object types are considered equal if they both refer to the same object or if both are null
  3. String types are considered equal if they have identical lengths and identical characters in each character position
  4. String types are considered equal if they have identical dimensions and identical content at each array index
2. Which of the following types guarantee atomic reads and writes?
Answers:
  1. int
  2. double
  3. string
  4. long
  5. float
3. Which of the following types are derived from System.Reflection.MemberInfo?
Answers:
  1. System.Reflection.PropertyInfo
  2. System.Reflection.EventInfo
  3. System.Type
  4. System.Reflection.InstanceInfo
4. Which of the following applies to interface inheritance?
Answers:
  1. If a class implements an interface, the implementation can be provided by a public member of a base class.
  2. A class may partially implement an interface by only declaring some of the members
  3. Interface methods may be implemented so that they are NOT directly accessible using an instance reference to the class
  4. Since interface implementation methods can not be declared private,protected, or internal, they are always accessible from any point in an application
5. Which of the following operators can be overloaded?
Answers:
  1. Assignment (=)
  2. Conditional (&&,||)
  3. Logical (&,|,^)
  4. Shift (<<, >>)
6. Which of the following are true about using the System.Messaging.MessageQueue class?
Answers:
  1. It provides communication across heterogeneous networks
  2. It provides communication when one of the endpoints may be off-line
  3. It may behave differently depending on the current operating system
  4. A new system level queue may be created simply by creating an instance of MessageQueue.
7. Which of the following characteristics are found in an iterator?
Answers:
  1. It is a statement block which may contain a yield return statement to provide the next value of the iteration
  2. It is a statement block which may contain a yield break statement to provide the next value of the iteration
  3. It is a statement block which may contain a yield return statement to indicate that the iteration is complete
  4. It is a statement block which may contain a yield break statement to indicate that the iteration is complete
  5. It is a class which implements Ienumerable
8. Which of the following are true for parameters?
Answers:
  1. Changes to value parameters always involve making a copy of the original argument
  2. Items passed as Reference Parameters must be initialized prior to the call.
  3. Output Parameters do not need to be assigned inside the method
  4. Variable Length argument lists are not supported
9. Which of the following are true about using ADO.NET DataSets and DataTables?
Answers:
  1. The connection to the database must remain valid for the life of the data objects
  2. All tables in a dataset must come from the same database.
    A given instance of a DataTable can be in only one DataSet
  3. Changes made to multiple tables within a DataSet can easily be extracted to a new DataSet which contains only the changes
  4. Content from multiple DataSets can easily be combined into a single DataSet that contains the net result of all changes.
10. Which of the following are true with respect to the standard implementation of Garbage Collection?
Answers:
  1. Objects must be set to null in order to be eligible for garbage collection
  2. Unless specific steps are taken, an object may be moved in memory
  3. Objects become eligible for garbage collection as soon as it is impossible for any code to access it
  4. Objects which implement finalizers will always have the finalizer called at some point
11. Which of the following are true about Nullable types?
Answers:
  1. A Nullable type is a reference type.
  2. A Nullable type is a structure.
  3. An implicit conversion exists from any non-nullable value type to a nullable form of that type.
  4. An implicit conversion exists from any nullable value type to a non-nullable form of that type.
12. Which of the following are true about declarative attributes?
Answers:
  1. They must be inherited from the System.Attribute.
  2. Attributes are instantiated at the same time as instances of the class to which they are applied.
  3. Attribute classes may be restricted only to be applied to application element types.
  4. By default, a given attribute may be applied multiple times to the same application element.
13. What output will be generated by the following code?
StringBuilder sb = new StringBuilder(10);
sb.AppendFormat(“1234567890123”);
Console.WriteLine(sb.Capacity);
Answers:
  1. 10
  2. 20
  3. Some value equal to or larger than 13
  4. Int32.MaxValue
14. The term Encapsulation is most commonly used to mean:
Answers:
  1. separating an item’s public interface from the actual implementation
  2. embedding content as a resource into an executable program
  3. providing a short summary description of complex operations
  4. a technique using base and derived classes
15. Which of the following are true about namespaces and assemblies?
Answers:
  1. A single assembly may contain multiple namespaces
  2. The same namespace may be used in multiple assemblies
  3. Namespaces may be aliased to provide a shorthand notation for a fully qualified identifier
  4. All of the above
16. Which of the following are true about pointers?
Answers:
  1. C# does not support the use of “*” to indicate a pointer.
  2. Pointers are a type derived from System.Object
  3. Pointers can be used as out and ref type parameters
  4. Pointer references are tracked by the garbage collector.
17. The framework provides three different timer classes. Select the answer that properly matches the class with the listed characteristic.
Answers:
  1. System.Threading.Timer A simple timer which requires a delegate to be supplied for execution when the timer expires. Execution of the method provided by the delegate will be invoked on a ThreadPool Thread.
  2. System.Timers.Timer: Designed for use with worker threads in a multithreaded environment. Can move among threads to handle the raised Elapsed event May result in more accuracy than the System.Windows.Forms.Timer instances.
  3. System.Windows.Forms.Timer A lower resolution timer which requires a UI message pump on the creating thread.
  4. All of the above
18. Transactions initiated in which of the following are supported by System.Transactions infrastructure?
Answers:
  1. SQL Server
  2. ADO.NET
  3. MSMQ
  4. Microsoft Distributed Transaction Coordinator (MSDTC).
  5. All of the above
19. Which of the following is not a valid value for DataRowState?
Answers:
  1. Added
  2. Modified
  3. Dirty
  4. Detached
  5. Deleted
20. With which class is the task of mapping a specific point in time into units, such as weeks, months, and years accomplished?
Answers:
  1. System.DateTime
  2. System.TimeSpan
  3. System.Globalization.Calendar
  4. System.Globalization.CultureInfo
21. Which of the following are required to be true by objects which are going to be used as keys in a System.Collections.HashTable?
Answers:
  1. They must handle case-sensitivity identically in both the GetHashCode() and Equals() methods.
  2. Key objects must be immutable for the duration they are used within a HashTable.
  3. Get HashCode() must be overridden to provide the same result, given the same parameters, regardless of reference equalityl unless the HashTable constructor is provided with an IEqualityComparer parameter.
  4. All of the above
22. Which of the following is NOT a valid C# preprocessor directive?
Answers:
  1. #define
  2. #line
  3. #include
  4. #error
  5. #pragma
23. Which of the following are valid as the underlying type for an enumeration?
Answers:
  1. int
  2. sbyte
  3. long
  4. All of the above
24. Which of the following can an interface NOT contain?
Answers:
  1. Methods
  2. Events
  3. Fields
  4. Indexers
25. Which of the following is true about exceptions?
Answers:
  1. Exceptions should be derived from the System.Exception, but are not required to do so.
  2. If no catch block is found for an exception, and the source is not a static constructor, a System.ThreadException will be thrown
  3. Mathematical errors such as divide by zero, or numeric overflow will generate an exception that is derived from System.Exception
  4. Every throw statement must have at least one catch block
26. Which of the following is false regarding arrays?
Answers:
  1. For reference types A and B; if a conversion from A to B exists, a conversion from A[] to B[] also exists
  2. For value types A and B; if a conversion from A to B exists, a conversion from A[] to B[] also exists
  3. Assignments to arrays elements may require a runtime check to validate the type safety of the assignment
27. Which of the following is an effect of marking resources in satellite assemblies?
Answers:
  1. It renders the resources unavailable.
  2. It ensures that resources are used only with the appropriate culture
  3. It prevents identifier collisions between multiple satellite assemblies
  4. It has no impact since access specifiers for resources are not applied.
28. When developing a managed client to be used with an existing COM Component, __________.
Answers:
  1. you should modify the COM component to enable CLR functionallity.
  2. you should use TlbImp.exe to create a managed wrapper
  3. you should use TlbExp.exe to create a managed wrapper
  4. you should enable an unsafe code
29. Which of the following is true about C# generics?
Answers:
  1. C# allows non-type template parameters
  2. C# supports explicit specialization
  3. C# allows the type parameter to be used as the base class for the generic type
  4. C# allows a generic type parameter itself to be a generic
  5. C# enforces that all codes are valid for all types of parameters
30. Which System.Runtime.Remoting class is used to store all relevant information required to generate a proxy in order to communicate with a remote object?
Answers:
  1. ObjRef
  2. MarshalByRefObject
  3. ObjectHandle
  4. RemotingServices
31. Which of the following characteristics is found in The DateTime type?
Answers:
  1. It always references the UTC (GMT) time
  2. It always references the Local time
  3. It contains a member indicating which time zone it refers to
  4. It contains a member indicating whether it is UTC, Local, or Unspecified
32. Which of the following are true about anonymous methods?
Answers:
  1. Anonymous methods have access to the local state of the containing function member.
  2. An anonymous method requires an explicit method signature
  3. An anonymous method can impact the lifetime of local variables and parameters of the containing function
  4. A struct may not declare an anonymous method which directly references member fields
33. Elements in a System.Collections.Specialized.OrderedDictionary are:
Answers:
  1. sorted by Key
  2. sorted by Element
  3. not sorted
34. Which of the following is NOT part of an assembly?
Answers:
  1. Manifest
  2. MetaData
  3. Intermediate Language Code
  4. Resources
  5. Native Executable Code
35. Which of the following characteristics do classes in the System.Drawing namespace such as Brush,Font,Pen, and Icon share?
Answers:
  1. They encapsulate native resources and must be properly Disposed to prevent potential exhausting of resources.
  2. They are Value Type objects.
  3. You can inherit from these classes to provide enhanced or customized functionality
  4. None of the Above
36. Which of the following is not a valid attribute for impacting serialization?
Answers:
  1. DataContractAttribute
  2. DataMemberAttribute
  3. EnumMemberAttribute
  4. CollectionDataContractAttribute
  5. DataObjectAttribute
37. class Sample
{
public Sample(int x) { }
}
In the above code, which of the following other class constructors can directly access the provided constructor?
Answers:
  1. public Sample() : this(1) { }
  2. public Sample() : Sample(1) {}
  3. Both the above.
  4. One class constructor can not directly access another constructor
38. Which of the following code samples will cause a compilation error?
Answers:
  1. class SampleClass {} class SampleClass<T> {}
  2. class SampleClass<T> {} class SampleClass<T,U> {}
  3. class SampleClass<T> where T : class { } class SampleClass<T> where T : struct { }
  4. class SampleClass {} class SampleClass<T> where T : class { }
39. Which of the following are true about statements?
Answers:
  1. A while statement will always execute its body at least once.
  2. A for loop will always execute its body at least once.
  3. A try statement must always include at least one catch block
  4. A case clause within a switch statement may not fall through to the next case clause
40. If two assemblies contain the same fully qualified class, which of the following will be true?
Answers:
  1. It is impossible to add a reference to both assemblies to any given assembly
  2. A new root can be added to the assemblies namespace hierarchy by the use of an extern alias
  3. The specific colliding name may be altered by using an extern alias
  4. The collision may be avoided by using a statement to provide an alias
41. Which of the following are true about delegates?
Answers:
  1. A delegate requires an instance method be supplied.
  2. A delegate instance may encapsulate only one method
  3. Delegates are not typesafe
  4. A delegate instance does not know or care about the class type of the encapsulated method
42. When Deleting a DataRow from the DataRowCollection of a DataTable, you can:
Answers:
  1. use the DataRowCollection.Remove method to immediately delete the row.
  2. use the DataRowCollection.Remove method to mark the row for deletion when DataRow.AcceptChanges is called.
  3. use the DataRow.Delete method to immediately delete the row.
  4. use the DataRow.Delete method to mark the row for deletion when DataRowAcceptChanges is called.
43. Which of the following is NOT a requirement for an application to be certified in the “Certified for Windows Program”?
Answers:
  1. Usage of system settings for size, color, and font
  2. Support for Windows “High Contrast” option
  3. Usage of sound to notify of critical information
  4. Keyboard only access to all features including menus, and controls
44. Which access limitation does a class member declared protected internal have?
Answers:
  1. Access is limited to the containing class plus any classes derived from the containing class
  2. Access is limited to the current assembly
  3. Access is limited to the containing class plus any classes derived from the containing class that are also in the current assembly
  4. Access is limited to the containing class plus any classes derived from the containing class or any other class in the current assembly
45. Which of the following operations can NOT be performed inside a catch block?
Answers:
  1. Prevention of the caught exception from leaving the catch block
  2. Allowing the original exception to propagate after it has been caught, with all of the information (including context) intact
  3. Wrapping the caught exception inside a newly created exception of a different type
  4. Generating a new exception with no information about the original exception
  5. Altering the Message , TargetSite and/or StackTrace, of the existing exception before re-throwing
46. Which of the following is not a standard service behavior supported by the System.ServiceProcess.ServiceController class members?
Answers:
  1. Start
  2. Continue
  3. Pause
  4. Restart
47. In which of the following ways do structs differ from classes?
Answers:
  1. Structs can not implement interfaces
  2. Structs cannot inherit from a base struct
  3. Structs cannot have events interfaces
  4. Structs cannot have virtual methods
48. Which of the following are true about enums?
Answers:
  1. Enums are always equated to an integral constant value
  2. A variable of the enum type will always contain one of the declared symbolic constants
  3. The declared values of an enum are always assigned sequential starting with 0
  4. The declared values of an enum must be mapped (explicitly or implicitly) to unique integral values
49. Which of the following are characteristics of the System.Threading.Timer class?
Answers:
  1. The method provided by the TimerCallback delegate will always be invoked on the thread which created the timer.
  2. The thread which creates the timer must have a message processing loop (i.e. be considered a UI thread)
  3. The class contains protection to prevent reentrancy to the method provided by the TimerCallback delegate
  4. You can receive notification of an instance being Disposed by calling an overload of the Dispose method.
50. Custom non-fatal exceptions should be derived from:
Answers:
  1. ApplicationException
  2. DataMisalignedException
  3. ExecutionEngineException
  4. SystemException
51. Which of the following are defined as a “token”?
Answers:
  1. Identifier
  2. Whitespace
  3. Punctuator
  4. Operator
  5. All of the above
52. Of which elements does Generics allow parameterization by type?
Answers:
  1. Classes
  2. Structs
  3. Methods
  4. Fields
53. To which of the following can System.IO.IsolatedStorage not be scoped?
Answers:
  1. Restricted to a Specific Application
  2. Restricted to a Specific AppDomain
  3. Restricted to a Specific User
  4. Restricted to a specific Physical Media
54. When using the Demand method of System.Security.IPermission, which of the following will occur?
Answers:
  1. The permissions of the code which invoked the Demand method will be evaluated.
  2. For permissions which do a stack walk, an exception will occur only if NONE of the calling codes has the required permission
  3. For permissions which do a stack walk, an exception will occur if ANY of the calling codes does not have the required permission
  4. The permission levels of individual stack frames are always checked regardless of the permission type.
55. Which of the following are true about event handling?
Answers:
  1. One method may handle events from different sources
  2. A single event can be handled by multiple methods
  3. Event handlers can be dynamically added and removed at runtime
  4. All of the above
56. Which of the following conditions are true regarding System.Diagnostics.Trace?
Answers:
  1. Trace is enabled for both Release and Debug initial configurations
  2. Trace can be controlled both by preprocessor directives, and compiler directives
  3. To change the severity levels which generate output, you must recompile your program
  4. All of the Above
57. Parameterized Properties in C# are__________.
Answers:
  1. not supported except for implementing an indexer.
  2. properties which take one or more parameters (e.g. to retrieve one element from a member collection)
  3. properies which use one or more attributes to control their behavior
  4. properties which can be passed as Method Parameters so they can be invoked by the called method.
58. Which System.Runtime.Remoting class is used store all relevant information required to generate a proxy in order to communicate with a remote object?
Answers:
  1. ObjRef
  2. MarshalByRefObject
  3. ObjectHandle
  4. RemotingServices
59. Determining the availability of sufficient memory for an operation can be accomplished by?
Answers:
  1. There is no supported application level means to determine if a specific amount of memory is available.
  2. using static methods of System.Runtime.MemoryFailPoint and checking the return value
  3. creating an instance of System.Runtime.MemoryFailPoint and monitoring for an InsufficientMemoryException
  4. creating an instance of System.Runtime.MemoryFailPoint and monitoring for an OutOfMemoryException
60. Which of the following is not an application entry point?
Answers:
  1. public static void Main() {}
  2. public static int Main() {}
  3. public static int Main(string[] args) {}
  4. public static int Main(string cmdline) {}
  5. private static int Main(string[] args) {}
61. What will be the output generated by the following code?
string t = “This Is a Test”;
t.Replace(“T”, “?”);
Console.WriteLine(t);
Answers:
  1. ?his Is a ?est
  2. ?his Is a ?es?
  3. This Is a Test
  4. ?his Is a Test
62. Which of the following does NOT apply to XCOPY deployment?
Answers:
  1. The appropriate version of the .NET framework must be installed.
  2. All application components must be in the application directory, or a subdirectory.
  3. Shared components can be installed as part of the XCOPY.
  4. XCOPY deployment to a non-empty target directory may have unintended side-effects
63. Which of the following are true about operator precedence?
Answers:
  1. The Conditional Operator (?:) has the lowest precedence.
  2. All binary operators are left-associative, and evaluate from left to right.
  3. The Assignment and Conditional Operators are right-associative.
  4. The Conditional And (&&) and Or (||) operators have higher precedence than the Logical And (&) and Or (|) operators.
64. Which of the following encodings are NOT supported by classes in the System.Text namespace?
Answers:
  1. ASCII
  2. Unicode
  3. UTF-7
  4. UTF-8
  5. EBCDIC
65. Which of the following can Interfaces contain?
Answers:
  1. Methods
  2. Properties
  3. Fields
  4. Conversion operators
  5. Events
66. Which of the following is a primary characteristic of System.Xml.XmlDataDocument?
Answers:
  1. It provides synchronized operations viewing the content either as an XmlDocument or as a DataSet
  2. It provides the basic abilities for XMLDocument instances to be created from or exported to DataSets
  3. It provides a limited set of capabilities compared to the System.Xml.XmlDocument class
  4. It provides the basic abilities to allow DataSets to be loaded from or exported to XML files.

No comments:

Post a Comment

Blog Archive