Amazon OA SDE I (2 coding questions)
Anonymous User
16487

The 2 coding questions were:

1.) Minimum Cost of Merging Files
Question and Solution: https://www.csestack.org/minimum-cost-merging-files/
I didn't use the solution in the link which uses min(list), which is O(N), inside of a loop. I solved it much more efficiently by
using min_heap.

2.) Amazon Prime Air Route:
Question: https://www.careercup.com/question?id=5750442676453376
Solution: traverse through both arrays, and compare and keep track of optimal pairs that don't exceed max (sliding window I think).
There might've been a more efficient solution using sorting but I was low on time.

All test cases passed for both questions so that's good. I also had to type down an explanation of my approach and the runtime for each of my solutions.

Comments (8)