Screen
Design a restaurant que that has the following API enqueCustomer, serveCustomer, leaveCustomer where leaveCustomer allows a party to leave before being served.
Each customer is a party of x people. We need to be able to serve a first-come party when a table of an appropriate size becomes free. I realized that the free table could be >= x. If a first-come party is too big, next party of an appropriate size is served.
Virtual on-site
Q1 Video recommendations for Youtube. We are given a relationship map {v1:[v2,v3], etc.} where v2 and v3 are related to v1, etc. For v1, we need to recommend top k videos not related to v1 that share the most related videos with v1. Eg. {v1:[v2,v3], v5:[v3], v2:[v1], v3:[v1], v3:[v1,v2,v5]} Return v5 because it shares v3 with v1.
Q2 #329 https://leetcode.com/problems/longest-increasing-path-in-a-matrix/
Q3 Given some code commits that decrease performance, find all such bad commits.
We are given an API to call out in order to measure the performance: testPerf(commit_id).
---
-------------
-----It's a basic binary search with recursion. If the performance has not dropped in the range, don't recurse there.
Follow ups: some question requiring awareness of caching and multi-threading.
Like, what if each call to testPerf() takes a long time. Ans.: distribute b/w multiple computers,
use caching and multi-threading
Q4 Some easy file system or tree navigation question followed by a question on how to decide if a file system is valid. Turned out the interviewer wanted to distinguish forrest from a single tree. So, given a map of nodes and their types (file/dir) and relationships to other dir, find out whether the tree is a forrest.
Behavioral usual silliness
There was no Sys Design, as I chose L4 path.
I'm 10+ ye. Loc: California.