← Wells Fargo Interview Insights

Wells Fargo·Software Engineer·Technical Phone Screen·Intermediate

IntermediatePrefer not to say
Jun 2026Remote

Summary

Wells Fargo software engineer round, pretty much one coding question the whole time. They wanted a Java Streams solution for finding the max salary in a list of employees, no loops allowed, and the empty-list edge case had to return an empty Optional. Felt manageable but the constraints tripped me up a bit.

Questions Asked (1)

Q1

Given a list of Employee objects, use the Java Stream API to find the highest salary. No explicit loops, no external mutable state. Return an OptionalLong that is empty when the list is empty.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

I knew mapToLong and max were the right tools but I second-guessed myself on whether OptionalLong.empty() would come back automatically for an empty stream.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Use the Stream API's mapToLong to extract salaries, then call max() which returns an OptionalLong. This handles empty lists gracefully by returning an empty OptionalLong, and avoids explicit loops or mutable state.

Pro tip: Mention that max() on an empty stream returns OptionalLong.empty(), so no extra null checks are needed. Also, consider parallelization for large datasets, but note that it may not always improve performance due to overhead.

1. Understand the requirement

Clarify that the method should return an OptionalLong, empty if the list is empty, and that no explicit loops or external mutable state are allowed.

2. Choose the right stream operations

Use mapToLong to convert each Employee to its salary, then call max() to find the highest value.

3. Handle empty list

Rely on max() returning OptionalLong.empty() for an empty stream, so no additional checks are needed.

4. Consider performance and trade-offs

Discuss whether to use parallelStream() for large lists, and mention that it may not always be beneficial due to overhead.

5. Write clean, readable code

Implement the method succinctly, ensuring it is functional and easy to understand.

Key Points to Mention

  • Use of mapToLong to extract primitive long salaries, avoiding boxing overhead.
  • max() returns OptionalLong, which naturally handles empty streams.
  • No explicit loops or mutable state, adhering to functional programming principles.
  • Potential use of parallelStream() for performance, with caveats about overhead and thread safety.
  • Time complexity: O(n) for sequential stream, O(n/p) for parallel with p threads, but with overhead.
  • Readability and maintainability of stream-based code.

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