title: Most efficient way to store thousand telephone numbers
body: <p>This is a google interview question:</p>
  
  <p>There are around thousand phone numbers to be stored each having 10 digits. You can assume first 5 digits of each to be same across thousand numbers. You have to perform the following operations:
  a. Search if a given number exists.
  b. Print all the number</p>
  
  <p>What is the most efficient space saving way to do this ?</p>
  
  <p>I answered hash table and later huffman coding but my interviewer said I was not going in right direction. Please help me here.</p>
  
  <p>Could using a suffix trie help?</p>
  
  <p>Ideally 1000 numbers storing takes 4 bytes per number so in all it would take 4000 bytes to store 1000 number. Quantitatively, I wish to reduce the storage to &lt; 4000 bytes, this is what my interviewer explained to me.</p>