C# Programming - MCQ Practice Questions
C# (.NET) MCQs — OOP, collections, LINQ & exception handling.
290 questions | 100% Free
In a scenario with large datasets, which collection should you use to avoid boxing overhead?
Which method allows you to get an element from a SortedSet<T> at a specific index without using indexer?
What does TryDequeue() return in ConcurrentQueue<T> when the queue is empty?
Which scenario best uses Stack<T> instead of Queue<T> in a practical application?
In a scenario where you need to store key-value pairs with fast lookup times, which collection is optimal?
Which method should be used to safely check and retrieve a value from a Dictionary<K,V> without throwing an exception?
What is the primary difference between ArrayList and List<T>?
In a multiprocessing environment, which thread-safe collection should be used for concurrent operations?
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?
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 is the time complexity of Contains() method in a HashSet<T>?
In a scenario with frequent additions and removals at both ends, which collection is most efficient?