Question 1
Which component in C# primarily handles memory management?
Operating System
Common Language Runtime (CLR)
Programmer manually
Memory Manager Class
Question 2
Which type of memory stores value types, local variables, and method call details?
Heap
Stack
Global Memory
Register Memory
Question 4
Which of the following is a characteristic of the heap?
Automatic allocation in LIFO order
Access is very fast
Managed by Garbage Collector
Stores method call details
Question 5
When does an object become eligible for garbage collection?
When it is created
When no variable holds a reference to it
Immediately after a method ends
Only when GC.Collect() is called
Question 6
Which generation contains newly allocated objects in C# Garbage Collection?
Generation 2
Generation 1
Generation 0
All generations
Question 7
Which GC method forces collection of all generations?
GC.GetTotalMemory()
GC.MaxGeneration
GC.Collect()
GC.WaitForPendingFinalizers()
Question 8
The IDisposable interface is used to:
Manage stack memory
Release unmanaged resources deterministically
Force garbage collection
Track object generations
Question 9
What is the advantage of using the using statement with IDisposable objects?
It makes objects live longer
It automatically calls Dispose() even on exceptions
It disables GC
It stores objects on the stack
Question 10
Which statement is correct regarding Destructor (~ClassName) vs IDisposable.Dispose()?
Destructor is deterministic, Dispose is non-deterministic
Destructor is called by programmer, Dispose by GC
Destructor is non-deterministic, Dispose is deterministic
Both run at exact same time
There are 10 questions to complete.