Phone interview: 1) Code up merge step in merge sort. 2) Conceptually describe how you would implement an LRU cache. On site: 1) Extremely tricky question I am still working on! 2) Implement in-order traversal of a binary search tree. Implement a schedule that takes as input some number of appointments within a 24 hour period and outputs all the free blocks of time.
Anonymous
For the scheduling problem, create an array of 24 indexes (for the hours in a day). Then iterate over each schedule and place some value into each index in the array that indicates that that hour is taken (like a 1). Then after this, iterate over the array to find the values != 1. Each of these values will correspond to an hour in the day that is free. Whole process takes O(schedule size + 24) = O(schedule size)
Check out your Company Bowl for anonymous work chats.