Google SDE On campus
Company: Google
Role: L3 (SWE1)
Interview Stage: Onsite
Location: unknown
Year: unknown
Original Post Content:
First Round:
N passengers will be present, and you have to board some of them onto a ship with a maximum capacity of C. weights[] and values[] of the passengers will be given. You have to get the maximum total value, and the sum of weights should not be greater than C.
First, all the values will be the same. In a follow-up, values can be different for different passengers.
There was also a behavioral question: "Was there a time when you were leading a project and had a conflict of opinion with your teammate?"
Second Round:
A graph, source node, destination node, and corrupted node will be given. Return whether you can reach the destination node from the source node.
Return an array of minimum distances from the source node to all other nodes.
There will be a variable 'virality'. Nodes which are in the range of 'virality' distance from corrupted nodes will also be corrupted. Now return the same (reachability and minimum distances).
There can be multiple corrupted nodes.
Third Round:
Number of houses, color of the first house, and color of the last house will be given. Colors can be in the range of [1, K]. Number of combinations you can paint the other n-2 houses such that no two adjacent houses will have the same color.