← Adobe Interview Insights

Adobe·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

Adobe technical screen for a software engineer role, basically one big Java Streams question broken into four parts. The whole thing felt like a functional programming deep-dive and I was not fully prepared for the Collector API stuff.

Questions Asked (4)

Q1

Given a Student class with name, grade, and subject fields, implement a method that returns a Collector grouping students by subject and computing the average grade per subject using Java Streams.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

This one I got through okay.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the method signature and expected return type, then use Collectors.groupingBy with a downstream averaging collector. Explain the use of averagingInt or averagingDouble and how to handle potential edge cases like null subjects or empty groups.

Pro tip: Mention that averagingInt returns a Double, so the collector type should be Map<String, Double>. Also, consider using teeing or a custom collector if you need both sum and count for weighted averages, but for simple average, averagingInt is sufficient.

1. Clarify requirements

Confirm the method signature, return type, and whether the average should be a double or rounded. Ask about null handling and empty collections.

2. Choose the right collectors

Use Collectors.groupingBy with a classifier function (Student::getSubject) and a downstream collector Collectors.averagingInt(Student::getGrade) or averagingDouble.

3. Implement the stream pipeline

Write the stream: students.stream().collect(groupingBy(Student::getSubject, averagingInt(Student::getGrade))). Ensure the return type matches Map<String, Double>.

4. Handle edge cases

Discuss handling null subjects (filter or use Optional) and empty student list (returns empty map). Mention potential integer division if using averagingInt incorrectly.

5. Test and verify

Mention writing unit tests with sample data to verify correct grouping and average calculation, including edge cases.

Key Points to Mention

  • Collectors.groupingBy with downstream collector
  • Collectors.averagingInt or averagingDouble
  • Return type Map<String, Double>
  • Null handling for subject field
  • Performance considerations for large datasets
  • Alternative using summingInt and counting for custom average

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

Implement a method that returns a Predicate<Student> filtering students in a given subject whose grade exceeds a specified threshold.

Algorithms & Data Structures
Author's notes

Easiest part of the whole thing.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the method signature and the expected behavior, then implement a lambda that checks both the subject and grade threshold. Emphasize that the returned Predicate should be reusable and thread-safe, and discuss potential null handling.

Pro tip: Mention that you would make the Predicate serializable if it might be used in distributed systems, and consider performance by avoiding unnecessary object creation.

1. Clarify requirements

Ask about the Student class structure, how subject and grade are represented, and whether nulls are possible. Confirm the method signature and return type.

2. Design the Predicate

Decide to return a lambda that captures the subject and threshold. Ensure it handles edge cases like null student or null subject.

3. Implement the method

Write the method body, using a lambda expression that checks student's subject equals the given subject and grade > threshold.

4. Test and validate

Mention writing unit tests to cover cases like matching subject with grade above/below threshold, different subjects, and null inputs.

5. Discuss improvements

Talk about making the Predicate serializable, using method references if applicable, and performance considerations.

Key Points to Mention

  • Lambda expressions and functional interfaces in Java
  • Null safety and defensive programming
  • Immutability and thread safety of the returned Predicate
  • Serializability of lambdas for distributed use
  • Performance: avoiding autoboxing and unnecessary object creation
  • Testing strategies for Predicate logic

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q3

Implement a method that returns a Stream<Student> of the top N students in a given subject, sorted by grade in descending order.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

Tripped up briefly on chaining filter, sorted with Comparator.comparingDouble reversed, then limit.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the input data structure and requirements (e.g., how students and grades are stored, what 'top N' means for ties). Then propose an efficient algorithm using a priority queue (min-heap) to find the top N in O(M log N) time, where M is the number of students, and finally return a stream sorted in descending order. Discuss trade-offs between sorting all students (O(M log M)) and using a heap, and mention edge cases like N > M or missing grades.

Pro tip: Mention that you would use a bounded priority queue to avoid sorting the entire list, and that you'd handle ties by defining a secondary sort key (e.g., student ID) to ensure deterministic output. This shows awareness of real-world data and performance.

1. Clarify requirements and constraints

Ask about the data source (e.g., list of students, map of grades), whether grades are numeric, how to handle ties, and if N can exceed the number of students. Confirm that the output must be a Stream and sorted descending.

2. Choose the right data structure and algorithm

Decide between full sort (simple but O(M log M)) and a min-heap of size N (O(M log N)). Explain that for large M and small N, the heap is more efficient, but for small M, sorting may be simpler.

3. Implement the selection logic

Iterate through students, maintaining a min-heap of the top N grades. For each student, if the heap size is less than N, add; else if grade is higher than the heap's minimum, replace. This keeps the top N without sorting all.

4. Sort and return as a Stream

Extract the heap elements, sort them in descending order (e.g., using a stream sorted with reverse comparator), and return the resulting Stream<Student>. Ensure the stream is lazy if possible, but note that sorting requires materialization.

5. Discuss edge cases and optimizations

Handle N <= 0 (return empty stream), N > M (return all sorted), and ties. Mention potential parallelization for large datasets or using Java's Stream API with a custom collector.

Key Points to Mention

  • Time and space complexity: O(M log N) time with O(N) space for heap vs O(M log M) time for full sort.
  • Use of a min-heap (PriorityQueue) to efficiently maintain the top N elements.
  • Handling ties by defining a secondary comparison (e.g., student name or ID) for deterministic ordering.
  • Edge cases: N <= 0, N > number of students, null or missing grades.
  • Java Stream API: using sorted() with Comparator.reverseOrder() and limit(N) if sorting all, or custom collector for heap approach.
  • Trade-offs: simplicity of full sort vs efficiency of heap for large datasets; memory considerations.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q4

Implement a method that returns a Collector computing the median grade per subject, using idiomatic Stream and Collector pipelines without any imperative loops.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

This is where things got rough.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the input data structure (e.g., a stream of Student objects with subject and grade) and the desired output (a Map from subject to median grade). Then design a Collector that groups grades by subject and computes the median for each group, using a downstream collector that collects grades into a list and then calculates the median. Emphasize that the entire pipeline is declarative, using Stream and Collector APIs without explicit loops.

Pro tip: Mention that for large datasets, collecting all grades per subject into a list may be memory-intensive; you could instead use a custom collector that maintains a sorted structure or uses a counting approach, but for clarity and typical interview scenarios, the list-based approach is acceptable. Also, note that median calculation requires sorting, which is O(n log n) per subject, and discuss potential parallelization considerations.

1. Clarify Input and Output

Confirm the input type (e.g., Stream<Student> with getSubject() and getGrade()) and the expected output (Map<String, Double> mapping subject to median grade).

2. Design Grouping Collector

Use Collectors.groupingBy to group students by subject, with a downstream collector that extracts grades and collects them into a List<Double>.

3. Implement Median Calculation

For each subject's list of grades, sort the list, then compute the median: if odd size, middle element; if even, average of two middle elements.

4. Combine into a Single Collector

Create a custom Collector that performs grouping and median calculation in one pass, or use a collectingAndThen to transform the grouped map into medians.

5. Discuss Trade-offs and Edge Cases

Address handling of empty groups, null values, and performance implications; mention alternative approaches like using a custom accumulator for large data.

Key Points to Mention

  • Use of Collectors.groupingBy with a downstream collector to extract grades.
  • Median calculation: sorting and handling odd/even list sizes.
  • Avoiding imperative loops by leveraging Stream and Collector APIs.
  • Potential memory overhead of collecting all grades per subject and possible optimizations.
  • Edge cases: empty input, subjects with no grades, and null handling.
  • Parallel stream considerations and thread safety of collectors.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.