Skip to content
Preptima

Streams & Functional Java interview questions

Lazy evaluation, collectors, parallel streams, and the readability and performance traps.

4 questions in Java & Spring.

medium3

mediumConceptCoding

Streams are lazy until a terminal operation runs. Why does that matter, and when would you make one parallel?

Laziness means intermediate operations only describe a pipeline, so nothing traverses the source until a terminal operation pulls, and short-circuiting operations can stop early. Parallel helps when the source splits evenly, the work per element is CPU-bound and substantial. Use this streams answer to show the decision, trade-off, and evidence rather than a memorised definition.

5 minmid, senior

hard1