How to sort millions of rows of data in a file with less/meagre memory

后端 未结 9 508
不思量自难忘°
不思量自难忘° 2021-02-01 06:44

(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

9条回答
  •  鱼传尺愫
    2021-02-01 07:47

    I would not do it in C#, for starters. Are you sure you have this tagged right? This is a C problem, if it can be solved.

    640K only gives you 640 * 1024 * 8 bits so there's no way to solve this as framed. Perhaps that's the answer he/she was looking for. These Investment Bank interviews are something of a mindgame sometimes.

提交回复
热议问题