Google | Onsite | Phone Interviews
Anonymous User
15859

Here are the questions I was asked during the google interviews(both phone screen as well as onsites). The position was general swe l4 and location USA.

Q1


Given a bishop on a 8*8 chessboard, find minimum number of moves required to
reach from a given starting point and end point

(Can be solved easily with BFS)

Q2:

Delete node in binary tree

Q3:


Q1: Given a function f, Design rate limiter such that we can't have
no more than k=5 executions of f in 1 second.
(Fixed window algorithms will not work, so I implemented dynamic window algo)

q2: Implement retry logic for failed executions of calls(caused by overflow in last question)
(essentially create another buffer for failed calls)

Q4:




Given a matrix with only 1s and 0s with exactly one square in the matrix,
find
1) the top left coordinate of square
2) area of square

Example: 
[[0, 0, 0, 0, 0],
[0, 0, 1, 1, 0],
[0, 0, 1, 1, 0],
[0, 0, 0, 0, 0]]

The output will be (2,1) and 4.

Q5:


Kth element in 2 sorted arrays

Given two sorted arrays find the kth smallest element in the two arrays

Q6:
https://leetcode.com/problems/lfu-cache/

Q7:


https://leetcode.com/discuss/interview-question/125301/Find-longest-consecutive-path-in-a-matrix

Essentially this question but a starting point is given.
So it is not the max possible length overall but max possible length from a given starting point

my Amazon interview questions set is here

https://leetcode.com/discuss/interview-question/881967/Amazon-or-Onsiteor-July-2020-Interview-Questions

Comments (30)