Snap·Software Engineer·Technical Phone Screen
- You have a hand-built List backed by a dynamic array with standard operations (add, get, set, remove, size) and an Iterator (hasNext, next). Implement a map(fn) method that applies a given function to each element and returns a new List of the results, using only the Iterator and not touching the backing array directly. Then discuss generic typing where input and output types can differ, eager vs. lazy evaluation, and how laziness interacts with source list mutation.
“The coding part was fine.”