Meta·Software Engineer·Technical Phone Screen
- Given an integer range [-M, M] and a list of inclusive integer intervals, find any integer in that range with the maximum coverage count across all intervals.
- Given the root of a BST and two integers low and high, return the sum of all node values in that range. Follow-up: if the tree is huge and you need to handle many different range queries, how would you preprocess it?
- Given logs of function start and end events with timestamps, compute the exclusive execution time for each function, accounting for nested calls.
“My first instinct was to just expand every interval and count hits in an array, which works but I knew they'd push back on it if M is huge.”