Skip to content
Search lessons, topics, tests…
Esc

    ↑ ↓ moveEnter openEsc close
    C# Language: all courses in this track

    Guided course · C# Language

    Time and Space Complexity in LINQ

    Know the real time and memory cost of every common LINQ operator in .NET 9 and 10: what streams and what buffers, which calls hit O(1) fast paths, where iterators, closures and boxing allocate, how LINQ drives Gen0/Gen2 and LOH garbage collection, and how IQueryable and EF Core change the picture. 18 lessons with measured C# examples, a 12-exercise practice set and a 25-question mock interview.

    Intermediate8 modules · 18 lessons · 4 h 56 min · 2 free

    Module 1 · Foundations

    2 lessons · 28 min
    1. 01Big-O for .NET Developers: Time and Space in LINQFree14 min
    2. 02Deferred Execution and Multiple Enumeration: Paying for the Same Query TwiceFree14 min

    Module 2 · Streaming vs Buffering

    3 lessons · 44 min
    1. 03Streaming Operators: Where, Select and Take in O(1) Extra Space (included with Full Access)13 min
    2. 04OrderBy Under the Hood: O(n log n), an O(n) Buffer, Stability and Top-k (included with Full Access)16 min
    3. 05Hidden Buffers: Reverse, ToList/ToArray Growth, Distinct and Set Operators (included with Full Access)15 min

    Module 3 · Hashing Operators

    2 lessons · 29 min
    1. 06Hashing Operators: GroupBy, ToLookup, ToDictionary, CountBy and AggregateBy (included with Full Access)15 min
    2. 07Nested Queries O(n·m) vs Join and HashSet O(n+m) (included with Full Access)14 min

    Module 4 · Element Operators and Fast Paths

    2 lessons · 25 min
    1. 08Contains, Any and Count: Fast Paths on List, HashSet and IEnumerable (included with Full Access)13 min
    2. 09First, Last, ElementAt and Single: When They Are O(1) and When O(n) (included with Full Access)12 min

    Module 5 · Shape-Changing Operators

    3 lessons · 37 min
    1. 10SelectMany, Zip and Chunk: Flattening, Pairing and Batching Costs (included with Full Access)12 min
    2. 11Skip, Take and Paging: O(1) Seeks, O(skip) Walks and Quadratic Paging (included with Full Access)12 min
    3. 12Aggregate, Sum, Min and Max: Same O(n), Very Different Constants (included with Full Access)13 min

    Module 6 · Allocations and Garbage Collection

    3 lessons · 50 min
    1. 13Where LINQ Allocates: Iterators, Delegates, Closures, Enumerators and Boxing (included with Full Access)15 min
    2. 14GC Pressure from LINQ: Gen0/1/2, the LOH, and Measuring with BenchmarkDotNet and dotnet-counters (included with Full Access)20 min
    3. 15Allocation-Free Alternatives: Loops, Span<T>, ArrayPool and Pre-Sizing (included with Full Access)15 min

    Module 7 · IQueryable and EF Core

    1 lesson · 18 min
    1. 16IQueryable and EF Core: When the Cost Moves to SQL (N+1, Early ToList, Contains, Paging) (included with Full Access)18 min

    Module 8 · Practice and Assessment

    2 lessons · 1 h 5 min
    1. 17Practice Set: 12 "Find the Complexity and Fix It" Exercises (Solved and Measured) (included with Full Access)30 min
    2. 18Final Mock Interview: 25 Questions on LINQ Time and Space Complexity (included with Full Access)35 min