Reduction Operations QuizS2C Home « Reduction Operations 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
7 questions
Lesson 8 - Reduction OperationsIn this streams lesson we look at reduction operations and how to use them.This quiz.
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.Quiz12
8 questions

Streams Quiz 8

The quiz below tests your knowledge of the material learnt in Streams - Lesson 8 - Reduction Operations.

Question 1 : Which of the following is a specialised reduction operation of the Stream interface?
- The <code>max()</code> method is a specialised reduction operation of the <code>Stream</code> interface.
Question 2 : All reduction operations are terminal?
- All reduction operations ARE terminal.
Question 3 : What is returned from the single parameter reduce() method?
- An <code>Optional</code> is returned from the single parameter <code>reduce</code> method to remove <code>NullPointerException</code> scenarios.
Question 4 : All the specialised reduction operations return an Optional?
- <code>min()</code> and <code>max()</code> return an <code>Optional</code> but <code>count()</code> returns a long.
Question 5 : reduce() is one of the general reduction operations, what is the other?
- <code>collect</code> is a general reduction operation, the others answers are specialised reduction operations.
Question 6 : The reduce() general reduction operation is the most efficient way of getting aggregates from streams?
- The <code>reduce()</code> general reduction operation is NOT the most efficient way of getting aggregates from streams as elements require boxing.
Question 7 : It is not possible to return null from a specialised reduction operation?
- It is NOT possible to return <code>null</code> from a specialised reduction operation, <code>count()</code> will return <code>0</code> and <code>min()</code> and <code>max()</code> will return <code>Optional.empty</code>.
Quiz Progress Bar Please select an answer

What's Next?

In the next quiz we test your knowledge of stream collectors.