Pocket Gems interview question

1.Implement strstr(); 2. K frequent elements in an unsorted array. Follow Up: huge amount of data in the array