Google Onsite Round 1 - L3/L4 SWE
Anonymous User
1503

Hi All,

I had my first onsite round today. I got asked a question on Quad Tree.

Question:
There is a quad tree, for a non-leaf pixels it has 4 children and all the children has either 'B' or 'W' color. Return the coordinate of a uniformly distributed 'B' pixel.

Example:

              [+]
           / |  |  \
       [B]  [+] [W] [B]
           / | | \
          [W][W][W][B]

Output: This quad tree has 9 'B' pixels, so return any randomly chosen coordinate from 1 to 9.

My Experience:
I was not aware about Quad Tree before and was not able to understand how there was 9 'B' pixels. Asked a lot of questions to the interviewer, but did not get anything from the interviewer. I just proposed and coded a normal dfs solution couting all the 'B's in the tree and returning a random number.

Although there are 3 more rounds left, is there any chances for me to get through the process since I feel I am going to get a SNH/ NH in this round, even if I get Positive feedbacks in the rest of the rounds?

Comments (14)