Frage im Vorstellungsgespräch bei Veeva Systems

first question - pseudo code style question about bubble sorting an array using threads - so it has O(n). Then 90 min code exam using their computer: public void merge(Path destination, List sortedFiles, int maxLines) throws Exception The method takes a list of paths to small files containing string lines, each file lexicographically sorted. It generates a file as described by the destination argument which contains all the lines from the small files. This file is also lexicographically sorted. At no point does the program have more than maxLines lines held in memory. Please build the most efficient algorithm to merge all the small, sorted files into one large sorted file. It will be tested on a huge file and be judged on correctness and time. If maxLines <= 2, throw Exception. NOTE: if you choose to multi-thread any part of the algorithm you choose—please keep the maxLines limitation across all threads.