Status: Senior Software Engineer, BS CS
Position: Senior SE at Infuse
Location: San Francisco, CA
Date: October 1, 2019
I was interviewed today for a full-stack position in YouTube. The interviews were conducted through Google Hangout links and Google shared documents.
List of questions:
Given an N numbers in an array, you can remove K numbers either in the front or the end of the array. Return the maximum sum of the subarray after removing K elements. I stuck on this one and was not able to complete it. I was able to come up with a brute force solution with hints.
Behavioral Interview: I did quite well on this. Some questions asked are:
Suppose you work in a restaurant that opens 24 hour and the owner wants to know what could be some good break times (periods when there is no customer). You’re given a list of customers with time periods they get in and out the restaurant.
Customer 1: in 10:40, out: 11:20
Customer 2: in 10:55, out : 11:50
Customer 3: in 10:30, out: 12:00Return all time periods when the restaurant does not have any customers. She asked me to complete this function first:
function isBreakTime(Time t){
// return a boolean whether the given time is a good time to break
}interface Request {
int startTime;
int endTime;
int count;
string item;
} Write a function that returns the minimum inventory needed to fulfill the requests.
The following input:
startTime, endTime, count, item
10, 20, 5, 'pen' // someone needed 5 pens from t=10 to t=20
15, 23, 3, 'pencil' // someone needed 3 pencils from t=15 to t=23
15, 25, 7, 'pen' // someone needed 7 pens from t=15 to t=25 Would have the following output:
pen 12
pencil 3Again, I was unable to complete this one.
[1,4,8,9] arr1
[2,3,5,10] arr2
[3,5,11,17] arr3In this case we need 4 (from arr1) ,3 (from arr2), 3 (from arr3).
Because max-min = 1, which is the smallest combination you can find.
Therefore return 1
I was able to come up with a solution using minHeap to merge sorted arrays, but ran out of time when trying to find the min difference.