All fields

“LINQ” in Information Technology

28 questions across 2 technologies.

Information Technology

28 questions in 2 technologies

#QuestionTechnologyTopicLevel
1What is LINQ and what is deferred execution? C# › LINQC#LINQBeginner
2What is LINQ, and what are the two main syntax styles you can use to write a LINQ query? C# › LINQC#LINQBeginner
3What is the difference between Where() and Select() in a LINQ query? C# › LINQC#LINQBeginner
4What is the difference between IEnumerable and IQueryable in LINQ? C# › LINQC#LINQIntermediate
5What is 'deferred execution' in LINQ, and how does it differ from calling .ToList() or .ToArray() immediately? C# › LINQC#LINQIntermediate
6What is LINQ, and how does it simplify querying collections compared to writing manual loops? C# › LINQC#LINQIntermediate
7Why can LINQ cause the N+1 query problem and how do you fix it? C# › LINQC#LINQAdvanced
8How does LINQ to Objects differ fundamentally from LINQ to Entities (Entity Framework), particularly regarding how the query is actually executed? C# › LINQC#LINQAdvanced
9How would you write a custom LINQ extension method that integrates seamlessly with the standard method-chaining style, like a 'DistinctBy' before it existed natively? C# › LINQC#LINQAdvanced
10How does LINQ's Aggregate() method work, and how would you use it to implement a custom reduction not covered by Sum()/Average()/Count()? C# › LINQC#LINQAdvanced
11How would you write an efficient LINQ query combining Join() with GroupBy() to replicate a SQL-style LEFT OUTER JOIN with aggregation? C# › LINQC#LINQAdvanced
12How would you optimize a LINQ-to-Entities query to avoid the classic 'N+1 query' performance problem when accessing related navigation properties? C# › LINQC#LINQAdvanced
13How would you implement a custom lazy 'Where' and 'Select' from scratch using yield return, mirroring how LINQ actually works internally? C# › Iterators & yield returnC#Iterators & yield returnAdvanced
14How do you configure and use raw SQL queries alongside LINQ in EF Core when a complex query is difficult or inefficient to express in LINQ? .NET › Entity Framework Core & Data Access.NETEntity Framework Core & Data AccessIntermediate
15How does the 'yield return'-based lazy evaluation of collections (like LINQ or a custom iterator) differ from eagerly materializing a full collection, in terms of memory usage? C# › CollectionsC#CollectionsAdvanced
16What is the difference between First, FirstOrDefault and Single? C# › LINQC#LINQIntermediate
17What is the difference between Select and SelectMany? C# › LINQC#LINQIntermediate
18How do GroupBy() and its resulting IGrouping<TKey, TElement> work? C# › LINQC#LINQIntermediate
19What is the difference between First(), FirstOrDefault(), Single(), and SingleOrDefault()? C# › LINQC#LINQIntermediate
20What is the difference between IEnumerable<T>, IQueryable<T>, and List<T>, and how does choosing the wrong one hurt performance against a database? C# › LINQC#LINQIntermediate
21How does GroupBy translate and what performance pitfalls exist? C# › LINQC#LINQAdvanced
22What is the difference between Dictionary<TKey, TValue> and List<T> in terms of lookup performance? C# › CollectionsC#CollectionsBeginner
23How do you write and use a lambda expression as a shorthand for a delegate? C# › Delegates, Events & LambdasC#Delegates, Events & LambdasBeginner
24What are multicast delegates, and in what order do their subscribed methods get invoked? C# › Delegates, Events & LambdasC#Delegates, Events & LambdasIntermediate
25How do you chain multiple extension methods together in a fluent style, and what design principle makes this possible? C# › Extension MethodsC#Extension MethodsIntermediate
26How do the built-in Func<>, Action<>, and Predicate<T> generic delegate types differ, and when would you use each? C# › Delegates, Events & LambdasC#Delegates, Events & LambdasAdvanced
27How does structural (deep) equality for collections work, and why doesn't List<T>.Equals() perform element-by-element comparison by default? C# › Equality: Equals, GetHashCode & IEquatableC#Equality: Equals, GetHashCode & IEquatableAdvanced
28How would you implement infinite lazy sequence generation using yield return, and why is this safe despite never 'finishing'? C# › Iterators & yield returnC#Iterators & yield returnAdvanced