The core generic collections are List<T>, Dictionary<TKey, TValue> and HashSet<T>, with queues, stacks and sorted versions for special cases. They live in System.Collections.Generic, are type-safe, and store value types without boxing.
List<T> is a dynamic array, and LinkedList<T> is a doubly linked list.
HashSet<T> holds unique items with fast lookup, and SortedSet<T> keeps them sorted.
Dictionary<TKey, TValue> maps keys to values with fast lookup, and SortedDictionary<TKey, TValue> keeps the keys sorted.
Queue<T> is first in, first out, and Stack<T> is last in, first out.
For shared access across threads, ConcurrentDictionary<TKey, TValue> in System.Collections.Concurrent is the thread-safe dictionary.
Rewriting in plainer words…
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
The diagram below the answer is the concept .
Jump to it ↓
Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:
Saved in this browser - sign in to keep your review list.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Keep going - a few more words and AI can grade it.
Interview lens
How interviewers actually use this question
Likely follow-ups
You check membership often in a large collection. Would you use List<T> or HashSet<T>, and why?List<T>.Contains scans every item, while HashSet<T> uses the hash for near constant-time lookup. Note that HashSet drops duplicates and has no index.
What do you pay for SortedDictionary<TKey, TValue> compared with Dictionary<TKey, TValue>?Dictionary is a hash table with fast average lookup and no key order. SortedDictionary is a tree, so lookups are O(log n) but the keys stay in order.
What does a custom class need to work correctly as a Dictionary key?Equals and GetHashCode overrides that agree, or an IEqualityComparer<T>, plus key fields that don't change while the object is stored.
Is List<T> safe when several threads add to it at once? What would you use instead?Concurrent reads with no writer are fine, but writes are not. Name a lock, or a System.Collections.Concurrent type such as ConcurrentDictionary<TKey, TValue>.
The main generic collections are List<T>, Dictionary<TKey, TValue> and HashSet<T>, and I use queues, stacks and the sorted versions when I need their specific behavior.
They all live in System.Collections.Generic and they're type-safe, so a List<int> stores ints directly, without boxing.
List<T> is a dynamic array and my default choice, and LinkedList<T> is a doubly linked list.
HashSet<T> holds unique items and Dictionary<TKey, TValue> maps keys to values, both with fast lookup, and SortedSet<T> and SortedDictionary keep things in sorted order.
Queue<T> is first in, first out, and Stack<T> is last in, first out.
The standard ones aren't safe for shared writes across threads, so for that I'd use ConcurrentDictionary<TKey, TValue> from System.Collections.Concurrent.
Weak answers to avoid
Lists type names with no use caseA list of names only shows you memorized them. Tie each one to its job, like key lookup, unique items, or FIFO and LIFO order.
Mixes in non-generic ArrayList and HashtableThose live in System.Collections and store object, so they box value types. Call them legacy and say List<T> and Dictionary<TKey, TValue> replaced them.
Calls Dictionary ordered or thread-safeDictionary promises no order and isn't safe for concurrent writes. Point to SortedDictionary for order and ConcurrentDictionary for threads.
Says List<T> is a linked listList<T> wraps a resizable array, so index access is fast and inserts in the middle shift items. LinkedList<T> is the doubly linked list.
Interview lens
Likely follow-ups, what you can say, and the weak answers to avoid.