iGET

C# Programming - MCQ Practice Questions

C# (.NET) MCQs — OOP, collections, LINQ & exception handling.

290 questions | 100% Free

Q.61Easy

Which collection allows duplicate keys in C#?

Q.62Easy

What does the Count property of a collection return in C#?

Q.63Easy

Which collection in C# implements LIFO (Last In First Out) principle?

Q.64Easy

What will be the output of the following code? List<int> nums = new List<int> {1, 2, 3}; nums.Add(4); Console.WriteLine(nums.Count);

Q.65Easy

Which collection in C# maintains insertion order and allows duplicate elements?

Q.66Easy

Which collection throws an exception when you try to dequeue from an empty Queue<T>?

Q.67Easy

What is the time complexity of accessing an element by index in List<T>?

Q.68Easy

Which method in Stack<T> returns the top element without removing it?

Q.69Easy

Which IEnumerable method should be used to filter elements based on a condition and maintain type safety?

Q.70Easy

In a HashSet<T>, what happens when you try to add a duplicate element?

Q.71Easy

Which LINQ method should you use to transform each element of a collection into a new form?

Q.72Easy

Which method in Queue<T> allows you to examine the front element without removing it?

Q.73Easy

Which collection type uses a hash table internally and provides O(1) average lookup?

Q.74Easy

What does the Add() method return when adding a duplicate element to a HashSet<T>?

Q.75Easy

What is the space complexity of a HashSet<T> with n elements?

Q.76Easy

What does the Peek() method do in a Stack<T>?