LogIn
I don't have account.
Sponsored -55%
Tarkan Top Brand

Tarkan Portable Folding Laptop Desk with Drawer, Cup & Tablet Holder (Black)

Foldable · Anti-slip strip · 60 × 40 cm · No assembly

★★★★★ 4.2 (7,877) 1K+ bought last month
₹899 M.R.P. ₹1,999Save ₹1,100
Buy Now
Adℹ

What Happens If You Override Equals() but Not GetHashCode() in C#

Shubham Verma
39 Views
Amazon Pay offer
Adℹ

When working with collections like HashSet or Dictionary<TKey, TValue>, understanding the relationship between Equals() and GetHashCode() is critical. Many hidden bugs and performance problems in .NET apps happen because these two methods are used incorrectly.

Let’s unpack this in detail step by step.

The Role of Equals() and GetHashCode()

Every object in C# inherits two fundamental methods from System.Object:

  • public virtual bool Equals(object obj);
  • public virtual int GetHashCode();

They work hand-in-hand to determine object equality and hash identity.

  • Equals() defines logical equality — when two objects mean the same thing.

  • GetHashCode() provides a hash used for fast lookups in hash-based collections (like HashSet, Dictionary and ConcurrentDictionary).

How Hash-Based Collections Work

Collections like HashSet and Dictionary<TKey, TValue> are hash-based. They use a two-step process for lookup and storage:

Hashing Phase:

  • Call GetHashCode() to compute an integer hash.
  • This determines which bucket an object belongs to.

Equality Phase:

  • Once inside the right bucket, call Equals() to check if the item is actually equal to an existing entry.

Example: HashSet Internals (Simplified)

Imagine a HashSet as multiple buckets (like small lists):


Bucket 0: [ ]
Bucket 1: [ ]
Bucket 2: [Person("Alice")]
Bucket 3: [ ]
Bucket 4: [Person("Bob")]

When you add new Person("Alice"):

  • The hash code decides which bucket to use.

  • Then Equals() ensures no duplicates exist in that bucket.

If GetHashCode() returns different values for logically equal objects, they end up in different buckets and Equals() never even gets called to compare them.

This is the Problem when Overriding Equals() but Not GetHashCode()

Consider this class:


class Person
{
    public string Name { get; set; }

    public override bool Equals(object obj)
    {
        return obj is Person other && Name == other.Name;
    }

    // ❌ Forgot to override GetHashCode()
}

Let’s test it:


var set = new HashSet<Person>();
set.Add(new Person { Name = "Dev" });
set.Add(new Person { Name = "Dev" });

Console.WriteLine(set.Count);  // Output: 2

Even though both objects are logically equal (Equals() returns true), HashSet stores both, because they have different hash codes.

Why It Happens

By default, GetHashCode() (from object) uses the object's reference in memory. So, two different instances even with identical content, produce different hash codes.

Since the hash codes are different, the objects might end up in different buckets (bucketIndex = hashCode % capacity). In that case, the HashSet won’t even call Equals() to compare them. It only calls Equals() if both objects fall into the same bucket.

The Object Equality Contract

Microsoft’s official guidelines define a clear contract between Equals() and GetHashCode():

If two objects are equal (according to Equals()),
they must return the same value from GetHashCode().

Violating this rule leads to unpredictable behavior in any hash-based collection.

The Rules Summarized

Rule Description
Reflexive x.Equals(x) must be true.
Symmetric x.Equals(y) must equal y.Equals(x).
Transitive If x.Equals(y) and y.Equals(z), then x.Equals(z) must be true.
Consistency Repeated calls must return the same result unless the object changes.
Hash Code Contract If x.Equals(y) is true, then x.GetHashCode() == y.GetHashCode() must be true.

.

Correct Implementation Example

Here’s how to fix it properly:


class Person
{
    public string Name { get; set; }

    public override bool Equals(object obj)
    {
        return obj is Person other && Name == other.Name;
    }

    public override int GetHashCode()
    {
        // Null-safe hash computation
        return Name?.GetHashCode() ?? 0;
    }
}

Now test again:


var set = new HashSet<Person>();

set.Add(new Person { Name = "Dev" });
set.Add(new Person { Name = "Dev" });

Console.WriteLine(set.Count);  // ✅ Output: 1

Now Equals() and GetHashCode() are consistent both objects hash to the same bucket and the duplicate is detected.

Real-World Impact

Here’s what can break if you don’t override both:

Collection Problem
HashSet Stores duplicates that should be equal.
Dictionary<TKey, TValue> Treats equal keys as distinct, causing overwriting or lookup failures.
ConcurrentDictionary<TKey, TValue> Thread-safe version suffers the same issue.
LINQ Some LINQ methods (like Distinct()) rely on hash codes and may misbehave.
Contains(), Remove() Fail to find existing items that are considered “equal.”

Performance Implications

Even if things seem to work, a broken hash implementation can:

  • Dramatically increase lookup time (because objects go into wrong buckets)

  • Cause memory waste (duplicate entries)

  • Lead to unpredictable behavior across different .NET versions or runtime optimizations

  • Hash-based collections rely on hash uniformity for performance — mismatched hashes kill that.

How to Implement GetHashCode() Safely

A robust hash code implementation should:

  • Use immutable fields (values that don’t change after construction)

  • Combine multiple fields using a reliable hash combiner

  • Avoid overflow or randomization issues

Example:


class Employee
{
    public int Id { get; set; }
    public string Department { get; set; }

    public override bool Equals(object obj)
    {
        return obj is Employee e && Id == e.Id && Department == e.Department;
    }

    public override int GetHashCode()
    {
        return HashCode.Combine(Id, Department);
    }
}

.NET’s HashCode.Combine() (C# 8+) simplifies safe, high-quality hash generation.

Common Misconceptions

Myth Reality
"Equals() is enough to define equality." Not for hash-based collections - you need consistent hashes.
"GetHashCode() must be unique." No , only consistent. Collisions are okay; inconsistency isn’t.
"You must override Equals() and GetHashCode() together." Always. They’re inseparable for logical equality.
"Changing hash logic later is safe." Not for persisted or serialized collections. it may corrupt lookups.

Summary

Concept Explanation
Equals() Defines logical equality between objects.
GetHashCode() Determines hash identity for collections.
If only Equals() is overridden Hash-based collections misbehave (duplicates, failed lookups).
If both are overridden correctly Consistent, predictable equality semantics.
Golden Rule Equal objects must have equal hash codes.

In Short

If you override Equals(), you must override GetHashCode().

Failing to do so may not crash your program, but it will silently break correctness in ways that are hard to debug.

Example Summary in One Line

HashSet won’t even check equality between two objects unless their hash codes match.
Responses (1)

Write a response

CommentHide Comments
~ Raj Verma⏱️04 November 2025

Great insight article! It really helps to understand how things like dictionaries and sets might behave unexpectedly. you have explained clearly. it’s important, when working in C# to always override GetHashCode() if you override Equals().

Thanks for sharing!

"},"4":{"id":4,"name":"ZEBRONICS Blanc mouse ad","otherData":"{}","contentFormat":2,"content":"
Sponsored -53%
Zebronics #1 Best Seller

ZEBRONICS Blanc Slim Wireless Mouse — Rechargeable, BT + 2.4GHz (Black)

Up to 1600 DPI · Silent clicks · 63g · Multicolor LED

★★★★★ 4.0 (9,512) 5K+ bought last month
₹376 M.R.P. ₹799Save ₹423
Buy Now
"},"2":{"id":2,"name":"Crousal Ads","otherData":"{}","contentFormat":2,"content":"
Sponsored -34%
iQOO Amazon's Choice

iQOO Z10 Lite 5G — Cyber Green, 4GB RAM, 128GB Storage

Dimensity 6300 · 50MP Sony AI Camera · 6000 mAh · IP64

★★★★★ 4.0 (2,052) 500+ bought last month
₹18,997 M.R.P. ₹28,999Save ₹10,002
Buy Now
"},"1":{"id":1,"name":"Banner Ads","otherData":"{}","contentFormat":2,"content":"\n
\n \n \n \"Amazon\n \n
"}}},"blogDetails":{"isWriter":false,"likes":0,"isLikedByUser":false,"tagIds":[41,43,129,200,201],"tags":[{"id":41,"name":"HashSet","maskingName":"hashset","isFeatured":true},{"id":43,"name":"HashMap","maskingName":"hashmap","isFeatured":true},{"id":129,"name":"Dictionary","maskingName":"dictionary","isFeatured":true},{"id":200,"name":"Collections","maskingName":"collections","isFeatured":false},{"id":201,"name":"C# Collection","maskingName":"c-sharp-collection","isFeatured":true}],"comments":[{"contentId":31,"commentId":1,"comment":"

Great insight article!\nIt really helps to understand how things like dictionaries and sets might behave unexpectedly. you have explained clearly. it’s important, when working in C# to always override GetHashCode() if you override Equals().

\n

Thanks for sharing!

","author":{"userId":"MjlfNF84LVsxMV0ybi10Q19BTmdlX19JdA==","name":"Raj Verma"},"createdOn":"2025-11-04T11:31:51","updatedOn":"2025-11-04T11:31:51","vote":null}],"bookmark":{"isBookmarked":false,"count":0},"author":{"userId":"MjlfNF84LVsxOV0ybi10Q19BTmdlX19JdA==","name":"Shubham Verma"},"viewCount":38,"showBannerImage":false,"seoTags":null,"content":"

When working with collections like HashSet or Dictionary<TKey, TValue>, understanding the relationship between Equals() and GetHashCode()\nis critical. Many hidden bugs and performance problems in .NET apps happen because these two methods are used incorrectly.

\n

Let’s unpack this in detail step by step.

\n

The Role of Equals() and GetHashCode()

\n

Every object in C# inherits two fundamental methods from System.Object:

\n\n

They work hand-in-hand to determine object equality and hash identity.

\n\n

How Hash-Based Collections Work

\n

Collections like HashSet and Dictionary<TKey, TValue> are hash-based.\nThey use a two-step process for lookup and storage:

\n

Hashing Phase:

\n\n

Equality Phase:

\n\n

Example: HashSet Internals (Simplified)

\n

Imagine a HashSet as multiple buckets (like small lists):

\n
\nBucket 0: [ ]\nBucket 1: [ ]\nBucket 2: [Person(\"Alice\")]\nBucket 3: [ ]\nBucket 4: [Person(\"Bob\")]\n
\n

When you add new Person(\"Alice\"):

\n\n

If GetHashCode() returns different values for logically equal objects, they end up in different buckets and Equals() never even gets called to\ncompare them.

\n

This is the Problem when Overriding Equals() but Not GetHashCode()

\n

Consider this class:

\n
\nclass Person\n{\n    public string Name { get; set; }\n\n    public override bool Equals(object obj)\n    {\n        return obj is Person other && Name == other.Name;\n    }\n\n    // ❌ Forgot to override GetHashCode()\n}\n
\n

Let’s test it:

\n
\nvar set = new HashSet<Person>();\nset.Add(new Person { Name = \"Dev\" });\nset.Add(new Person { Name = \"Dev\" });\n\nConsole.WriteLine(set.Count);  // Output: 2\n
\n

Even though both objects are logically equal (Equals() returns true),\nHashSet stores both, because they have different hash codes.

\n

Why It Happens

\n

By default, GetHashCode() (from object) uses the object's reference in memory.\nSo, two different instances even with identical content, produce different hash codes.

\n

Since the hash codes are different, the objects might end up in different buckets (bucketIndex = hashCode % capacity). In that case, the HashSet won’t even call Equals() to compare them. It only calls Equals() if both objects fall into the same bucket.

\n

The Object Equality Contract

\n

Microsoft’s official guidelines define a clear contract between Equals() and GetHashCode():

\n
If two objects are equal (according to Equals()),\nthey must return the same value from GetHashCode().\n
\n

Violating this rule leads to unpredictable behavior in any hash-based collection.

\n

The Rules Summarized

\n
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
RuleDescription
Reflexivex.Equals(x) must be true.
Symmetricx.Equals(y) must equal y.Equals(x).
TransitiveIf x.Equals(y) and y.Equals(z), then x.Equals(z) must be true.
ConsistencyRepeated calls must return the same result unless the object changes.
Hash Code ContractIf x.Equals(y) is true, then x.GetHashCode() == y.GetHashCode() must be true.
\n

.

\n

Correct Implementation Example

\n

Here’s how to fix it properly:

\n
\nclass Person\n{\n    public string Name { get; set; }\n\n    public override bool Equals(object obj)\n    {\n        return obj is Person other && Name == other.Name;\n    }\n\n    public override int GetHashCode()\n    {\n        // Null-safe hash computation\n        return Name?.GetHashCode() ?? 0;\n    }\n}\n
\n

Now test again:

\n
\nvar set = new HashSet<Person>();\n\nset.Add(new Person { Name = \"Dev\" });\nset.Add(new Person { Name = \"Dev\" });\n\nConsole.WriteLine(set.Count);  // ✅ Output: 1\n
\n

Now Equals() and GetHashCode() are consistent both objects hash to the same bucket and the duplicate is detected.

\n

Real-World Impact

\n

Here’s what can break if you don’t override both:

\n
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
CollectionProblem
HashSetStores duplicates that should be equal.
Dictionary<TKey, TValue>Treats equal keys as distinct, causing overwriting or lookup failures.
ConcurrentDictionary<TKey, TValue>Thread-safe version suffers the same issue.
LINQSome LINQ methods (like Distinct()) rely on hash codes and may misbehave.
Contains(), Remove()Fail to find existing items that are considered “equal.”
\n

Performance Implications

\n

Even if things seem to work, a broken hash implementation can:

\n\n

How to Implement GetHashCode() Safely

\n

A robust hash code implementation should:

\n\n

Example:

\n
\nclass Employee\n{\n    public int Id { get; set; }\n    public string Department { get; set; }\n\n    public override bool Equals(object obj)\n    {\n        return obj is Employee e && Id == e.Id && Department == e.Department;\n    }\n\n    public override int GetHashCode()\n    {\n        return HashCode.Combine(Id, Department);\n    }\n}\n
\n

.NET’s HashCode.Combine() (C# 8+) simplifies safe, high-quality hash generation.

\n

Common Misconceptions

\n
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
MythReality
\"Equals() is enough to define equality.\"Not for hash-based collections - you need consistent hashes.
\"GetHashCode() must be unique.\"No , only consistent. Collisions are okay; inconsistency isn’t.
\"You must override Equals() and GetHashCode() together.\"Always. They’re inseparable for logical equality.
\"Changing hash logic later is safe.\"Not for persisted or serialized collections. it may corrupt lookups.
\n

Summary

\n
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
ConceptExplanation
Equals()Defines logical equality between objects.
GetHashCode()Determines hash identity for collections.
If only Equals() is overriddenHash-based collections misbehave (duplicates, failed lookups).
If both are overridden correctlyConsistent, predictable equality semantics.
Golden RuleEqual objects must have equal hash codes.
\n

In Short

\n

If you override Equals(), you must override GetHashCode().

\n

Failing to do so may not crash your program,\nbut it will silently break correctness in ways that are hard to debug.

\n

Example Summary in One Line

\n
HashSet won’t even check equality between two objects unless their hash codes match.\n
","categoryId":76,"subCategoryId":76,"contentFormat":5,"blogId":31,"userId":"MjlfNF84LVsxOV0ybi10Q19BTmdlX19JdA==","title":"What Happens If You Override Equals() but Not GetHashCode() in C#","url":"what-happens-if-you-override-equals-but-not-gethashcode-in-c-sharp","bannerImage":"","seoDescription":"","generatedOn":"2025-10-31T08:03:46","updatedOn":"2025-10-31T08:03:46"},"popularContents":[{"id":166,"title":"System Design Interview – BIGGEST Mistakes to Avoid","url":"system-design-interview-biggest-mistakes-to-avoid","description":null,"seoDescription":"Learn the biggest mistakes to avoid in a system design interview, from unclear requirements to poor trade-off analysis. Includes real-world cases, advanced insights and examples to help you ace your next system design interview.","contentType":2,"generatedOn":"2026-10-14T22:54:35.769965Z","viewCount":0},{"id":167,"title":"Meesho SDE-1 Online Assessment Interview Experience (Remote) - Rejected","url":"meesho-sde-1-online-assessment-interview-experience-remote-rejected","description":null,"seoDescription":"Read a real Meesho SDE-1 online assessment experience with coding questions, DSA topics, solutions, difficulty level, preparation tips and interview insights.","contentType":5,"generatedOn":"2026-10-14T22:54:35.77055Z","viewCount":0},{"id":163,"title":"Top 50 SQL Interview Questions and Answers (Beginner to Intermediate)","url":"top-sql-interview-questions-and-answers-beginner-to-intermediate","description":null,"seoDescription":"Top 50 SQL Interview Questions and Answers (Beginner to Intermediate). Top SQL Interview Questions for fresher. Frequently asked SQL interview questions with answers","contentType":2,"generatedOn":"2026-10-14T22:54:35.7699581Z","viewCount":0},{"id":135,"title":"Spinny SDE-1 Interview Experience (Selected)","url":"spinny-sde-1-interview-experience-selected","description":null,"seoDescription":"Spinny SDE-1 Interview Experience (Selected) | 4 Rounds Breakdown: Coding, LLD, Java, SQL + Real Interview Questions","contentType":5,"generatedOn":"2026-10-14T22:54:35.7705432Z","viewCount":0},{"id":171,"title":"Meesho SDE-1 Backend Interview Experience (Remote | 3 Round) - Rejected","url":"meesho-sde-1-backend-interview-experience-remote-3-round-rejected","description":null,"seoDescription":"Read a real Meesho SDE-1 Backend interview experience covering the online assessment, DSA interview, machine coding round, LLD questions and preparation tips.","contentType":5,"generatedOn":"2026-10-14T22:54:35.7705519Z","viewCount":0},{"id":139,"title":"Blinkit (Eternal) SDE-1 Interview Experience (June 2026) – Offer Received","url":"blinkit-eternal-sde-1-interview-experience-june-2026-offer-received","description":null,"seoDescription":"Blinkit SDE-1 interview experience with a 30 LPA offer. Covers House Robber DP, ticket booking system design, culture fit round and tips.","contentType":5,"generatedOn":"2026-10-14T22:54:35.7705482Z","viewCount":0},{"id":83,"title":"Uber SDE 2 Interview Experience (5 Rounds, Selected) - Complete DSA Questions with solution, System Design & Managerial Round","url":"uber-sde-2-interview-experience","description":null,"seoDescription":"Uber SDE 2 interview experience with 5 rounds, real DSA questions, system design, coding round, and preparation tips to crack Uber interviews.","contentType":5,"generatedOn":"2026-10-14T22:54:35.7705396Z","viewCount":0},{"id":138,"title":"DSA Patterns for Coding Interviews: Complete LeetCode Roadmap (Beginner to Advanced)","url":"dsa-patterns-for-coding-interviews-complete-leetcode-roadmap-beginner-to-advanced","description":null,"seoDescription":"Master every LeetCode pattern for coding interviews. Learn Arrays, Sliding Window, Graphs, Dynamic Programming, Trees, Heaps and more with 250+ curated problem","contentType":5,"generatedOn":"2026-10-14T22:54:35.7705447Z","viewCount":0},{"id":165,"title":"Top 50+ SQL Interview Questions and Answers for Intermediate to Advanced","url":"top-sql-interview-questions-and-answers-for-intermediate-to-advanced","description":null,"seoDescription":"Top SQL Interview Questions and Answers for Intermediate to Advanced. Top SQL Interview Questions for experience. Frequently asked SQL interview questions with answers","contentType":2,"generatedOn":"2026-10-14T22:54:35.7699606Z","viewCount":0},{"id":213,"title":"Amazon SDE II Interview Experience (Bangalore, Selected) ~ Aug 2026","url":"amazon-sde-ii-interview-experience-bangalore-selected-aug-2026","description":null,"seoDescription":"Amazon SDE II interview experience from Bangalore covering 4 rounds, DSA, LLD, system design, Leadership Principles, coding questions and selection.","contentType":5,"generatedOn":"2026-10-14T22:54:35.7705535Z","viewCount":0}],"latestContents":[{"id":219,"title":"6 Tools That Made My Life Easier as a Software Engineer","url":"6-tools-that-made-my-life-easier-as-a-software-engineer","description":null,"seoDescription":"The 6 developer tools I use daily as a software engineer: Git, VS Code, Docker, Postman, Chrome DevTools, and AI assistants, with real tips, mistakes, and trade","contentType":5,"generatedOn":"2026-10-14T22:54:35.7698812Z","viewCount":0},{"id":218,"title":"When Should a Business Use Multiple AI Agents Instead of One?","url":"when-should-a-business-use-multiple-ai-agents-instead-of-one","description":null,"seoDescription":"Single agent or multi-agent AI? Learn the 4 signals that justify splitting agents by knowledge, permissions, and risk, plus routing and handoff tips.","contentType":5,"generatedOn":"2026-10-14T22:54:35.7698865Z","viewCount":0},{"id":216,"title":"AI in Clinical Trials Market Estimated to Experience a Hike in Growth by 2035","url":"ai-in-clinical-trials-market-estimated-to-experience-a-hike-in-growth-by-2035","description":null,"seoDescription":"The exclusive information about market dynamics serves as a valuable guide to predict economic scenarios and initiatives taken to enhance future growth. Our mar","contentType":5,"generatedOn":"2026-10-14T22:54:35.7698879Z","viewCount":0},{"id":217,"title":"AI in Clinical Trials Market Estimated to Experience a Hike in Growth by 2035","url":"ai-in-clinical-trials-market-estimated-to-experience-a-hike-in-growth-by-2035","description":null,"seoDescription":"The exclusive information about market dynamics serves as a valuable guide to predict economic scenarios and initiatives taken to enhance future growth. Our mar","contentType":5,"generatedOn":"2026-10-14T22:54:35.7698891Z","viewCount":0},{"id":215,"title":"What Happens When an AI Agent Doesn't Know the Answer?","url":"what-happens-when-an-ai-agent-doesnt-know-the-answer","description":null,"seoDescription":"Most AI agents fail quietly. They guess instead of saying \"I don't know.\" Here's how to design better fallback and human-handoff behavior.","contentType":5,"generatedOn":"2026-10-14T22:54:35.7698902Z","viewCount":0},{"id":214,"title":"Greedy Algorithms Explained: How They Work, When They Fail and How to Use Them","url":"greedy-algorithms-explained-how-they-work-when-they-fail-and-how-to-use-them","description":null,"seoDescription":"Learn greedy algorithms step by step with C# code Dijkstra, Huffman coding, knapsack and MSTs plus when greedy fails and how to prove it's correct","contentType":5,"generatedOn":"2026-10-14T22:54:35.7698942Z","viewCount":0},{"id":213,"title":"Amazon SDE II Interview Experience (Bangalore, Selected) ~ Aug 2026","url":"amazon-sde-ii-interview-experience-bangalore-selected-aug-2026","description":null,"seoDescription":"Amazon SDE II interview experience from Bangalore covering 4 rounds, DSA, LLD, system design, Leadership Principles, coding questions and selection.","contentType":5,"generatedOn":"2026-10-14T22:54:35.7698976Z","viewCount":0},{"id":212,"title":"How to Get 10x Better AI Answers Without Writing Better Prompts : 10 Proven Techniques","url":"how-to-get-10x-better-ai-answers-without-writing-better-prompts-10-proven-techniques","description":null,"seoDescription":"Get better AI answers without complex prompts. Learn 10 practical techniques using context, examples, tools, feedback, and verification.","contentType":5,"generatedOn":"2026-10-14T22:54:35.7698991Z","viewCount":0},{"id":211,"title":"I Interviewed for a Microsoft SDE I Role. Here's Everything That Happened.","url":"i-interviewed-for-a-microsoft-sde-i-role-heres-everything-that-happened","description":null,"seoDescription":"My real Microsoft SDE I interview experience, all 4 rounds, the exact DSA problems with fully tested solutions, the WhatsApp system design round","contentType":5,"generatedOn":"2026-10-14T22:54:35.7699005Z","viewCount":0},{"id":140,"title":"PolicyBazaar Software Development Engineer (SDE) Interview Experience | DSA, Core CS & System Design","url":"policybazaar-software-development-engineer-sde-interview-experience-dsa-core-cs-system-design","description":null,"seoDescription":"Detailed PolicyBazaar SDE interview experience covering 3 rounds: DSA coding, core CS assessment and system design with key learnings and insights.","contentType":5,"generatedOn":"2026-10-14T22:54:35.7699019Z","viewCount":0}],"relatedContents":[{"id":49,"title":"Achieving 10x Faster Serialization in .NET: A High-Performance Guide","url":"achieving-10x-faster-serialization-in-net-a-high-performance-guide","description":null,"seoDescription":"Learn how to achieve faster JSON serialization in .NET using System.Text.Json, source generators, ProtoBuf, and memory-efficient APIs","contentType":5,"generatedOn":"2026-10-14T22:54:35.7784127Z","viewCount":0},{"id":32,"title":"HashSet.CreateSetComparer() in C#","url":"hashsett-createsetcomparer-in-c-sharp","description":null,"seoDescription":"","contentType":5,"generatedOn":"2026-10-14T22:54:35.7784183Z","viewCount":0},{"id":18,"title":"How to Efficiently Use LINQ Intersect in C# with Large Collections","url":"how-to-efficiently-use-linq-intersect-in-c-sharp-with-large-collections","description":null,"seoDescription":"","contentType":5,"generatedOn":"2026-10-14T22:54:35.7784244Z","viewCount":0},{"id":29,"title":"SortedDictionary in C# – Beginner to Advanced Guide","url":"sorteddictionary-in-c-sharp","description":null,"seoDescription":"Learn how to use SortedDictionary in C# from basics to advanced. Covers syntax, examples, performance and real-world use cases for efficient coding.","contentType":2,"generatedOn":"2026-10-14T22:54:35.7784257Z","viewCount":0},{"id":16,"title":"Collections in C#","url":"collections-in-c-sharp","description":null,"seoDescription":"Explore Collections in c# | c# collections | type of collection in c# | collection classes and operations, LinkedList , stack, queue, dictionary, hashset","contentType":2,"generatedOn":"2026-10-14T22:54:35.7784278Z","viewCount":0},{"id":154,"title":" Static Class vs Singleton in C#","url":"static-class-vs-singleton-in-c-sharp","description":null,"seoDescription":"Static Class vs Singleton in C#: A Complete Deep Dive","contentType":2,"generatedOn":"2026-10-14T22:54:35.7784292Z","viewCount":0},{"id":36,"title":"C# Tutorial","url":"c-sharp-tutorial","description":null,"seoDescription":"c sharp tutorial | c# tutorial | c sharp learning plan","contentType":2,"generatedOn":"2026-10-14T22:54:35.7784306Z","viewCount":0},{"id":39,"title":"Exploring the General Structure of a C# Program","url":"general-structure-of-c-sharp-program","description":null,"seoDescription":"Structure of c# program | c sharp program or code structure ","contentType":2,"generatedOn":"2026-10-14T22:54:35.7784319Z","viewCount":0},{"id":137,"title":"Top C# Properties Interview Questions and Answers","url":"top-c-sharp-properties-interview-questions-and-answers","description":null,"seoDescription":"Top C# Properties Interview Questions and Answers. Prepare for your next tech c# interview with these top c# interview questions and expert answers.","contentType":2,"generatedOn":"2026-10-14T22:54:35.7784334Z","viewCount":0}]}}},"source":{"isMobile":false}}; window.__CLIENT_RENDER__ = false;