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
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: