DE Mastery GitHub

Java for data engineers · JVM-02

Collections and streams

From your world. a GROUP BY / window aggregation you'd write in SQL, expressed as a typed stream pipeline

Practice quiz with instant feedback. For a scored run that counts toward your local progress, use uv run de quiz JVM-02.

1Which stream pipeline computes SUM(amount) GROUP BY currency as a Map<String,Double>?
2When does a stream pipeline actually execute its intermediate operations (filter, map)?
3What is the difference between map and flatMap on a stream?
4Which idiom accumulates a per-key count into a Map<String,Integer> (the defaultdict(int) pattern)?
5You call List.of("a","b") then try list.add("c"). What happens?
6Why can a non-associative reduce function give a wrong answer on a parallel stream?
7What does orders.stream().max(Comparator.comparingDouble(Order::amount)) return?
8What is Order::amount as used in a stream?