Facebook/Meta Tech Screen (Jan 28, 2022)

Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2022-01-29Added By Anonymous
Source: Link

Company: Meta
Role: unknown
Interview Stage: Phone Screen
Location: unknown
Year: 2022

Original Post Content:

Got asked the following two questions in an initial tech screen (45 min):

1. Continuous Subarray Sum
A slightly simpler variation of https://leetcode.com/problems/subarray-sum-equals-k/. Return true or false rather than total number of matches.

Note: One thing that threw me for a loop is assuming input array is all zero or positive integers. It lead me to begin a two-pointers/sliding-window solution. However, half way through I asked if negative integers were allowed and they were. An important detail as it changes the solution. Two-pointers/sliding-window approach no longer works and a PreSum & HashMap solution is needed.

2. Deep Copy Linked List with Random Pointers

Identical to https://leetcode.com/problems/copy-list-with-random-pointer/ with no modifications.

Comments