Google

  www.google.com
  www.google.com

Interview Question

Senior Product Manager Interview Mountain View, CA

What is the best way to sort a terabyte of array of data

  , when you have limited RAM (500k), and each array element has a couple of items of data, at about 1-10k each.
Answer

Interview Answer

4 Answers

0

You had to know sorting, memory management, Big-O calculations, and data structures.

Interview Candidate on Feb 6, 2012

This post has been removed.
Please see our Community Guidelines or Terms of Service for more information.

1

External merge sort is the answer

sri on Feb 21, 2012
7

External merge sort. First load the data chunk by chunk, sort it in-memory (by quicksort for example) and write it back in chunks. After this, use merge sort on the chunks. This is how most databases do sorting.

Anonymous on Apr 8, 2012

Add Answers or Comments

To comment on this Question, Sign In with Facebook or Sign Up