C# Programming Advanced Quiz 1
Select your answers and check your results. Use Reset to start again.
Search
Practice Pronunciation (Merriam-Webster)
Navigation
Python Programming Beginner Quizzes
Quiz 1,
Quiz 2,
Quiz 3,
Quiz 4,
Quiz 5
Python Programming Intermediate Quizzes
Quiz 1,
Quiz 2,
Quiz 3,
Quiz 4,
Quiz 5
Python Programming Advanced Quizzes
Quiz 1,
Quiz 2,
Quiz 3,
Quiz 4,
Quiz 5
SQL Programming Beginner Quizzes
Quiz 1,
Quiz 2,
Quiz 3,
Quiz 4,
Quiz 5
SQL Programming Intermediate Quizzes
Quiz 1,
Quiz 2,
Quiz 3,
Quiz 4,
Quiz 5
SQL Programming Advanced Quizzes
Quiz 1,
Quiz 2,
Quiz 3,
Quiz 4,
Quiz 5
JavaScript Programming Beginner Quizzes
Quiz 1,
Quiz 2,
Quiz 3,
Quiz 4,
Quiz 5
JavaScript Programming Intermediate Quizzes
Quiz 1,
Quiz 2,
Quiz 3,
Quiz 4,
Quiz 5
JavaScript Programming Advanced Quizzes
Quiz 1,
Quiz 2,
Quiz 3,
Quiz 4,
Quiz 5
C# Programming Beginner Quizzes
Quiz 1,
Quiz 2,
Quiz 3,
Quiz 4,
Quiz 5
C# Programming Intermediate Quizzes
Quiz 1,
Quiz 2,
Quiz 3,
Quiz 4,
Quiz 5
C# Programming Advanced Quizzes
Quiz 1,
Quiz 2,
Quiz 3,
Quiz 4,
Quiz 5
Java Programming Beginner Quizzes
Quiz 1,
Quiz 2,
Quiz 3,
Quiz 4,
Quiz 5
Java Programming Intermediate Quizzes
Quiz 1,
Quiz 2,
Quiz 3,
Quiz 4,
Quiz 5
Java Programming Advanced Quizzes
Quiz 1,
Quiz 2,
Quiz 3,
Quiz 4,
Quiz 5
C Programming Beginner Quizzes
Quiz 1,
Quiz 2,
Quiz 3,
Quiz 4,
Quiz 5
C Programming Intermediate Quizzes
Quiz 1,
Quiz 2,
Quiz 3,
Quiz 4,
Quiz 5
C Programming Advanced Quizzes
Quiz 1,
Quiz 2,
Quiz 3,
Quiz 4,
Quiz 5
Advanced Quiz 1
1. What is the primary purpose of the
volatile
keyword in C#?
To prevent compiler optimizations on a field that might be modified by multiple threads.
To declare a variable that cannot be modified.
To ensure a variable is stored in a specific memory location.
2. Explain the difference between
List<T>
and
ArrayList
in C#.
List<T>
is generic and type-safe;
ArrayList
stores objects as type
object
and is not type-safe.
ArrayList
is faster for all types.
List<T>
can only store value types.
3. What is a "memory leak" in C# and how can it be avoided?
Memory that is no longer used but not released, often due to event handler references or static collections. Avoid by unsubscribing events and releasing references.
A pointer that has not been initialized.
A value type variable that is not assigned.
4. Describe the main memory segments for a typical C# application.
Managed heap (objects), stack (local variables), code segment (IL and JITted code), and static data segment.
Only heap and stack.
Includes registers and cache memory only.
5. What is the significance of
readonly
vs
const
fields in C#?
readonly
can be assigned at declaration or in the constructor;
const
is compile-time constant and must be assigned at declaration.
They are interchangeable; no functional difference.
readonly
is for static fields only.
6. How does the
static
keyword behave for class members in C#?
Static members belong to the type itself, not to any instance.
Static members are accessible only inside methods.
Static makes a member constant.
7. What is the role of the
extern
keyword in C#?
To declare a method that is implemented externally, often in unmanaged code (P/Invoke).
To make a variable accessible only within the current file.
To specify that a variable should be stored in external memory.
8. Explain a "delegate" in C# and provide a simple use case.
A type that references methods with a particular parameter list and return type, used for callbacks and event handling.
A function that returns a pointer as its result.
A pointer to the first argument of a function.
9. What are "value types" and "reference types" in C#? Give an example of each.
Value types (e.g.,
int
,
struct
) store data directly; reference types (e.g.,
class
,
string
) store references to data.
Value types are only for numbers; reference types are only for strings.
Value types are always nullable.
10. Describe the concept of "boxing" and "unboxing" in C#.
Boxing converts a value type to
object
; unboxing extracts the value type from the
object
.
Boxing is converting a reference type to a value type.
Unboxing is converting a string to an integer.
Previous
Check Quiz
Reset
Next
Other
Timer
00:00
Start
Stop
Reset
Vocabulary Quiz
Score: 0
Reset Score
Submit Answer
Next Word
Spin the Wheel
SPIN
Promo's
Explore More
C# Documentation
C# Tutorials