iGET

C# Programming - MCQ Practice Questions

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

290 questions | 100% Free

Q.1Hard

In C# 2024-25, which LINQ method would you use to find all elements matching a condition in a List<T>?

Q.2Hard

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

Q.3Hard

Consider: var result = list.OrderByDescending(x => x.Age).ThenBy(x => x.Name); What does this do?

Q.4Hard

What is the difference between ICollection<T> and IEnumerable<T> in terms of capabilities?

Q.5Hard

In a concurrent environment, which collection should be used instead of Dictionary<K,V> in C# 2024-25?

Q.6Hard

Which collection type allows you to iterate in reverse order efficiently?

Q.7Hard

What happens when you call Clear() on a Dictionary<TKey, TValue>?

Q.8Hard

Which LINQ method should you use to get distinct elements from a List<int> while maintaining performance?

Q.9Hard

In a competitive exam scenario, if you need both fast lookup and sorted iteration, which should you choose?

Q.10Hard

In a real-time data processing application, which concurrent collection would be best for producer-consumer pattern?

Q.11Hard

Which LINQ method combines multiple sequences into a single result with cartesian product?

Q.12Hard

In a dictionary with 1000 items, what is the expected number of operations for TryGetValue() in C# 2024-25?

Q.13Hard

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

Q.14Hard

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

Q.15Hard

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