Today I had a phone interview for software developer position at facebook. The interviewer asked me a variation of this problem https://leetcode.com/problems/continuous-subarray-sum/.
To be exact, Given a list of positive numbers and a target integer k, write a function to check if the array has a continuous subarray which sums to k.
I solved this using the hashmap method. The follow up question was that will my code work if negative numbers are allowed?
Next follow up question was to optimise the space complexity of the problem. She asked what if the list has million elements?
I was able to answer the follow up questions but with her help. Awaiting result.
EDIT: It was a reject!