Google Interview Question: Question about scalability: H... | Glassdoor

Interview Question

Software Engineer Interview

Question about scalability: How would you sort a huge file

  - one that can not fit in memory?
technical, data structures, algorithm

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.