Google Interview Question

Count prefix match in a sorted String array. Follow up question: handle unsorted string array, keep in mind you get millions of records to process so work on space and time complexities.