Google | L5 | USA | Jan 2022
Anonymous User
3269

I would like to share my Google Onsite interviews

Coding 1:

Given an 1D-array of values, return the shortest path to reach to end. below are contraints

  1. you can jump one step ahead or back
  2. you can jump directly from one value to another value if both are same.

Coding 2:

Design a data structure as extension of HashSet, with set(), remove(), getmembers() methods

when

set("apple") ==> increment counter and return
remove("apple") ==> return latest counter value
members(4) ==> return array of values in set for that counter

Example:
set("a") ==> 1
set("b") ==> 2
set("c") ==> 3
members(2) => ["a", "b"]
remove("b") ==> 3
set("d") ==> 4
members("4") => ["a", "c", "d"]

expected time complexity: set() -> O(1), remove() -> O(1), members -> O(n)

Coding 3:
similar to https://leetcode.com/problems/find-and-replace-in-string/

System design:
A stream of input events at a rate of 25K/sec. Design a system which processes the events and output at a rate of 1k/sec

Behavioural:

  1. Tell me when you didnt get along with a manager/team mate.
  2. In your opinion how the manager should be.
  3. In your opinion how the manager shouldn't be.
Comments (8)