Java Streams learning path

Java developers preparing for coding rounds who want to learn the Streams API in order, from basics to internals.

42 questions4 levels12 must‑knowFree, no account

Your progress

L1 · 0 of 25L2 · 0 of 13L3 · 0 of 2L4 · 0 of 2

Level 1 · 25 questions. Begin with what gets asked in the first ten minutes. Levels 2 to 4 build on it.

Start with Level 1
Level 1First ten minutesTwo-sentence answers to what gets asked first.25 questions · 5 topics

Stream fundamentals

  1. 1.1Stream versus CollectionMust‑know1 min
  2. 1.2Intermediate versus terminal operationsMust‑know1 min
  3. 1.3Can a Stream be reused?1 min
  4. 1.4filter versus map1 min
  5. 1.5map versus flatMapMust‑know1 min

Searching and matching

  1. 2.1findFirst versus findAny1 min
  2. 2.2anyMatch versus allMatch versus noneMatchMust‑know2 min
  3. 2.3Names starting with a given character1 min
  4. 2.4Longest string in a list1 min
  5. 2.5Find maximum and minimum1 min

Counting and grouping

  1. 3.1groupingBy versus partitioningBy1 min
  2. 3.2Group employees by departmentMust‑know1 min
  3. 3.3Partition numbers into even and odd1 min
  4. 3.4Count character frequency in a stringMust‑know1 min
  5. 3.5Count word frequency in a sentence1 min
  6. 3.6Find duplicate elements in a list2 min
  7. 3.7First repeated character1 min

Sorting and aggregating

  1. 4.1Sort employees by salary1 min
  2. 4.2Sort strings by length with a tie-breaker2 min
  3. 4.3Salary sum and average2 min
  4. 4.4Employees earning above average salary1 min

Combining and collecting

  1. 5.1Remove duplicates using Streams1 min
  2. 5.2Common elements between two lists1 min
  3. 5.3Combine two lists into one2 min
  4. 5.4Join strings with a delimiter, prefix, and suffix2 min
Level 2Daily jobWhat you use at work every week.13 questions · 3 topics

How pipelines run

  1. 1.1What is lazy evaluation?Must‑know1 min
  2. 1.2map versus peek1 min
  3. 1.3reduce versus collect1 min
  4. 1.4Sequential versus parallel streams1 min

Frequency and ranking drills

  1. 2.1First non-repeated character1 min
  2. 2.2Find the most frequent elementMust‑know2 min
  3. 2.3Find the second-highest salaryMust‑know1 min
  4. 2.4Top 3 highest salaries1 min
  5. 2.5Nth highest salary1 min

Grouping and map drills

  1. 3.1Find the highest salary in each departmentMust‑know1 min
  2. 3.2Convert a list of employees to a map by idMust‑know1 min
  3. 3.3Sort a map by its valuesMust‑know2 min
  4. 3.4Move all zeroes to the end or the front2 min
Level 3SeniorProduction trade-offs and failure modes.2 questions · 1 topics

Parallelism and errors

  1. 1.1When should you avoid parallelStream?1 min
  2. 1.2How are exceptions handled in Streams?2 min
Level 4InternalsHow it works underneath, and at scale.2 questions · 1 topics

JDK internals

  1. 1.1How does distinct work?1 min
  2. 1.2How does sorted work internally?1 min