First question: Merge files https://leetcode.com/discuss/interview-question/1112834/Amazon-OA-SDE-2
Second question:
Give you a list of frontapp tasks idx and its required memory, each list first value is its unique id and second value is its required memory.
front = [[1,2],[2,4],[3,5]] etc
And a list of backapp tasks as well. end = [[1,3],[2,2],[3,10]]
Requirement: there is one device with max capacity of targetCapacity. This device only supports one task of frontapp and one task of backapp (and frontapp and backapp tasks have to run simultaneously). Find ALL the pairs that have the MAXIMUM capacity under the requirement of device maximum capacity.