• Collections of data

    In C#, there are several interfaces available for collections of data that can be iterated over or queried. These interfaces include IEnumerable, IEnumerator, IQueryable, ICollection, and IList. Each of these interfaces has its own unique characteristics and is used in different scenarios depending on the requirements of your application.
  • What is yield return

    Can understand yield return as lazy versus normal return as eager. In an iterator block, normal return returns the entire resultset at once. While yield return returns instance of IEnumerable (implemented by Array/List), and then returns one by one when we access the value (the index position will be noted for the next access). Iterators can be used to lazily generate a sequence of objects. So the code in the method only executed once we need the value (and it’s one by one)
  • GetHashCode vs Equal

    Hash-based data structures like hash tables, dictionaries, and sets. The GetHashCode() method creates a unique code for each item in these data structures, while the Equals() method is used to check if two objects are the same. When two objects are considered equal based on the Equals() method, their hash codes must be identical (giống hệt nhau)