Guided course · LINQ
Time and Space Complexity in LINQ
Explain LINQ costs by counting work and tracing retained data.
- Compare streaming, buffering, hashing, sorting and repeated enumeration.
- Distinguish allocated bytes from peak retained memory and database work.
- Examples and measurements run on .NET 10; each cost model states its assumptions.
Intermediate8 modules · 24 lessons · 7 h 1 min · 36 practice tests · 25 coding problems · 2 free
Module 1 · Foundations
3 lessons · 45 min- 01Big-O for .NET Developers: Time and Space in LINQFree, 2 practice tests16 min
- 02Deferred Execution and Multiple Enumeration: Paying for the Same Query TwiceFree, 2 practice tests15 min
- 03Query Syntax vs Method Syntax: What the C# Compiler Turns a LINQ Query Into (included with Full Access), 1 practice test14 min
Module 2 · Streaming vs Buffering
4 lessons · 1 h 4 min- 04Streaming Operators: Where, Select and Take in O(1) Extra Space (included with Full Access), 1 practice test15 min
- 05OrderBy Under the Hood: O(n log n), an O(n) Buffer, Stability and Top-k (included with Full Access), 2 practice tests18 min
- 06Hidden Buffers: Reverse, ToList/ToArray Growth, Distinct and Set Operators (included with Full Access), 2 practice tests18 min
- 07Write Your Own LINQ Operator: yield, Early Argument Checks, Disposal and Buffering (included with Full Access)13 min
Module 3 · Hashing Operators
2 lessons · 35 minModule 4 · Element Operators and Fast Paths
2 lessons · 33 minModule 5 · Shape-Changing Operators
4 lessons · 1 h 1 min- 12SelectMany, Zip and Chunk: Flattening, Pairing and Batching Costs (included with Full Access), 2 practice tests15 min
- 13Skip, Take and Paging: O(1) Seeks, O(skip) Walks and Quadratic Paging (included with Full Access), 2 practice tests17 min
- 14Aggregate, Sum, Min and Max: Same O(n), Very Different Constants (included with Full Access), 2 practice tests15 min
- 15LINQ Edge Cases Interviewers Test: Empty Input, Nulls, Overflow, Duplicates and Ties (included with Full Access), 1 practice test14 min
Module 6 · Allocations and Garbage Collection
3 lessons · 53 min- 16Where LINQ Allocates: Iterators, Delegates, Closures, Enumerators and Boxing (included with Full Access), 2 practice tests17 min
- 17GC Pressure from LINQ: Gen0/1/2, the LOH, and Measuring with BenchmarkDotNet and dotnet-counters (included with Full Access), 2 practice tests17 min
- 18Allocation-Free Alternatives: Loops, Span<T>, ArrayPool and Pre-Sizing (included with Full Access), 2 practice tests19 min
Module 7 · IQueryable and EF Core
4 lessons · 1 h 2 min- 19IQueryable and EF Core: When the Cost Moves to SQL (N+1, Early ToList, Contains, Paging) (included with Full Access), 2 practice tests23 min
- 20Expression Trees in LINQ: Func vs Expression<Func> and What a Provider Sees (included with Full Access), 1 practice test15 min
- 21Dynamic LINQ Queries: Conditional Filters, OR Rules and Safe Sorting by Name (included with Full Access)13 min
- 22Async LINQ in .NET 10 and PLINQ: Streams, Cancellation and Parallel Queries (included with Full Access), 1 practice test11 min
Module 8 · Practice and Assessment
2 lessons · 1 h 8 minCoding problems
The best seller in each categoryFull AccessA price lookup by product codeFull AccessStaff by departmentFull AccessThe three most visited pagesFull AccessTotal spent per customerFull AccessThe first and last sign-inFull AccessTickets per team and priorityFull AccessStudents in each grade bandFull AccessName the customer on each orderFull AccessEach customer with their ordersFull AccessCustomers who never orderedFull AccessOrder lines, even with unknown productsFull AccessPlanned against actual hoursFull AccessOrders to cities we serveFull AccessWho knows each skillFull AccessNew, lost and kept customersFull AccessWeekly averages from daily readingsFull AccessOne page of products, in a stable orderFull AccessA running balance for the statementFull AccessThe two best scores in each classFull AccessApply price updates to the catalogueFull AccessWhy does this query run twice?Full AccessFirst, FirstOrDefault or Single?Full AccessRead no more than you needFull AccessTotals that survive empty days and big numbersFull Access
TechInterviewNotes Editorial Team ·