C# .NET quiz questions

C# .NET interview questions

  • 1.

    How to bind more than one models to view in MVC framework?

    1. Set each of them as a property of a master model

    2. Bind via array

    3. Both of them

    Answer
  • 2.

    Which of the following is true for dynamic type in C#?

    1. It allows multiple time declaration of a variable.

    2. It allows compile time type checking

    3. It escapes compile time type checking

    4. None of the above.

    Answer
  • 3.

    Data type of a variable declared using var will be assigned at _______.

    1. Runtime

    2. Compile time

    3. CLR time

    4. Application Initialization time.

    Answer
  • 4.

    LINQ stands for ________.

    1. Language Integrated Query

    2. Local Integration Query

    3. Language Included Query

    4. Lazy Integrated Query

    Answer
  • 5.

    A partial class allows ________

    1. Implementation of single class in multiple .cs files.

    2. Declaration of multiple classes in a single .cs file.

    3. Implementation of multiple interfaces to single class.

    4. Multiple class inheritance.

    Answer
  • 6.

    Return type of Predicate <T>() is always a ______.

    1. Integer

    2. String

    3. Boolean

    4. Void

    Answer
  • 7.

    Func and Action are the types of ______.

    1. Utility function

    2. Delegate

    3. Event

    4. Generic class

    Answer
  • 8.

    Which of the following statement is true?

    1. A finally block may not execute every time

    2. A finally block cannot include return or break keyword.

    3. A finally block can come before catch block.

    4. Multiple finally block is possible.

    Answer
  • 9.

    Which of the following statement is true?

    1. try block must be followed by catch and finally block both.

    2. try block must be followed by catch or finally block or both.

    3. try block cannot include another try block.

    4. All of the above.

    Answer
  • 10.

    Which of the following is true for ReadOnly variables?

    1. Value will be assigned at runtime.

    2. Value will be assigned at compile time.

    3. Value will be assigned when it accessed first time

    4. None of the above

    Answer
  • 11.

    Which of the following is right way of declaring an array?

    1. Int[] intArray = new int[];

    2. Int intArray[] = new int[5];

    3. Int[] intArray = new int[5];

    4. Int[] intArray = new int[]{1, 2, 3, 4, 5};

    Answer
  • 12.

    An array in C# starts with _____ index.

    1. One

    2. Zero

    3. -1

    4. None of the above

    Answer
  • 13.

    String data type is ______.

    1. Mutable

    2. Immutable

    3. Static

    4. Value type

    Answer
  • 14.

    What is indexer?

    1. It allows an instance of a class to be indexed like an array

    2. It allows enumerator with class

    3. It creates index for instances of a class.

    4. None of the above.

    Answer
  • 15.

    Which of the following datatype can be used with enum?

    1. Int

    2. String

    3. Boolean

    4. All of the above

    Answer
  • 16.

    10 > 9 ? “10 is greater than 9” : “9 is greater than 10” is an example of _______

    1. Ternary operator

    2. Conditional operator

    3. Greater than operator

    4. Inverse operator

    Answer
  • 17.

    Struct is a _____.

    1. Reference type

    2. Value type

    3. Class type

    4. String type

    Answer
  • 18.

    What is Nullable type?

    1. It allows assignment of null to reference type.

    2. It allows assignment of null to value type.

    3. It allows assignment of null to static class.

    4. None of the above.

    Answer
  • 19.

    Which of the following is a reference type in C#?

    1. String

    2. Long

    3. Boolean

    4. None of the above

    Answer
  • 20.

    Which of the followings are value types in C#?

    1. Int32

    2. Double

    3. Decimal

    4. All of the above

    Answer

© 2017 QuizBucket.org