Parallel Streams QuizJ8 Home « Parallel Streams Quiz

The questions in this quiz on Java are on the topics covered in the Streams section of the site. The table below lists the lesson used for each quiz, a description of the lesson content and the quiz number and questions associated with that lesson.

Lesson Summary

Click on a lesson in the table to go to that lesson for a refresher on the topics for that quiz.

Click on a quiz in the table to go straight to the quiz for a particular lesson.

Generics Lessons Description Quiz Info.
Lesson 1 - Introducing StreamsIn our first lesson on on Streams we test your knowledge of the topics covered in the Introducing Streams lesson.Quiz1
9 questions
Lesson 2 - Stream PipelinesIn this lesson on streams we look at stream pipelines and how they work.Quiz2
9 questions
Lesson 3 - Stream Operations OverviewIn this lesson on streams we present an overview of the intermediate and terminal operations available.Quiz3
9 questions
Lesson 4 - Array Type StreamsIn this streams lesson we look at the various ways of creating streams from arrays.Quiz4
8 questions
Lesson 5 - Numeric StreamsIn this lesson on streams we look at numeric streams and the operations associated with them.Quiz5
7 questions
Lesson 6 - Other Stream CreationIn this lesson we take a final look at stream creation by creating streams from files, functions and iterations and also find out about creating infinite streams.Quiz6
9 questions
Lesson 7 - Finding & MatchingIn this streams lesson we look at the various ways of finding and matching values within our streams.Quiz7
9 questions
Lesson 8 - Reduction OperationsIn this streams lesson we look at reduction operations and how to use them.Quiz8
7 questions
Lesson 9 - Stream CollectorsIn this lesson we take a high level look at stream collectors by investigating the Collector<T,A,R> interface and the Collectors class implementation of it.Quiz9
8 questions
Lesson 10 - Collecting & Aggregating StreamsIn this lesson we look at how to create collections and aggregations from our streams.Quiz9
8 questions
Lesson 11 - Grouping & Partitioning StreamsThis lesson on streams is all about grouping & partitioning our streams.Quiz11
9 questions
Lesson 12 - Parallel StreamsThis lesson is all about parallel streams.This quiz.
8 questions

Streams Quiz 12

The quiz below tests your knowledge of the material learnt in Streams - Lesson 12 - Parallel Streams.

Question 1 : Which framework do parallel streams use.
- Parallel Streams use the <code>fork/join</code> framework.
Question 2 : We can run a parallel stream wherever we can run a sequential stream?
- We CAN run a parallel stream wherever we can run a sequential stream although this might not always be the best course of action!
Question 3 : Where is the parallel() method defined?
-The <code>parallel()</code> method is defined in the <code>BaseStream</code> interface.
Question 4 : Parallel streams are always faster than sequential streams?
- Parallel streams are NOT always faster than sequential streams and if used incorrectly can be a lot slower.
Question 5 : Which of these methods is not suitable for parallelizing?
- The <code>iterate()</code> method is NOT suitable for parallelizing as it is quintissentially sequential.
Question 6 : The parallel() method of the BaseStream interface is a terminal operation?
- The <code>parallel()</code> methof of the <code>BaseStream</code> class is an INTERMEDIATE operation.
Question 7 : Which of these primitive types works best with streams?
- The <code>int</code> primitive types works best with streams.
Question 8 : Parallel Streams are consumed after use?
- All Streams, parallel or squential, ARE consumed after use, meaning they can only be traversed once.
Quiz Progress Bar Please select an answer

What's Next?

Thats it for the streams quizzes, the next quizzes are on concurrency.