Hi Leetcoders,
I've just completed two interview rounds with google for the Web Solution Engineer.
It started with a basic introduction. Then he gave me a problem to create a set from scratch that stores tuples of the form (key, timestamp, value). I had to implement a get(key, timestamp) method, which returns the value for the given key and timestamp. If the exact timestamp is not present, it should return the value for the largest timestamp less than the given one.
I created a map with the key mapped to a list of arrays of size two, where each array contained the timestamp and the corresponding value. To retrieve a value, I sorted the list based on timestamps and applied binary search on the sorted list. Later, I optimized the solution using a TreeMap. Initially, I only provided the first solution and then discussed the optimized approach with him, as he wanted me to start with the basic implementation.
I was given a problem - Given the locations of friends and cafes, and the paths between various locations, we need to find the cafe such that the maximum time taken by any friend to reach that cafe is minimized.
Applied BFS
If we enter a URL and hit enter, but nothing loads on the web page, what should we do? One more question was asked on web technologies, but I don't remember it.