C# Programming - MCQ Practice Questions
C# (.NET) MCQs — OOP, collections, LINQ & exception handling.
290 questions | 100% Free
In C# 2024-25, which LINQ method would you use to find all elements matching a condition in a List<T>?
What is the space complexity of a HashSet<T> with n elements storing unique values?
Consider: var result = list.OrderByDescending(x => x.Age).ThenBy(x => x.Name); What does this do?
What is the difference between ICollection<T> and IEnumerable<T> in terms of capabilities?
In a concurrent environment, which collection should be used instead of Dictionary<K,V> in C# 2024-25?
Which collection type allows you to iterate in reverse order efficiently?
What happens when you call Clear() on a Dictionary<TKey, TValue>?
Which LINQ method should you use to get distinct elements from a List<int> while maintaining performance?
In a competitive exam scenario, if you need both fast lookup and sorted iteration, which should you choose?
In a real-time data processing application, which concurrent collection would be best for producer-consumer pattern?
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?
In a real-time cache system with limited memory, which collection supports automatic eviction of least recently used items?
Which collection should be used when you need both indexed access and automatic sorting?
In a high-concurrency distributed system, which collection from System.Collections.Concurrent is best for one-to-many relationships?