Skip to content
javabypankaj
HomeLibraryPopularCommunity
06
Java Streams, Lambda & Functional Programming
30 topics · 328 questions
1Lambda Expressions0/552Functional Interfaces0/13133Method References0/554Default & Static Methods in Interfaces0/335Stream API Fundamentals0/886Stream: filter0/19197Stream: map & Transform0/34348Stream: flatMap0/779Stream: Sorting & Comparator0/232310Stream: reduce & Aggregate0/9911Stream: Grouping & Partitioning0/222212Collectors0/212113Optional0/9914Primitive Streams0/2215Stream Creation & Utilities0/181816Parallel Streams0/101017Stream: Exception Handling0/418Stream: Performance & Pitfalls0/5519Stream: Predict the Output0/7720Stream Practice: Employee Analysis0/434321Stream Practice: String & Character0/111122Stream Practice: Collections & Numbers0/111123Stream: Complex Pipelines0/8824Date/Time API0/2225Java 11 Features0/5526Java 17 Features0/3327Java 21+ Features0/101028Java 24/25 Preview0/8829Records0/1130Functional Programming Concepts0/22
1Lambda Expressions52Functional Interfaces133Method References54Default & Static Methods in Interfaces35Stream API Fundamentals86Stream: filter197Stream: map & Transform348Stream: flatMap79Stream: Sorting & Comparator2310Stream: reduce & Aggregate911Stream: Grouping & Partitioning2212Collectors2113Optional914Primitive Streams215Stream Creation & Utilities1816Parallel Streams1017Stream: Exception Handling418Stream: Performance & Pitfalls519Stream: Predict the Output720Stream Practice: Employee Analysis4321Stream Practice: String & Character1122Stream Practice: Collections & Numbers1123Stream: Complex Pipelines824Date/Time API225Java 11 Features526Java 17 Features327Java 21+ Features1028Java 24/25 Preview829Records130Functional Programming Concepts2
30 topics328 Qs0%
01Core Java17002OOP3203Collections6704Exception Handling2805Concurrency & Multithreading12706Java Streams, Lambda & Functional Programming32807Spring & Spring Boot2608Transactions3209JPA & Hibernate6910Microservices19411Kafka & Messaging9112DevOps, CI/CD & Tooling13313Database & SQL14114REST API & Web4015Design Patterns & LLD5716Advanced Java7117Coding Problems: DSA49218AWS & Cloud4119Data Engineering19420QA, Testing & SDET4121System Design3522Security2023Behavioral / HR: STAR Method37
30Topics
328Questions
0%Complete
17 of 30 topics
Topics
1Lambda Expressions0/552Functional Interfaces0/13133Method References0/554Default & Static Methods in Interfaces0/335Stream API Fundamentals0/886Stream: filter0/19197Stream: map & Transform0/34348Stream: flatMap0/779Stream: Sorting & Comparator0/232310Stream: reduce & Aggregate0/9911Stream: Grouping & Partitioning0/222212Collectors0/212113Optional0/9914Primitive Streams0/2215Stream Creation & Utilities0/181816Parallel Streams0/1010
17Stream: Exception Handling0/44
18Stream: Performance & Pitfalls0/5519Stream: Predict the Output0/7720Stream Practice: Employee Analysis0/434321Stream Practice: String & Character0/111122Stream Practice: Collections & Numbers0/111123Stream: Complex Pipelines0/8824Date/Time API0/2225Java 11 Features0/5526Java 17 Features0/3327Java 21+ Features0/101028Java 24/25 Preview0/8829Records0/1130Functional Programming Concepts0/22

Stream: Exception Handling

Java Streams, Lambda & Functional Programming·Topic 17 of 30·4 questions
Q1Checked exceptions in lambdas/streams: why awkward, handling options, trade-offs

Standard functional interfaces do not declare throws, so checked exceptions in lambdas require try-catch wrapping, a custom throwing interface, or a sneaky throw utility.

Read Answer
Q2How do you handle a checked exception inside a map() or forEach() lambda?

Stream functional interfaces cannot carry checked exceptions, so you must catch and rethrow as unchecked inside the lambda, or use a reusable wrapper utility.

Read Answer
Q3Write a utility method Function<T, R> unchecked(CheckedFunction<T, R> f) to wrap a checked function for use in streams

`unchecked(CheckedFunction)` adapts a checked-throwing lambda into a stream-compatible `Function` by catching and rethrowing as unchecked.

Read Answer
Q4How do you collect BOTH successful results and errors from a stream pipeline?

Map each element to a success-or-error result object, then partition into successes and failures so one bad element does not abort the whole pipeline.

Read Answer
Previous · Topic 16Parallel Streams10 questionsNext · Topic 18Stream: Performance & Pitfalls5 questions
javabypankaj© 2026 javabypankaj
PrivacyTerms
HomeSearchLibrary