Courseiva
Knowledge + Practice
CertificationsVendorsCareer RoadmapsLabs & ToolsStudy GuidesGlossaryPractice Questions
C
Courseiva

Free IT certification practice questions with explained answers for CCNA, CompTIA, AWS, Azure, Google Cloud, and more.

Certification Practice Questions

CCNA practice questionsSecurity+ SY0-701 practice questionsAWS SAA-C03 practice questionsAZ-104 practice questionsAZ-900 practice questionsCLF-C02 practice questionsA+ Core 1 practice questionsGoogle Cloud ACE practice questionsCySA+ CS0-003 practice questionsNetwork+ N10-009 practice questions
View all certifications →

Product

CertificationsCertification PathsExam TopicsPractice TestsExam Dumps vs Practice TestsStudy HubComparisons

Company

AboutContactEditorial PolicyQuestion Writing PolicyTrust Center

Legal

Privacy PolicyTerms of Service

Courseiva is a free IT certification practice platform offering original exam-style practice questions, detailed explanations, topic-based practice, mock exams, readiness tracking, and study analytics for Cisco, CompTIA, Microsoft, AWS, and other technology certifications.

© 2026 Courseiva. Courseiva is operated by JTNetSolutions Ltd. All rights reserved.

Courseiva is an independent certification practice platform and is not affiliated with, endorsed by, or sponsored by Cisco, Microsoft, AWS, CompTIA, Google, ISC2, ISACA, or any other certification vendor. Vendor names and certification marks are used only to identify the exams learners are preparing for.

HomeCertifications1Z0-829TopicsWorking with Streams and Lambda Expressions
Free · No Signup RequiredOracle · 1Z0-829

1Z0-829 Working with Streams and Lambda Expressions Practice Questions

20+ practice questions focused on Working with Streams and Lambda Expressions — one of the most tested topics on the Oracle Certified Professional Java SE 17 Developer 1Z0-829 exam. Each question includes a detailed explanation so you learn why the right answer is correct.

Start Working with Streams and Lambda Expressions Practice

Exam Domains

Handling Date, Time, Text, Numeric and Boolean ValuesControlling Program FlowUtilizing Java Object-Oriented ApproachHandling ExceptionsWorking with Arrays and CollectionsWorking with Streams and Lambda ExpressionsJava Platform Overview and PackagingAll domains →

Study Tools

Practice TestMock ExamFlashcardsAll Topics

Sample Working with Streams and Lambda Expressions Questions

Practice all 20+ →
1.

A company processes financial transactions. Each transaction is represented by a Transaction object with fields: amount (double), currency (String), and type (String). The requirement is to compute the total amount of all transactions of type 'SALE' in USD. The transactions are stored in a List<Transaction>. Which code correctly accomplishes this using streams?

A.transactions.stream().mapToDouble(Transaction::amount).filter(t -> t.type().equals("SALE")).sum()
B.transactions.stream().filter(t -> t.type().equals("SALE")).filter(t -> t.currency().equals("USD")).mapToDouble(Transaction::amount).sum()
C.transactions.stream().map(Transaction::amount).reduce(0.0, (a, b) -> a + b)
D.transactions.stream().filter(t -> t.type().equals("SALE") && t.currency().equals("USD")).mapToDouble(Transaction::amount).sum()

Explanation: Option D correctly filters transactions to only those with type 'SALE' and currency 'USD', then maps each to its amount as a double, and sums them using sum(). This satisfies the requirement exactly: total amount of 'SALE' transactions in USD.

2.

A developer writes the following code using the Stream API: List<String> list = List.of("a", "b", "c"); String result = list.stream().reduce("", (s1, s2) -> s1 + s2); System.out.println(result); What is the output?

A.abc
B.a
C.Optional[abc]
D.cba

Explanation: The correct answer is A because the `reduce` method with an identity value (`""`) and a binary operator (`(s1, s2) -> s1 + s2`) accumulates the stream elements in encounter order. Starting from the identity, it concatenates each element: `"" + "a" = "a"`, then `"a" + "b" = "ab"`, then `"ab" + "c" = "abc"`. The result is a `String`, not an `Optional`, because an identity is provided.

3.

A developer needs to process a stream of integers and collect the results into a Map<Integer, List<Integer>> where keys are the integers themselves and values are lists containing the number and its square. Which collector should be used?

A.Collectors.toMap(Function.identity(), i -> Arrays.asList(i, i * i), (v1, v2) -> v1)
B.Collectors.groupingBy(Function.identity(), Collectors.mapping(i -> i * i, Collectors.toList()))
C.Collectors.toMap(Function.identity(), i -> Arrays.asList(i, i * i), (v1, v2) -> v1, HashMap::new)
D.Collectors.toMap(Function.identity(), i -> i * i)

Explanation: Option C is correct because it uses the four-argument overload of `Collectors.toMap()`: a key mapper (`Function.identity()`), a value mapper (a lambda that creates a `List<Integer>` containing the number and its square), a merge function (`(v1, v2) -> v1`) to handle duplicate keys (which won't occur here since keys are unique integers), and a `HashMap::new` supplier to ensure the map type is explicitly `HashMap`. This satisfies the requirement of producing a `Map<Integer, List<Integer>>` where each key maps to a list of the number and its square.

4.

A developer writes: List<Integer> list = List.of(1, 2, 3); Optional<Integer> opt = list.stream().reduce((a, b) -> a + b); System.out.println(opt.get()); What is the result?

A.6
B.Optional[6]
C.Optional.empty
D.NoSuchElementException

Explanation: The `reduce` method with a single argument (a `BinaryOperator`) returns an `Optional` because the stream might be empty. Here, the stream contains three integers, so the reduction computes `1 + 2 = 3`, then `3 + 3 = 6`, yielding `Optional[6]`. Calling `get()` on a non-empty `Optional` returns the contained value `6`, which is printed.

5.

Which statement about the Stream API is true?

A.Parallel streams always improve performance.
B.Streams are always finite.
C.Intermediate operations are executed eagerly.
D.A stream can be consumed only once.

Explanation: Option D is correct because a Stream in Java represents a sequence of elements that can be traversed only once. Once a terminal operation (like collect() or forEach()) is invoked on a stream, the stream is consumed and cannot be reused; attempting to do so throws an IllegalStateException. This one-time consumption is a fundamental design principle of the Stream API, ensuring that operations are applied to a single, immutable pipeline.

+15 more Working with Streams and Lambda Expressions questions available

Practice all Working with Streams and Lambda Expressions questions

How to master Working with Streams and Lambda Expressions for 1Z0-829

1. Baseline your knowledge

Start with 10 questions to gauge your current understanding of Working with Streams and Lambda Expressions. This tells you whether you need a concept refresher or just practice.

2. Review every explanation

For each question — right or wrong — read the full explanation. Understanding why an answer is correct is more valuable than knowing the answer itself.

3. Focus on exam traps

Working with Streams and Lambda Expressions questions on the 1Z0-829 frequently use trap wording. Look for subtle differences in answers that test your precision, not just general knowledge.

4. Reach 80% consistently

Do repeated sessions until you score 80%+ three times in a row. Then move to mixed-mode practice to test cross-topic recall under realistic conditions.

Frequently asked questions

How many 1Z0-829 Working with Streams and Lambda Expressions questions are on the real exam?

The exact number varies per candidate. Working with Streams and Lambda Expressions is tested as part of the Oracle Certified Professional Java SE 17 Developer 1Z0-829 blueprint. Practicing with targeted Working with Streams and Lambda Expressions questions ensures you can handle any format or difficulty that appears.

Are these 1Z0-829 Working with Streams and Lambda Expressions practice questions free?

Yes. Courseiva provides free 1Z0-829 practice questions across all exam topics and domains. The platform includes topic-based practice, mock exams, missed-question review, bookmarked questions, and readiness tracking — no account required.

Is Working with Streams and Lambda Expressions one of the harder 1Z0-829 topics?

Difficulty is subjective, but Working with Streams and Lambda Expressions is a high-priority exam concept tested in multiple ways — direct recall, scenario analysis, and command-output interpretation. Consistent practice is the best way to build confidence.

Ready to practice?

Launch a full Working with Streams and Lambda Expressions practice session with instant scoring and detailed explanations.

Start Working with Streams and Lambda Expressions Practice →

Topic Info

Topic

Working with Streams and Lambda Expressions

Exam

1Z0-829

Questions available

20+