.Net Proficiency Quiz

43 Questions | Attempts: 153
Share

SettingsSettingsSettings
DotNET Quizzes & Trivia

Tests the applicants proficiency on general software development concepts and specific. Net and sql server concepts.

Breakdown is as follows:

0 - 30 General Programming Proficiency
30 - 39 Object Orientation
40 - 43. NET


Questions and Answers
  • 1. 

    In C#, which of the following are reserved words?

    • A.

      Class

    • B.

      Interface

    • C.

      Namespace

    • D.

      Catch

    • E.

      Void

    Correct Answer(s)
    A. Class
    B. Interface
    C. Namespace
    D. Catch
    E. Void
    Explanation
    All of the above are reserved words

    Rate this question:

  • 2. 

    In C#, which is NOT a reserved word?

    • A.

      Break

    • B.

      Else

    • C.

      Implements

    • D.

      Public

    • E.

      Sizeof

    Correct Answer
    C. Implements
    Explanation
    implements is used in java, not C#

    Rate this question:

  • 3. 

    In C#, which of the below variable declarations are invalid?

    • A.

      Private int x = 0;

    • B.

      Private int @virtual = 0;

    • C.

      Private ushort x = 0;

    • D.

      Private double x = 0;

    • E.

      All declarations are valid

    Correct Answer
    E. All declarations are valid
    Explanation
    All declarations are valid. The @virtual overrides the reserved keyword limitations.

    Rate this question:

  • 4. 

    Which of the following code snippets are valid?

    • A.

      System.Console.WriteLine("C#"); // call WriteLine()

    • B.

      //System.Console.WriteLine("C#");

    • C.

      /*System.Console.WriteLine("C#");*/

    • D.

      All are correct

    Correct Answer
    D. All are correct
    Explanation
    All are correct.

    Rate this question:

  • 5. 

    A                               is a placeholder for a value that you work with in your code and is linked to a value stored in the system's memory.

    Correct Answer
    variable
    Variable
    Explanation
    variable

    Rate this question:

  • 6. 

    Which of the following statements is false?

    • A.

      The first character in an identifier may start with an uppercase letter

    • B.

      The first character in an identifier may start with an lowercaseletter

    • C.

      The first character in an identifier may start with an underscore

    • D.

      The first character in an identifier may start with a number

    Correct Answer
    D. The first character in an identifier may start with a number
    Explanation
    an identifier may not start with a number

    Rate this question:

  • 7. 

    Which is the odd one out?

    • A.

      Int

    • B.

      Long

    • C.

      Float

    • D.

      Uint

    Correct Answer
    B. Long
    Explanation
    long is 64bit in size, the others are 32bit

    Rate this question:

  • 8. 

    TRUE/FALSE. The value of an unsigned integer may be a positive or a negative number.

    • A.

      TRUE

    • B.

      FALSE

    Correct Answer
    B. FALSE
    Explanation
    unsigned may only be positive

    Rate this question:

  • 9. 

    What is the size of a decimal type?

    • A.

      16bit

    • B.

      32bit

    • C.

      64bit

    • D.

      128bit

    • E.

      256bit

    Correct Answer
    D. 128bit
  • 10. 

    A                         number consists of a mantissa with several significant digits and an exponent which is a power of 10

    • A.

      Wide

    • B.

      Double point

    • C.

      Floating point

    • D.

      Absolute

    Correct Answer
    C. Floating point
  • 11. 

    What is the size in bytes of the contents of "scores" in the following example:int [] scores;scores = new int[25];

    • A.

      25

    • B.

      100

    • C.

      200

    • D.

      250

    Correct Answer
    B. 100
    Explanation
    An int is 4 bytes therefore 100.

    Rate this question:

  • 12. 

    Which exception shall be thrown by the following code snippt:int [] scores;scores = new int[25];scores[26]=0;

    • A.

      System.ClassNotFoundException

    • B.

      System.IndexOutOfRangeException

    • C.

      System.UnknownPositionException

    • D.

      An exception shall not by thrown

    Correct Answer
    B. System.IndexOutOfRangeException
  • 13. 

    What is the printed result of the following code snippet?int [,] MyArray = {{0, 1,}, {2, 3}};System.Console.WriteLine(""+MyArray[1,1]);

    • A.

      0

    • B.

      1

    • C.

      2

    • D.

      3

    • E.

      The code in invalid and will not compile

    Correct Answer
    D. 3
  • 14. 

    Value types hold data. Reference types hold references to data placed elsewhere in memory. Which of the following are reference types?

    • A.

      Int intVariable;

    • B.

      Long longVariable;

    • C.

      String stringVariable;

    • D.

      Double doubleVariable;

    • E.

      Double[] ArrayOfDoubles;

    Correct Answer(s)
    C. String stringVariable;
    E. Double[] ArrayOfDoubles;
  • 15. 

    In C#, which of the following are allowed implicit conversions?

    • A.

      Int to long

    • B.

      Float to double

    • C.

      Byte to long

    • D.

      Int to short

    • E.

      Ulong to decimal

    Correct Answer(s)
    A. Int to long
    B. Float to double
    C. Byte to long
    E. Ulong to decimal
  • 16. 

    The following code snippet is best described as an example of?char CharacterVariable;int IntegerVariable;IntegerVariable = 9;CharacterVariable = (char)IntegerVariable;

    • A.

      Implicit conversion

    • B.

      Casting

    • C.

      Forced conversion

    • D.

      Labelling

    Correct Answer
    B. Casting
  • 17. 

    What is the resulting value of 'x' in the code snippet below:public enum Pizza{Supreme,MeatLovers,CheeseLovers,Vegetable,}int x = (int)Pizza.Vegetable;

    • A.

      Null

    • B.

      0

    • C.

      3

    • D.

      4

    • E.

      The code is invalid as you cannot convert an enum to an integer

    Correct Answer
    C. 3
  • 18. 

    What is the resulting value of 'x' in the code snippet below:int x = 100;++x;x--;x+=100;

    Correct Answer
    200
  • 19. 

    What is the resulting value of 'x' in the code snippet below:int x = 1;x = x << 2;

    Correct Answer
    4
  • 20. 

    What is the resulting value of 'x' in the code snippet below:int x = 10;x/=2;

    Correct Answer
    5
  • 21. 

    What is the resulting value of 'x' in the code snippet below:int x = 7;x = x % 3;

    Correct Answer
    1
  • 22. 

    What is the resulting value of 'x' in the code snippet below:int x = 100;x = (x == 123) ? 3 : 5;

    Correct Answer
    5
  • 23. 

    Considering the order of precedence in C#, what is the resulting value of 'x' in the code snippet below:int x = 3 * 2 + 1;

    Correct Answer
    7
  • 24. 

    What is the output of the following code snippet?int x = 10;int y = 9;int z = 0;if ( (x == 10 && y == 9) || (z = 1)==0 ) System.Console.WriteLine("expression is true, z = " + z);else System.Console.WriteLine("expression is false, z = " + z);

    • A.

      Expression is true, z = 0

    • B.

      Expression is true, z = 1

    • C.

      Expression is false, z = 0

    • D.

      Expression is false, z = 1

    Correct Answer
    A. Expression is true, z = 0
    Explanation
    true or false is true therefore the second boolean operator is not evaluated and z remains 0

    Rate this question:

  • 25. 

    What is the output of the following code snippet?int x = 10;int y = 9;int z = 0;if ( (x == 10 && y == 9) | (z = 1)==0 ) System.Console.WriteLine("expression is true, z = " + z);else System.Console.WriteLine("expression is false, z = " + z);

    • A.

      Expression is true, z = 0

    • B.

      Expression is true, z = 1

    • C.

      Expression is false, z = 0

    • D.

      Expression is false, z = 1

    Correct Answer
    B. Expression is true, z = 1
    Explanation
    true or false is true, however the short circuit | forces z to be set to 1

    Rate this question:

  • 26. 

    What is the output of the following code snippet? int x = 0; while (x < 10)  {   System.Console.Write(""+x+",");        if (x == 5)         break;        x++; }

    • A.

      0,1,2,3,4,5,6,7,8,9,10,

    • B.

      0,1,2,3,4,

    • C.

      0,1,2,3,4,5,

    • D.

      The snippet results in an infinite loop

    Correct Answer
    C. 0,1,2,3,4,5,
  • 27. 

    What is the output of the following code snippet? int x = 0; while (x < 10)  {   System.Console.Write(""+x+",");        if (x == 5)         continue;        x++; }

    • A.

      0,1,2,3,4,5,6,7,8,9,10,

    • B.

      0,1,2,3,4,

    • C.

      0,1,2,3,4,5,

    • D.

      The snippet results in an infinite loop

    Correct Answer
    D. The snippet results in an infinite loop
  • 28. 

    The static 'main' method of a C# application is generally known as:

    • A.

      The start point of the application

    • B.

      The launch point of the application

    • C.

      The primary point of the application

    • D.

      The entry point of the application

    Correct Answer
    D. The entry point of the application
  • 29. 

    Complete the swap method declaration so that the values of parameters x and y are swappedstatic void swap(...){ Int32 tmp = x;        x = y;        y = tmp;}

    • A.

      Static void swap(ref Int32 x, ref Int32 y)

    • B.

      Static void swap(Int32 x, Int32 y)

    • C.

      Static void swap(out Int32 x, out Int32 y)

    • D.

      None of the above

    Correct Answer
    A. Static void swap(ref Int32 x, ref Int32 y)
  • 30. 

                     data types are data types that you define in your own code.                   data types are not built into the C# language, unlike primitive data types. You can use                    types in your code just as you use primitive data types, but only after you define the                 data type in your code.

    • A.

      Object

    • B.

      Super

    • C.

      Abstract

    • D.

      Parent

    Correct Answer
    C. Abstract
  • 31. 

                        is the act of designing classes that provide a full set of functionality to yourclass's data without exposing the data directly.

    Correct Answer
    encapsulation
    Encapsulation
  • 32. 

                          enables you to define one class in terms of another. Derived classes inherit from the base class.

    Correct Answer
    Inheritance
    Inheritence
    inheritance
    inheritence
  • 33. 

                            enables you to treat a collection of classes derived from a single base class in a uniform way. You retrieve the derived classes as a base class, and C# automatically calls the correct method in the derived class.

    Correct Answer
    Polymorphism
    polymorphism
  • 34. 

    In the class below, what is the term used for method 3:class Point{ public int X; public int Y; public Point() //Method 1 { X = 0; Y = 0; } public Point(int InitialX, int InitialY) //Method 2 { X = InitialX; Y = InitialY; } ~Point() //Method 3 { X = 0; Y = 0; }}

    • A.

      The default constructor

    • B.

      The overloaded constructor

    • C.

      The class constructor

    • D.

      The terminator

    • E.

      The destructor

    Correct Answer
    E. The destructor
  • 35. 

    Placing the                  modifier before a field definition indicates that all objects of the same class will be sharing the same value.

    Correct Answer
    static
  • 36. 

    What best describes the function of the 'sealed' keyword when included in the class declaration?

    • A.

      Makes the properties of the class read only

    • B.

      Prevents code from deriving from the class

    • C.

      Prevents additional methods from being added to the class

    • D.

      Forces the methods of the class to be overridden

    Correct Answer
    B. Prevents code from deriving from the class
  • 37. 

    An object can perform work and notify the caller when something happens during the process. This 'something' is known as

    • A.

      A delegate

    • B.

      An occurance

    • C.

      An event

    • D.

      A flag

    Correct Answer
    C. An event
  • 38. 

    The functions of the lock keyword or the Monitor class in .NET are primarily used for

    • A.

      Thread synchronization by allowing for exclusive access on data targets

    • B.

      Thread synchronization by granting each thread a time slice for execution

    • C.

      Thread synchronization by allowing the thread to execute outside of the process

    Correct Answer
    A. Thread synchronization by allowing for exclusive access on data targets
  • 39. 

                              enables code to examine other pieces of code to derive informationsuch as the methods and properties it supports and the base class it is derived from.

    Correct Answer
    Reflection
    reflection
  • 40. 

    Which of the following are the advantages of the Common Language Runtime in .NET?

    • A.

      Unify all runtime engines so that all developers can work with a single set of runtime services

    • B.

      Allows languages to interoperate with each other

    • C.

      Makes coding easier

    Correct Answer(s)
    A. Unify all runtime engines so that all developers can work with a single set of runtime services
    B. Allows languages to interoperate with each other
  • 41. 

    The order of the C# compilation process goes:

    • A.

      Native code, C# Source, C# Compiler, MSIL Compiler, MSIL Source

    • B.

      C# Source, C# Compiler, MSIL Compiler, MSIL Source, Native Code

    • C.

      C# Compiler, C# Source, MSIL Source, MSIL Compiler, Native Code

    • D.

      C# Source, C# Compiler, MSIL Source, MSIL Compiler, Native Code

    • E.

      None are correct

    Correct Answer
    D. C# Source, C# Compiler, MSIL Source, MSIL Compiler, Native Code
  • 42. 

    Which of the following are the benefits of a JIT Compiler?

    • A.

      Utilize and allocate CPU registers more efficiently

    • B.

      Take advantage of the exact processor model in use by emitting instructions specifically for it

    • C.

      Utilize memory more efficiently by monitoring the current demand for physical and virtual memory during execution

    • D.

      Shorter startup times

    Correct Answer(s)
    A. Utilize and allocate CPU registers more efficiently
    B. Take advantage of the exact processor model in use by emitting instructions specifically for it
    C. Utilize memory more efficiently by monitoring the current demand for physical and virtual memory during execution
    Explanation
    slower startup times as code needs to be compiled before launch

    Rate this question:

  • 43. 

    In order to avoid DLL Hell, the .NET framework makes use of something called the

    • A.

      DLL Versioning Cache

    • B.

      .NET Library Cache

    • C.

      Global Assembly Cache

    • D.

      PojoCache

    • E.

      None of the above

    Correct Answer
    C. Global Assembly Cache

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Jul 30, 2011
    Quiz Edited by
    ProProfs Editorial Team
  • Oct 23, 2009
    Quiz Created by
    Matthewrennie

Related Topics

Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.