Panda Guru LogoPanda
Guru

Google L3 Phone Screen

Round 1

Questions:

Question

A town is building a watchtower. The watchtower is located at (0, 0). Each unit height of the watchtower has a cost H. There are N houses located at (x, y) coordinates. Each house will pay cost C if it comes under the surveillance of the watchtower. The horizontal distance covered by the watchtower is the same as its height. Find out the max profit you can make.

Inputs:

In the beginning, the watchtower was located at the origin. For the follow-up, he said the watchtower location will be provided. The (x, y) coordinates can be floats as well as H and C.

Question

Given two strings s1 and s2, find out if they only differ by the insertion of a phrase.

Example:

  1. The boy goes to the hospital
  2. The cute little boy goes to the hospital

'little boy' is the added phrase everything else is the same so return True

Example:

  1. The boy is nice.
  2. The girl is nice.

-> Return False

Candidate's Approach

For the first question, I was able to solve it in approximately 15 minutes. I understood the approach quickly. For the second question, I could only come up with the approach but didn't have enough time to write the code before the interview ended.

Interviewer's Feedback

The interviewer mentioned that he only had one question prepared and asked if I wanted to solve another one after I completed the first question.