Facebook | SWE New Grad | London | January 2019 [Reject]
Company: Meta (Facebook)
Role: SWE New Grad
Interview Stage: Onsite
Location: London
Year: 2019
Original Post Content:
Status: MS CS at the University of Campinas and Software Developer at SAP
Position: Software Developer full time
Location: São Leopoldo, Brazil
I only show what I think was the most challenging question on my onsite interview because the others were similar to those I saw in this and other sources.
Question:
Given an array V and an integer k. V is filled with 0s and 1s which represent non-working and working days respectively. Find the largest sub-array that contains at most k working days. Write a function that returns the size of the previous sub-array. O(n) expected time complexity.
Variation of https://leetcode.com/problems/max-consecutive-ones-iii
Example 1:
input
V = [0,0,1,0,1,1,0,1] ; k = 2
output
5 // start at index 0 and end at 4 -> [0,0,1,0,1]
Example 2:
input:
V= [0,0,1,0,0,0,0] ; k = 5
output:
7 // the whole array
Example 3:
Input:
V = [1,1,1,1,1,1,1] ; k = 2
output:
선을 2 // any sub-array of length 2
Experience
It was a unique and incredible experience. LeetCode helped me so much to improve my abstraction and problem-solving skills. In my opinion, I think that technical questions went well. I solved them, optimized and explained. However, not everything is perfect, I think that the behavior interview did not go well, and my English skill was not enough to explain my ideas and way of thinking. Anyway, I learned a lot from this experience and I am so motivated for the next opportunities that come my way.
Let's continue practicing in LeetCode!!! :)