c****l 发帖数: 1280 | 1 I failed in the phone interview from a big IT company G yesterday, here is
the interview question, hope it is helpful.
1) five very large sorted array, want to find their intersection(
consider both space and time,e.g., i/o reading)
my idea: something like merge sort. to optimize the speed with concurrency,
use two threads, one do computation, the other do i/0 reading,
for computation thread:
1) have 5 indexes point to five arrays (e.g., array of indices),
2)compare if 5 elements are same,if |
|