Collection Framework
List, Set, Queue, Deque and Map implementations, HashMap internals, ConcurrentHashMap, load factor and fail-fast vs fail-safe iterators.
Introduction to Java Collections Framework
Why collections exist, the problems with arrays, Collection vs Collections, and the overall hierarchy.
Collection Interface (Deep Dive)
The root of List, Set and Queue — every core method, equality rules, and the Arrays.asList trap.
List Interface
Ordered, index-based collections — List methods, ListIterator, Arrays.asList vs List.of and implementation choices.
ArrayList
Internal working of the resizable array — size vs capacity, 1.5x growth, amortized O(1) and performance trade-offs.
LinkedList
The doubly linked list behind LinkedList — nodes, head/tail, traversal cost, Deque operations and when it actually wins.
Vector & Stack
The legacy synchronized list and LIFO stack — capacity increment, Enumeration, and why ArrayDeque replaced Stack.
Set Interface
Uniqueness without positions — how Sets detect duplicates, and choosing between HashSet, LinkedHashSet and TreeSet.
HashSet
HashSet's complete internal working — the backing HashMap, buckets, collisions, load factor, resizing and treeification.
LinkedHashSet
HashSet plus predictable insertion-order iteration — the LinkedHashMap underneath, before/after links and memory trade-offs.
TreeSet
Sorted, navigable sets on a Red-Black Tree — Comparable vs Comparator, compare() == 0 duplicates, and floor/ceiling/range views.
Queue Interface
FIFO processing, the three method pairs (add/offer, remove/poll, element/peek), implementations and BlockingQueue.
Deque Interface
The double-ended queue that is both a Queue and a Stack — method families, ArrayDeque's circular array and why it replaced Stack.
PriorityQueue
Priority-ordered processing on a binary min-heap — sift-up, sift-down, max-heaps, custom priorities and Top-K patterns.
Map Interface
Key-value storage — unique keys, core and Java 8 methods (computeIfAbsent, merge), views, and choosing the right Map.
HashMap
HashMap from the inside — Node<K,V>, hash spreading, (n-1) & hash, put/get flows, collisions, treeification, load factor and resizing.
LinkedHashMap
HashMap plus predictable ordering — before/after links, insertion vs access order, and building an LRU cache with removeEldestEntry().
TreeMap
Sorted maps on a Red-Black Tree — ordering by key, comparator equivalence, floor/ceiling navigation, range views and rotations.
WeakHashMap
Maps with weakly referenced keys — strong vs weak references, GC-driven entry removal, ReferenceQueue, and why it is not a cache.
IdentityHashMap
A Map that compares keys with == instead of equals() — identity hashing, open addressing, object-graph use cases and String-pool traps.
EnumMap
The array-backed Map for enum keys — ordinal positions, declaration-order iteration, null rules, EnumSet vs EnumMap and state machines.
ConcurrentHashMap
Thread-safe maps without a global lock — Java 7 segments vs Java 8 CAS + bin locking, atomic compound operations, weakly consistent iterators and LongAdder.
HashMap Internals
The full HashMap chain end to end — hash spreading, bucket math, collisions vs duplicates, treeification rules, resize bit-split, modCount and 50+ interview answers.
Load Factor, Fail-Fast and Fail-Safe
How load factor, HashMap's lack of thread safety and the three iterator styles — fail-fast, weakly consistent and snapshot — connect.