Google | Onsite YouTube | Mountain View (Hangout) | 04/03/2020 [Rejected]

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:

  1. 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.

  2. Behavioral Interview: I did quite well on this. Some questions asked are:

    • Imagine you are a team lead of a project that has a deadline in 2 weeks. The team has 4 members, one of the members is suddenly gone. The manager said that you cannot postpone the deadline. The team members said that they cannot afford more work, as they are already busy with their current tasks. What would you do?
    • Do you think what diversity is (in a non-engineering aspect), and how it would benefit a company like Google?
    • Imagine you said something that one of your team members takes personally, and appears that he/she does not like you or talk to you normally anymore. What would you do?
    • Have you ever worked in a bad environment (could be from many things, like members not working hard enough, work-life balance issues, etc)? What would you do to improve the situation?
  3. 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:00

Return 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
}
  1. At Google, we have Tech Stops for checking out all types of equipment: pens, USB cables, chargers, etc. Once checked out, these items can be returned.
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 3

Again, I was unable to complete this one.

  1. Suppose you have a list of k sorted arrays, please come up with an function that selects one number from each array, such that
    the difference between the largest number and the smallest number among the k numbers is smallest.
    Just need to return the min min-max difference. For example when there are 3 sorted arrays:
[1,4,8,9]  arr1   
[2,3,5,10]  arr2
[3,5,11,17]  arr3

In 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.

Comments (5)