C# Programming Proficiency Test Quiz

  1. Data Type Declaration

    Which keyword is used to declare a variable that can store whole numbers without decimal points?

    1. Float
    2. String
    3. Int
    4. Bool
  2. Conditional Statement

    Which of the following control flow statements allows for multiple branches based on the value of a variable?

    1. If statement
    2. For loop
    3. Switch statement
    4. While loop
  3. Method Parameter

    What is the purpose of the 'out' keyword when used with method parameters?

    1. It specifies that the parameter is optional.
    2. It passes the parameter by reference, and the method must assign a value to it.
    3. It passes the parameter by value.
    4. It makes the parameter read-only.
  4. Object-Oriented Principle

    Which object-oriented programming principle involves creating new classes from existing classes, inheriting their properties and behaviors?

    1. Encapsulation
    2. Abstraction
    3. Inheritance
    4. Polymorphism
  5. Interface Implementation

    What keyword is used to indicate that a class implements an interface?

    1. Extends
    2. Implements
    3. Derives
    4. Contracts
  6. Exception Handling

    Which block of code is used to handle exceptions that might occur within a try block?

    1. Finally
    2. Catch
    3. Ensure
    4. Except
  7. LINQ Query

    Which LINQ method is used to filter a sequence of elements based on a predicate?

    1. Sort
    2. Select
    3. Where
    4. Group
  8. File I/O Operation

    Which class is commonly used for reading text from a file in C#?

    1. FileStream
    2. BinaryReader
    3. TextWriter
    4. StreamReader
  9. Collection Type

    Which collection type stores key-value pairs where each key is unique?

    1. List
    2. Array
    3. Dictionary
    4. HashSet
  10. Asynchronous Operation

    Which keyword is used to mark a method as asynchronous, allowing it to be awaited?

    1. Sync
    2. Await
    3. Async
    4. Thread