C# Programming - MCQ Practice Questions
C# (.NET) MCQs — OOP, collections, LINQ & exception handling.
290 questions | 100% Free
What happens when you modify a List<T> while iterating over it using a foreach loop?
Which LINQ method is used to convert a Dictionary<K,V> to a List<T> of key-value pairs?
What is the space complexity of a HashSet<T> with n elements?
In a data processing pipeline, if you need FIFO (First-In-First-Out) semantics with O(1) enqueue/dequeue, which collection is best?
Which collection maintains elements in sorted order and is backed by a binary search tree?
What does the Peek() method do in a Stack<T>?
In a real-time cache system with limited memory, which collection supports automatic eviction of least recently used items?
What is the time complexity of Contains() method in a HashSet<T>?
Which collection should be used when you need both indexed access and automatic sorting?
In a scenario with frequent additions and removals at both ends, which collection is most efficient?
In a high-concurrency distributed system, which collection from System.Collections.Concurrent is best for one-to-many relationships?