iGET

C# Programming - MCQ Practice Questions

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

290 questions | 100% Free

Q.61Medium

What happens when you modify a List<T> while iterating over it using a foreach loop?

Q.62Medium

Which LINQ method is used to convert a Dictionary<K,V> to a List<T> of key-value pairs?

Q.63Easy

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

Q.64Medium

In a data processing pipeline, if you need FIFO (First-In-First-Out) semantics with O(1) enqueue/dequeue, which collection is best?

Q.65Medium

Which collection maintains elements in sorted order and is backed by a binary search tree?

Q.66Easy

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

Q.67Hard

In a real-time cache system with limited memory, which collection supports automatic eviction of least recently used items?

Q.68Medium

What is the time complexity of Contains() method in a HashSet<T>?

Q.69Hard

Which collection should be used when you need both indexed access and automatic sorting?

Q.70Medium

In a scenario with frequent additions and removals at both ends, which collection is most efficient?

Q.71Hard

In a high-concurrency distributed system, which collection from System.Collections.Concurrent is best for one-to-many relationships?