Facebook | USA SF
Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2022-04-26Added By Anonymous
Source: Link
Company: Meta (Facebook)
Role: e4
Interview Stage: Onsite
Location: USA SF
Year: unknown
Original Post Content:
Phone Screen
Two Questions
- Subarray Sum equal to K, extension, what if divide sub array into two equal partsInput: [5,5,1,11], k = 2 Output = [[5,5,1], [11]]Input: [3,2,1,6, 2,4], k = 3, Output = [[ 3,2,1], [6], [2,4]]Input: [5,5,1], k = 3, Result = []
- Swap K digits to make it small.Input: [1,2,3,4,5], k = 1 --> Output [1,2,3,4,5]Input: [5,1,2,3,4], k = 1 --> Output [1,5,2,3,4]Input: [5,1,2,3,4], k = 2 --> Output [1,2,5,3,4]
Onsite
Coding Round 1
- Nested Integer Path Sum at each level
- Balance brackets. Only '(' ,')' are allowed with any random charactersInput: (a) Output -> (a)Input: ((a(( Output -> aInput: (A)()) Output -> (A)()
Coding Round 2
- [t,t,t, w,w,w,] maximise number of t, by replacing k 'w'.Input: [t,t,t,w,w,w]., k = 2 Output = 5Input: [t,t,t,w,t,w] k = 1 Output 3
- Remove consecutive characters from a stringInput: "aaabbb" Output: ""Input: "abbbab" Output "b"Input: "abc" Output "abc"
Design
- Typical design question, design Facebook Feed
Behavioral
- All scenario based questions