Want a Free Job Posting?

Buy a job posting today and the second one is on us. For a limited time only. Act Now.

Interview Question


Question about scalability: How would you sort a huge file

  - one that can not fit in memory?

Interview Answer

2 Answers


Try external Sorting algorithm N- way merge sort algorithm. Or tell Google if they let you work there you would use Map Reduce :P

quasar on May 10, 2010

Well, I don't know what the optimal algorithm would be... depends on the algorithms that handle disk read/write I would imagine, though it's been a while for me on this. But off the top of my head, I could see MergeSort as working for this, because you can take small chunks and sort those piece by piece.

somebody on Jul 20, 2010

Add Answers or Comments

To comment on this, Sign In or Sign Up.