Google Onsite
Anonymous User
10222

Hi LeetCode Community,
I recently went through the google onsite interview. I had a total for 3 coding rounds and 1 behavioural. Below are the questions I was asked.

Coding Round 1:
Given 2 images as a 2d matrix of size MN And KN. Find maximum overlapping part i. maximum bottom rows of first matrix which matches with the top rows of the second matrix
Eg. Matrix 1
[1,2,3,4]
[3,4,2,5]
[1,2,4,1]

Matrix 2
[3,4,2,5]
[1,2,4,1]
[1,5,7,8]
[7,5,7,3]

In above example answer is 2

Coding Round 2:
It was similar to merge intervals https://leetcode.com/problems/merge-intervals/ but with a bit modification.
Given Starting intervals we'll get 2 type of queries

  1. Add intervals
  2. Search for a particular number

eg:
Given initial intervals as : [[1,3],[2,6],[8,10],[15,18]]
Q queries
[1 4 5] => 1 represent query of type 1 and 4-5 is interval
[2 2] => 2 represent query of type 2 search for element 2

Coding Round 3:
This was the exactly similar to https://leetcode.com/problems/shortest-distance-from-all-buildings/ with a slight modification.

Behavioural Round
I was asked basic questions related to my work and my experience

Thanks to this community I was able to went through the interview but still it is a long way for me.

Comments (21)