Test yourself under real exam conditions: 50 timed questions, 60 on the clock, pass mark 70%%. Instant score with a full review of everything you got wrong. Free — no account needed.
Exam details
LINQ (Language Integrated Query) is a set of features that allows you to write query expressions directly in C# to filter, sort, and transform data from collections, databases, and XML.var results = list.Where(x => x > 5).OrderBy(x => x);
Query syntax resembles SQL:var q = from x in list where x > 5 select x;
Method syntax uses extension methods:var q = list.Where(x => x > 5);
Both compile to the same IL code.
Select projects each element of a sequence into a new form (a transformation/map operation).var names = people.Select(p => p.Name);
It returns an IEnumerable<T> of the projected type.
Deferred execution means a LINQ query is not executed when defined, but only when the results are enumerated (e.g., via foreach, ToList(), or Count()). This allows efficient chaining of operations.
GroupBy groups elements by a key:var groups = students.GroupBy(s => s.Grade);
Each group implements IGrouping<TKey, TElement> with a Key property and a collection of elements.