Google | Onsite | L4
Anonymous User
1860
Jun 05, 2020

Due to NDA I won't get into exact details of the questions, but will give an overview.

Question 1

Given a map representing an organizational hierarchy (Map<String, ArrayList<String>>) and an employee (String), return the overall size of the given employee's org structure.

Follow up: how could this be optimized for future calls to not require recomputing previous results counts?

Question 2

Given a random string that is either a hexadecimal color or RGB, optimize the string for shortest length possible. Hexadecimal strings can be shortened if there air pairs.

Question 3

Given a starting and endpoint point and list of valid points, find the path to the endpoint point (breadth first search).

Follow up: How could it be optimized in a case where the starting point is not provided immediately, but given later?

Follow up: How would you determine a point to remove as a possible starting point that would result in the highest percentage of removed solvable paths?

Question 4

Given an array of elements, find all consecutive contiguous subarrays for a given element and return the total count.

Question 5

Do a level order traversal of a binary tree and print each level.

Comments (8)