🗂️

Java Collections Framework

ArrayList, HashMap, TreeSet and every collection in between -- how they work internally, when to reach for each one, and the mistakes that pass code review but fail in production.

Practice interview questions on this topic →
1

Collection Framework Fundamentals & Evolution

beginner

Why the Collections Framework exists, how its interface hierarchy fits together, and the contracts every implementation silently promises to honor.

2

List Internals: ArrayList, LinkedList, and Their Relatives

beginner

How ArrayList actually grows its backing array, why that growth is amortized O(1) rather than O(n), and when LinkedList, Vector, Stack, or CopyOnWriteArrayList genuinely earn their keep instead.

3

Set Implementations: Uniqueness Without the Repetition

beginner

How HashSet, LinkedHashSet, and TreeSet each enforce uniqueness differently under the hood, plus the specialized EnumSet and BitSet for narrower but much faster use cases.

4

Queue and Deque: PriorityQueue, ArrayDeque, and Where Blocking Queues Fit

intermediatePro

The Queue and Deque contracts, how PriorityQueue's binary heap keeps the smallest element on top in O(log n), why ArrayDeque has replaced Stack and LinkedList for most double-ended use cases, and a brief map of where concurrent blocking queues fit relative to this vertical's dedicated concurrency coverage.

5

Map Internals: Buckets, Hashing, and HashMap's Resize Dance

intermediatePro

What actually happens inside a HashMap on put() and get() -- bucket selection, collision handling, Java 8's treeification of overloaded buckets, and the load-factor-driven resize that keeps average-case lookups fast.

6

LinkedHashMap and Building an LRU Cache

intermediatePro

How LinkedHashMap layers predictable ordering on top of HashMap's bucket structure, and how to turn that into a complete, working least-recently-used cache with a single constructor flag and one overridden method.

7

TreeMap, NavigableMap, and the Specialized Map Family

advancedPro

How TreeMap keeps keys sorted using a self-balancing red-black tree, the NavigableMap operations that sorting unlocks, and a tour of ConcurrentHashMap, EnumMap, WeakHashMap, and IdentityHashMap -- each solving one narrow problem a general-purpose HashMap can't.

8

equals(), hashCode(), and the Contracts That Hold Collections Together

intermediatePro

The formal equals()/hashCode() contract, why overriding one without the other quietly breaks every hash-based collection, and how Comparable and Comparator give objects two independent, legitimate notions of ordering.

9

Iterators, Fail-Fast Traversal, and the Collections/Arrays Utility Belt

intermediatePro

How Iterator and ListIterator actually traverse a collection, why fail-fast iteration throws ConcurrentModificationException instead of silently misbehaving, the fail-safe alternatives that avoid it, and the Collections/Arrays utility classes plus the modern unmodifiable-vs-immutable distinction.

10

Choosing the Right Collection

intermediatePro

A decision-framework topic for picking the correct List, Set, Queue, or Map implementation under real constraints — ordering requirements, concurrency, memory, and access patterns — backed by a full Big-O reference table and worked scenarios.

11

Collections with Spring Boot

intermediatePro

How collections show up across a real Spring Boot application — REST controller serialization, JPA entity collection mappings, and the specific pitfalls (mutable getters, uninitialized fields, lazy-loaded collections) that look fine in a code review and break in production.

12

Collections: Mistakes That Pass Code Review But Fail in Production

intermediatePro

A mistakes-and-fixes catalog of the collection bugs that compile cleanly, pass a quick glance in code review, and still cause ConcurrentModificationException, memory leaks, silent data corruption, or performance cliffs once real traffic and real data volumes show up.

13

Collections Interview Deep Dive

advancedPro

A capstone topic tying the Collections Framework together through the lens of the interview questions that actually get asked — implementing a simplified HashMap, explaining why String makes a good hash key, the real root cause of ConcurrentModificationException, fail-fast versus fail-safe iteration, and when a senior engineer would genuinely reach for a TreeMap in production.