Course contents

Module 03

Collections & Generics

How every major collection works internally, how to choose between them, and generics from basics to type erasure.

Premium5 free lessons8 topics33 lessons & question sets0 ready

By the end of this module you can

  • Explain HashMap internals down to treeification
  • Pick the right collection for a workload and justify it
  • Use wildcards and bounded types confidently

Collections framework

The hierarchy, complexity and choosing the right collection.

  1. The collections hierarchyLessonFreeSoon
  2. Choosing the right collectionLessonFreeSoon
  3. Big-O cheat sheet for collectionsLessonPremiumSoon
  4. Collections framework: interview questions & scenariosInterview Q&APremiumSoon

Lists

ArrayList and LinkedList internals and trade-offs.

  1. How ArrayList worksLessonFreeSoon
  2. How LinkedList worksLessonPremiumSoon
  3. ArrayList vs LinkedListLessonPremiumSoon
  4. Lists: interview questions & scenariosInterview Q&APremiumSoon

Maps

HashMap, LinkedHashMap, TreeMap and the specialised maps.

  1. How HashMap worksLessonPremiumSoon
  2. Hashing, collisions and treeificationLessonPremiumSoon
  3. LinkedHashMap and building an LRU cacheLessonPremiumSoon
  4. TreeMap and red-black treesLessonPremiumSoon
  5. WeakHashMap, IdentityHashMap and EnumMapLessonPremiumSoon
  6. Maps: interview questions & scenariosInterview Q&APremiumSoon

Sets

HashSet, LinkedHashSet and TreeSet internals.

  1. How HashSet, LinkedHashSet and TreeSet workLessonPremiumSoon
  2. Sets: interview questions & scenariosInterview Q&APremiumSoon

Queues & deques

ArrayDeque, PriorityQueue and heaps.

  1. Queue, Deque and ArrayDequeLessonPremiumSoon
  2. PriorityQueue and binary heapsLessonPremiumSoon
  3. Queues & deques: interview questions & scenariosInterview Q&APremiumSoon

Ordering & iteration

Comparable vs Comparator, iterators and ConcurrentModificationException.

  1. Comparable vs ComparatorLessonFreeSoon
  2. Fail-fast vs fail-safe iteratorsLessonPremiumSoon
  3. ConcurrentModificationException explainedLessonPremiumSoon
  4. Ordering & iteration: interview questions & scenariosInterview Q&APremiumSoon

Generics

Generics from basics to erasure and wildcards.

  1. Generics basicsLessonFreeSoon
  2. How type erasure worksLessonPremiumSoon
  3. Wildcards and PECSLessonPremiumSoon
  4. Bounded types and generic methodsLessonPremiumSoon
  5. Generics: interview questions & scenariosInterview Q&APremiumSoon

Utilities & patterns

Utility methods, immutable collections and real-world patterns.

  1. Collections and Arrays utility methodsLessonPremiumSoon
  2. Immutable collectionsLessonPremiumSoon
  3. Collections in action: real-world patternsLessonPremiumSoon
  4. Utilities & patterns: interview questions & scenariosInterview Q&APremiumSoon

Module interview question bank

Finish the module

Module interview question bank

Every interview question worth practising for Collections & Generics, grouped by topic, with model answers, how to say them and what-if follow-ups.

Being written: it grows as the topics in this module are finished

PremiumSoon