1Z0-829 Working with Streams and Lambda Expressions Practice Question
Which TWO are correct about parallel streams in Java? (Choose TWO.)
⚠ Common exam trap
Watch out — candidates often assume parallel streams are always faster (Option A) or that any lambda is safe (Option B), overlooking the critical requirements of statelessness and non-interference for correctness in parallel execution.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Parallel streams use the common ForkJoinPool by default.
Parallel streams in Java, by default, use the common ForkJoinPool (ForkJoinPool.commonPool()), which is a shared thread pool designed for parallel task execution. This pool is lazily initialized and has a default parallelism level equal to the number of available processors minus one, as per the ForkJoinPool implementation.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Parallel streams always improve performance over sequential streams.
Why it's wrong here
Performance depends on data size and operation complexity.
- ✗
Any lambda expression is safe to use in a parallel stream.
Why it's wrong here
Lambdas must be stateless and non-interfering.
- ✗
Using parallel streams guarantees the order of elements in the result.
Why it's wrong here
Order is not guaranteed unless using forEachOrdered.
- ✓
Parallel streams use the common ForkJoinPool by default.
Why this is correct
Default pool is ForkJoinPool.commonPool().
- ✓
To get correct results, operations should be stateless and non-interfering.
Why this is correct
Statelessness ensures correct parallel execution.
Go deeper
Related to this question
About these practice questions
One of 513 original 1Z0-829 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This 1Z0-829 practice question is part of Courseiva's free Oracle certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 1Z0-829 exam.