Top Frequently Interview Quiz Quiz

Test your knowledge with this quiz on the most commonly asked C# .NET interview questions. Perfect for candidates preparing for technical interviews, it covers key concepts and commonly encountered scenarios in C# and .NET.

  1. Understanding Value and Reference Types

    In C#, which type is considered a value type and stored on the stack?

    1. object
    2. int
    3. string
    4. Array
  2. Boxing and Unboxing

    What is the process called when a value type is converted to a reference type in C#?

    1. Boxing
    2. Casting
    3. Parsing
    4. Unboxing
  3. Difference Between Dispose and Finalize

    In .NET, which method is used to explicitly release unmanaged resources from memory?

    1. Clear
    2. Destructor
    3. Finalize
    4. Dispose
  4. Understanding Delegates with Examples

    Which C# feature allows you to pass methods as parameters using a simple 'delegate void Print(string message);' declaration?

    1. Event
    2. Interface
    3. Delegate
    4. Abstract class
  5. Sealed Classes in C#

    What is the effect of declaring a class as 'sealed' in C#?

    1. Prevents instantiation
    2. Prevents inheritance
    3. Allows partial methods
    4. Enables reflection
  6. Difference Between 'ref' and 'out'

    Which keyword allows a method to return multiple values to a caller through parameters that must be initialized before calling the method?

    1. out
    2. in
    3. ref
    4. var
  7. Use of 'using' Statement

    What is the primary purpose of using the 'using' statement in C# for objects such as StreamReader?

    1. Imports namespaces
    2. Casts types
    3. Initializes variables
    4. Automatically disposes resources
  8. Implementing Interfaces

    If a class implements an interface with the method 'void Calculate();', what must the class do?

    1. Inherit from another class
    2. Use an override modifier
    3. Provide a definition for Calculate
    4. Declare Calculate as static
  9. Access Modifiers

    Which access modifier in C# makes a member accessible only within its own class?

    1. public
    2. protected
    3. internal
    4. private
  10. Properties in C#

    What is a key feature of C# properties compared to fields?

    1. Properties use getters and setters
    2. Properties require public access
    3. Properties cannot hold values
    4. Properties must be static