Java Collections Framework Interview Questions & Answers — Cracked Java
// Module · 15 topics · 89 questions

Java Collections Framework

Lists, Sets, Maps, Queues, the equals/hashCode contract, concurrent collections, and the modern Sequenced Collections API. The single most-asked area in any Java interview.

0%
Reviewed
0 / 89
Topics done
0 / 15
Est. time left
~20h
Next up
Framework Overview & Hierarchy
15 topics
01Junior5 Q0

Framework Overview & Hierarchy

How the framework is organized — Iterable, Collection, Map, the optional-operations contract, and why "Collection" and "Collections" are different things.

Not startedStart →
02Junior7 Q0

List, ArrayList, LinkedList

How ArrayList grows, when (almost never) to pick LinkedList, and the tarpit of Arrays.asList vs List.of vs Collections.unmodifiableList.

Not startedStart →
03Junior5 Q0

Set, HashSet, LinkedHashSet, TreeSet

The three production-grade Set implementations: hash-based, insertion-ordered, and sorted.

Not startedStart →
04Mid12 Q0

Map, HashMap Internals

The single most-asked Java topic. Inside hash(), resize(), treeification, load factor, and the contract for null.

Not startedStart →
05Mid5 Q0

LinkedHashMap & LRU Cache

How LinkedHashMap weaves a doubly-linked list through HashMap, and how that gives you an LRU cache in 5 lines.

Not startedStart →
06Mid6 Q0

TreeMap, NavigableMap, SortedMap

Red-black tree under the hood, log-n everything, and the navigation API senior engineers use to solve interval problems.

Not startedStart →
07Mid7 Q0

equals and hashCode Contract

The contract every Java developer must internalize: five properties of equals, the hashCode invariant, and the inheritance trap.

Not startedStart →
08Junior5 Q0

Comparable vs Comparator

Natural ordering vs external ordering, and the "consistent with equals" trap most senior engineers can name but not explain.

Not startedStart →
09Mid6 Q0

Queue, Deque, ArrayDeque, PriorityQueue

The Queue throw-vs-return method matrix, why ArrayDeque replaces Stack, and the PriorityQueue iterator trap.

Not startedStart →
10Mid5 Q0

Iterator, ListIterator, Iterable, Spliterator

The iteration protocol, modCount and ConcurrentModificationException, and how Spliterator powers parallel streams.

Not startedStart →
11Senior7 Q0

Concurrent Collections — ConcurrentHashMap

How CHM redesigned itself in Java 8, why size() is approximate, and the right way to use computeIfAbsent.

Not startedStart →
12Senior5 Q0

BlockingQueue Family

The producer-consumer toolbox. Which queue each Executors factory uses, why newFixedThreadPool can take down production.

Not startedStart →
13Senior4 Q0

CopyOnWriteArrayList, ConcurrentSkipListMap, ConcurrentLinkedQueue

The lesser-known concurrent toolbox: copy-on-write for read-mostly state, skip list for sorted concurrent access, lock-free queues.

Not startedStart →
14Junior4 Q0

Collections Utility Class

Static helpers and wrappers: unmodifiable vs immutable vs synchronized, and the algorithms most people forget.

Not startedStart →
15Mid6 Q0

Modern Features (Java 9–25)

Factory methods, Stream.toList, Sequenced Collections (Java 21), Records as map keys, virtual-thread implications.

Not startedStart →