(From here)
I attended an interview last week and this question was asked:
How do you sort a billion rows of data in a file with only 640KB of memory in
If speed is not a requirement, you could bubble sort rows in place in the file. This only requires looking at two rows of data at a time, with no external information or storage required.