Amazon·Software Engineer·Technical Phone Screen
- Given an array of non-negative integers and a target value T, assign a + or - sign to each number and count how many distinct sign assignments produce an expression that equals T.
- How does your solution handle arrays that contain zeros, and what happens when the total sum of the array is very large?
- Can you modify your solution to return one actual valid sign assignment, not just the count?
“I started with recursion, which felt natural, but then they asked me to compare it against memoization and a full iterative DP solution.”