Onsite. They gave me a long chunk of existing code and asked me to implement a function based on it.
Essentially there's a fetch(page) function that returns the items on that page along with the next page's nextPage. We needed to implement fetch_n as a method on another class, so that we could pull n elements continuously. Each call continues extracting from wherever the last call left off, so the class needs to buffer whatever was left over from the last fetch but not yet returned.
Just understand the problem, nail down the input/output with the interviewer, and handle the edge cases well -- nothing particularly tricky about it. The follow-up was: since fetch is an upstream call that could be unstable, how would you design this function to handle that?
VO: a job scheduler question. Given a list of tasks (each with a start time in 24-hour format and a duration in minutes), use as few workers as possible to schedule all the tasks. A worker can process multiple tasks one after another (one at a time), and when there are multiple idle workers, pick the one with the lowest index. Print out the resulting assignment based on this (indexed by the order the tasks start in).
The approach is greedy: sort by start time first, then maintain a (end_time, worker_index) heap to track which workers are idle. Go through the tasks once and assign each one based on whatever's at the top of the heap.
SD was a distributed web crawler, based on crawling Wikipedia. Honestly I didn't know this topic that well, and I didn't organize my answer well either.
HM was all pretty standard stuff.
Talking to them throughout, I got the sense that Lyft's engineers didn't seem particularly passionate about tech anymore, and didn't seem to have a direction they were especially excited to work on. But the company sounded pretty stable.
Discussion
Loading comments…