C# Skills Test

28 Questions

Settings
Please wait...
C Sharp Quizzes & Trivia

Basic C# skills test to determine level of C# proficiency.


Questions and Answers
  • 1. 
    Does C# support multiple inheritance?
    • A. 

      Yes

    • B. 

      No

  • 2. 
    What is the top .NET class that everything is derived from?
    • A. 

      Object

    • B. 

      System.Net

    • C. 

      System.Object

    • D. 

      System

    • E. 

      System.Root

  • 3. 
    Which .NET collection class allows elements to be accessed using a unique key?
    • A. 

      ListDictionary

    • B. 

      Stack

    • C. 

      Hashtable

    • D. 

      ArrayList

    • E. 

      StringCollection

  • 4. 
    Will the finally block get executed if an exception has not occurred?
    • A. 

      Yes

    • B. 

      No

  • 5. 
    Can multiple catch blocks be executed for a single try statement?
    • A. 

      Yes

    • B. 

      No

  • 6. 
    You can prevent a class from being inherited by another class by using which keyword?
  • 7. 
    When do you absolutely have to declare a class as abstract?  There are two correct answers.
  • 8. 
    Does .NET support the ability to inherit multiple interfaces?
    • A. 

      Yes

    • B. 

      No

  • 9. 
    What's the different between an interface and an abstract class?
  • 10. 
    What does the keyword "virtual" declare for a method or a property?
  • 11. 
    What is the difference between method overriding and method overloading?
  • 12. 
    What is a delegate, and what is a multicast delegate?
  • 13. 
    Which of these words are part of the "ACID" rule of thumb for database transactions?  Select all that apply.
    • A. 

      Isolated

    • B. 

      Connected

    • C. 

      Durable

    • D. 

      Atomic

    • E. 

      Integrity

  • 14. 
    In a ADO connection string, what does the "Initial Catalog" parameter define?
  • 15. 
    What is the difference between a delegate and an event?
  • 16. 
    What is a partial class, and what are its advantages?
  • 17. 
    What is the difference between a shallow copy and a deep copy?  Be as detailed as necessary.
  • 18. 
    The C# keyword "int" maps to which .NET type?
    • A. 

      System.Int16

    • B. 

      System.Int32

    • C. 

      System.Int64

    • D. 

      System.Int128

  • 19. 
    Which of these statements correctly declares a two-dimensional integer array in C#?
    • A. 

      Int[,] myArray;

    • B. 

      Int[][] myArray;

    • C. 

      Int[2] myArray

    • D. 

      System.Array[2] myArray;

    • E. 

      System.Array[,] myArray;

  • 20. 
    If a method is marked as protected internal, who can access it?
    • A. 

      Classes that are both in the same assembly and derived from the declaring class.

    • B. 

      Only methods that are in the same class as the method in question.

    • C. 

      Internal methods can only be called using reflection.

    • D. 

      Classes within the same assembly, and classes derived from the declaring class.

  • 21. 
    What is boxing?
    • A. 

      Encapsulating an object in a value type

    • B. 

      Encapsulating a copy of a value type in an object

    • C. 

      Encapsulating a copy of an object in a value type

    • D. 

      Encapsulating a value type in an object

  • 22. 
    Which compiler switch creates an xml file from the xml comments in the files in an assembly?
    • A. 

      /text

    • B. 

      /doc

    • C. 

      /xml

    • D. 

      /help

    • E. 

      /xmlhelp

  • 23. 
    Which common design pattern is shown below?public class A {    private A instance;    private A() { }    public static A Instance     {      get      {        if(instance == null)          instance = new A();        return instance;      }    }}
    • A. 

      Factory

    • B. 

      Abstract Factory

    • C. 

      Singleton

    • D. 

      Builder

  • 24. 
    Which of the following operations can you NOT perform on an ADO.NET DataSet?
    • A. 

      A DataSet can be synchronized with the database

    • B. 

      A DataSet can be synchronized with a RecordSet

    • C. 

      A DataSet can be converted to XML

    • D. 

      You can infer the schema from a DataSet

  • 25. 
    In Object Oriented Programming, which answer best describes encapsulation?
    • A. 

      The conversion of one type of object to another

    • B. 

      The runtime resolution of method calls

    • C. 

      The exposition of data

    • D. 

      The separation of interface and implementation

  • 26. 
    What is the wildcard character in a SQL query?  
  • 27. 
    Can you change the value of a variable while debugging a C# application?
    • A. 

      Yes

    • B. 

      No

  • 28. 
    What is the difference between the Debug class and the Trace class?