Skip to content
Search lessons, topics, tests…
Esc

    ↑ ↓ moveEnter openEsc close
    C# Language: back to the track

    Guided course · C# Language

    C# Equality and Hash Collections

    • Choose equality and ordering rules for C# keys.
    • Avoid mutable-key bugs in dictionaries and hash sets.
    • Compare records, structs and custom equality policies.
    • Understand collisions, hash codes and collection lookups.
    Intermediate4 modules · 12 lessons · 2 h 49 min · 4 practice tests · 2 free

    Module 1 · Equality, comparers and reliable keys

    3 lessons · 31 min
    1. 01Equality and Hash-Code Contracts for Immutable C# Value KeysFree, video, 1 practice test9 min
    2. 02Choosing Ordinal Comparers for Dictionary and HashSetFree, video, 1 practice test10 min
    3. 03Why Mutating Dictionary Keys Breaks Lookup in C# (included with Full Access), video, 1 practice test12 min

    Module 2 · Records, Structs and Custom Comparers

    4 lessons · 52 min
    1. 04Record Equality in Practice: Collection Members, Inheritance and Mutable Keys (included with Full Access)13 min
    2. 05Struct Equality: Boxing, One-Field Hash Codes and Floating-Point Keys (included with Full Access)13 min
    3. 06Custom IEqualityComparer<T>: One Policy Across Distinct, GroupBy, Join and Dictionaries (included with Full Access)13 min
    4. 07Hash Quality: Counting Collisions, HashCode.Combine and Per-Process String Hashes (included with Full Access)13 min

    Module 3 · Ordering, Collections and Identity

    4 lessons · 51 min
    1. 08Ordering Is Not Equality: Comparers, Sorted Collections and Culture-Aware Strings (included with Full Access)14 min
    2. 09Collections as Values: Structural Equality, Set Keys and Frozen Lookups (included with Full Access)12 min
    3. 10Dictionary APIs That Decide Correctness: TryAdd, In-Place Updates, GetOrAdd and Span Lookups (included with Full Access)13 min
    4. 11Entity Identity: Id-Based Equals, Transient Objects and Hash Codes That Change (included with Full Access)12 min

    Module 4 · Practice and Assessment

    1 lesson · 35 min
    1. 12Final Mock Interview: 25 Questions on C# Equality and Hash Collections (included with Full Access)35 min

    Practice tests

    TechInterviewNotes Editorial Team ·