| 1 | How would you convert a checked-exception-throwing method into a lambda usable with a standard functional interface (which doesn't declare any checked exceptions), given standard interfaces like Function don't permit checked exceptions in their abstract method signature? Java › Functional Interfaces & Method References | Java | Functional Interfaces & Method References | Intermediate |
| 2 | How does Java's type inference determine the target type for a lambda expression in an ambiguous overload scenario, and what happens when a lambda could match multiple overloaded methods accepting different functional interfaces? Java › Functional Interfaces & Method References | Java | Functional Interfaces & Method References | Advanced |
| 3 | What is a functional interface, and what are the four core functional interfaces in java.util.function (Function, Predicate, Consumer, Supplier)? Java › Functional Interfaces & Method References | Java | Functional Interfaces & Method References | Beginner |
| 4 | What are the four kinds of method references in Java (static, instance-bound, instance-unbound, and constructor), and how does the compiler determine which form applies? Java › Functional Interfaces & Method References | Java | Functional Interfaces & Method References | Intermediate |
| 5 | How do the primitive-specialized functional interfaces (IntFunction, ToIntFunction, IntPredicate, IntUnaryOperator, etc.) avoid the performance cost of autoboxing, and when should you prefer them over the generic equivalents? Java › Functional Interfaces & Method References | Java | Functional Interfaces & Method References | Intermediate |
| 6 | How would you design a fluent, chainable validation API using functional interfaces, similar to how Comparator's thenComparing() works, but for validation rules that accumulate error messages rather than short-circuiting on the first failure? Java › Functional Interfaces & Method References | Java | Functional Interfaces & Method References | Advanced |
| 7 | How would you implement a custom functional interface with generic type parameters, and what considerations apply when designing one instead of reusing a built-in java.util.function interface? Java › Functional Interfaces & Method References | Java | Functional Interfaces & Method References | Advanced |
| 8 | How do the default methods andThen() and compose() on Function work, and what's the difference between them for chaining transformations? Java › Functional Interfaces & Method References | Java | Functional Interfaces & Method References | Intermediate |
| 9 | How does the Predicate interface's default methods and(), or(), and negate() enable composing complex boolean conditions from simpler ones? Java › Functional Interfaces & Method References | Java | Functional Interfaces & Method References | Intermediate |
| 10 | How would you use BiFunction combined with Stream's reduce() to implement a custom aggregation, and how does this relate to the more general concept of a fold operation in functional programming? Java › Functional Interfaces & Method References | Java | Functional Interfaces & Method References | Advanced |
| 11 | How do lambda expressions get compiled at the bytecode level using invokedynamic, and how does this differ from how an anonymous inner class implementing the same functional interface would be compiled? Java › Functional Interfaces & Method References | Java | Functional Interfaces & Method References | Advanced |
| 12 | What is the difference between UnaryOperator<T> and Function<T,T>, and why does UnaryOperator exist as a separate, more specific interface? Java › Functional Interfaces & Method References | Java | Functional Interfaces & Method References | Intermediate |
| 13 | What is the difference between a Consumer<T> and a BiConsumer<T,U>, and how would you use BiConsumer for operations needing two inputs but no return value, such as Map.forEach()? Java › Functional Interfaces & Method References | Java | Functional Interfaces & Method References | Intermediate |
| 14 | How does a lambda expression capture variables from its enclosing scope, and why must captured local variables be effectively final? Java › Functional Interfaces & Method References | Java | Functional Interfaces & Method References | Advanced |
| 15 | How would you implement memoization (caching function results) as a higher-order function wrapping an existing Function, and what thread-safety considerations apply for a memoized function used concurrently? Java › Functional Interfaces & Method References | Java | Functional Interfaces & Method References | Advanced |
| 16 | How would you use an interface with only static and default methods (no abstract methods at all) to build a fluent, extensible utility API, and what's a real JDK example of this pattern? Java › Interfaces & Abstract Classes | Java | Interfaces & Abstract Classes | Advanced |
| 17 | What is the Strategy pattern, and how do Java 8's functional interfaces and lambdas make implementing it significantly more concise than the traditional interface-plus-implementation-classes approach? Java › Design Patterns in Java | Java | Design Patterns in Java | Intermediate |
| 18 | How would you implement a callback or event listener using an anonymous class, and how does this same use case increasingly get replaced by lambda expressions for functional interfaces in modern Java? Java › Inner Classes & Anonymous Classes | Java | Inner Classes & Anonymous Classes | Intermediate |
| 19 | What is a delegate in C#, and how does it enable passing methods as values? C# › Delegates, Events & Lambdas | C# | Delegates, Events & Lambdas | Beginner |
| 20 | What is the purpose of the @FunctionalInterface annotation, and is it required for an interface to actually be treated as a functional interface? Java › Annotations | Java | Annotations | Intermediate |
| 21 | How do you write a generic method (as opposed to a generic class), and how does the compiler infer the type parameter from the arguments passed at a call site? Java › Generics | Java | Generics | Intermediate |
| 22 | How would you implement the Strategy pattern using an enum with constant-specific method bodies, and how does this compare to a traditional interface-based Strategy implementation? Java › Enums | Java | Enums | Advanced |
| 23 | How would you implement a generic pair/tuple utility method that returns different concrete types depending on the number of elements, and how does target-type inference help the compiler choose the correct generic instantiation from context alone? Java › Generics | Java | Generics | Advanced |
| 24 | What is a local class's access to effectively-final local variables, and how does this same rule (and the underlying reason for it) apply identically to anonymous classes and lambdas? Java › Inner Classes & Anonymous Classes | Java | Inner Classes & Anonymous Classes | Intermediate |
| 25 | How would you use TemporalAdjusters to compute dates like 'the next Monday' or 'the last day of the month' relative to a given LocalDate? Java › Java Date & Time API (java.time) | Java | Java Date & Time API (java.time) | Intermediate |
| 26 | How would you implement a custom Comparator with multiple sort criteria (e.g., sort by last name, then by first name as a tiebreaker) using the Comparator.comparing() and thenComparing() fluent API? Java › Collections Framework | Java | Collections Framework | Advanced |
| 27 | How does the var keyword (local variable type inference, introduced in Java 10) work, and what specific restrictions apply to where it can and cannot be used, given Java remains a statically-typed language? Java › Java Fundamentals: Syntax, Data Types & Operators | Java | Java Fundamentals: Syntax, Data Types & Operators | Advanced |