Google | Onsite | India | Dec 2021 | [Reject]
Anonymous User
6611

Work experience: 2.5 years at a semiconductor product based MNC as developer.
Screening Round Experience

Onsite round 1: 1 question -> 23/11/21 (45 mins)
Interviewer was from Google India.

Question: Given a 2D matrix of numbers, where rows are some card and columns are properties (value of properties ranges from 0-2), find whether given card combination form a valid set.
Valid set: They all have the same values or have all different values for each property.
Ex:

Example 1
Card 1: (0, 2, 0, 0)
Card 2: (1, 1, 1, 2)
Card 3: (2, 0, 2, 1)
Ans: Valid set

Example 2
Card 1: (1, 2, 0, 0)
Card 2: (1, 1, 1, 2)
Card 3: (0, 0, 2, 1)
Answer: Invalid set

Gave a solution of traversal of whole 2D array and keeping a hashmap for every properties column. Interviewer seemed satisfied.
Time: O(n.p) n=card num, p=no of properties
Space: O(n) , n=num of card

Followup question 1: Some values of properties were now replaced with wildcard star. Gave a similar solution by just adding one extra check statement.

Followup question 2: Pick a combination of 3 cards from the total set which are valid set. Gave a solution of firstly finding unique cards then checking for valid properties. Gave a O(n.p) solution. She seemed she was expecting a more optimised approach, and I was nearly blank by the end.

Time: O(n.p + n.3 * 3.p)
Space: O(n+3) , n=num of card

Onsite round 2: 1 question -> 23/11/21 (45 mins)
Interviewer was from Google India.

Question: Decision based DP question. Like House robber or Buy and Sell stock 4. Gave a recursion based memiozed approach. Ran it on his multiple test cases. Interviewer was impressed and didnt asked any further.

Onsite round 3: 1 question -> 24/11/21 (1 Hour)
Interviewer was from Google India.

Question: Given a n-array tree, for every query of type a b c d, give what will be the size of resulting trees if edge between a and b and between c and d are removed.
Note: Every removal of nodes is valid for only that query. Which means after a query is done, tree goes back to initial state.
Ex:

For tree
                       1
				2             3
			4  8    5      6      7
			
Query: 4 2 1 3
Result: [1, 4, 3]
Explain: On removing the edge between 4 and 2 two trees are formed of 1 and 7 size and on removing the edge between 1 and 3 final trees formed are of size 1 4 3

First gave a solution of tree traversal for every query which was O(n.q), n is tree nodes and q is no of queries. Later gave a solution of creating a data structure of parent child information (similar to union-set, though i didnt knew at that time), where this fetching of who is parent and who is child was done in O(1) and subtracted that size of child with parent to give the result. So for q queries it was O(q). Later found it was failing for a few test cases where a b c d of query was intermixing. Handled those cases separately. Interview has overshoot the time of 45 mins by 15 mins. Interviewer looked okay though not very happy. Maybe he was expecting some other method.

Time: O(q), q is no of queries
Space: O(n), n is no of nodes

Onsite round 4: Googliness round -> 24/11/21 (45 mins)
Interviewer was from Google India and the questions were senario based hr questions.

Update: Got the rejection call from recruiter. Got 2 positive review (round 2 & 4) and an avg (round 1) and negative review (round 3).

Comments (19)