Amazon SDE 1 Onsite

Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2025-03-05Added By Anonymous
Source: Link

Company: Amazon
Role: SDE 1
Interview Stage: Onsite
Location: unknown
Year: unknown

Original Post Content:

I was asked this question in Amazon onsite. I was not able to figure out how to do this.

Question:
Given 2MB of heap memory available, a 500 MB file, contains 32-bit unsorted integers. Write a function which takes a file name as input and return sorted file.
The interviewer asked me to assume that we already have a merge function in place and it can merge 2 chunks of 2MB each.

Could anyone help me understand what was the expectation here.

Comments