Facebook Phone Interview

Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2020-05-05Added By Anonymous
Source: Link

Company: Meta (Facebook)
Role: unknown
Interview Stage: Phone Screen
Location: unknown
Year: unknown

Original Post Content:

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!

Comments