C# Programming - MCQ Practice Questions
C# (.NET) MCQs — OOP, collections, LINQ & exception handling.
290 questions | 100% Free
What is the time complexity of the IndexOf() method in List<T>?
Which LINQ method should you use to transform each element of a collection into a new form?
What is the primary advantage of using SortedList<K,V> over SortedDictionary<K,V>?
Which method in Queue<T> allows you to examine the front element without removing it?
In C# 2024-25, which collection should be used for thread-safe operations without explicit locking?
What happens when you enumerate a Dictionary<K,V> during modification?
Which collection type uses a hash table internally and provides O(1) average lookup?
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?
In a real-time data processing application, which concurrent collection would be best for producer-consumer pattern?
What does TryDequeue() return in ConcurrentQueue<T> when the queue is empty?
Which LINQ method combines multiple sequences into a single result with cartesian product?
In a dictionary with 1000 items, what is the expected number of operations for TryGetValue() in C# 2024-25?
Which scenario best uses Stack<T> instead of Queue<T> in a practical application?
What does the Add() method return when adding a duplicate element to a HashSet<T>?
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?