title: Parsing one terabyte of text and efficiently counting the number of occurrences of each word
body: <p>Recently I came across an interview question to create a algorithm in any language which should do the following</p>
  
  <ol>
  <li>Read 1 terabyte of content </li>
  <li>Make a count for each reoccuring word in that content </li>
  <li>List the top 10 most frequently occurring words</li>
  </ol>
  
  <p>Could you let me know the best possible way to create an algorithm for this?</p>
  
  <p>Edit:</p>
  
  <p>OK, let's say the content is in English. How we can find the top 10 words that occur most frequently in that content? My other doubt is, if purposely they are giving unique data then our buffer will expire with heap size overflow. We need to handle that as well.</p>