Its an unfair and automated process. I applied online and got a test link from hackerrank. Total time - 70 mins. One average DS and algo question and multiple choice core java questions. There is no way you can solve this problem in an hour. So keep the solution ready by your side and just type(do not copy -paste as hackerrank will detect it). Looks like that is what they want. This was the question which they want the candidate to code in an hour -
Given a list of strings and a search word.
you need to store the words in a proper data structure. Then iterate over the search word and for each prefix you need to return 3 words in lexicographical order.
List> solve(List words, String search)
example - words[aaaa, abcc, abd, abe]
search - abc
output - [[aaaa,abcc,abd],[abcc,abd,abe],[abcc]]
explanation - prefix a-aaaa,abcc,abd
prefix ab -abcc,abd,abe
prefix abc-abcc
I used a trie data structure and at each node I kept a TreeSet containing the words which would follow. I was getting two 2 instead of 3 words at each prefix. The time was over and I got an automated reply within 2 mins that I have been rejected. I did not get time to look at code java multiple choice questions.