Google

  www.google.com
  www.google.com

Interview Question

Software Engineer Interview

Question about scalability: How would you sort a huge file

  - one that can not fit in memory?
Tags:
Answer

Interview Answer

2 Answers

0

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
0

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 Question, Sign In with Facebook or Sign Up