Big Fish Interview Question
Software Engineer / DevelopersCountry: United States
Interview Type: Phone Interview
the question is how will you design such a service . you are correct as client starts typing , server should provide suggestion .
It depends on bunch of requirements and/or restrictions, such as the size of the dictionary, how many suggestions should the user see, how the word matching should be done (prefix- or suffix-matching), how many character are to be typed initially to begin suggesting words, etc.
Suppose I type the first character as "a", what do you think the dictionary/db data should I see as a suggestion - all the words beginning with "a" or only some of the first words? Also agree to eugen.yarovoi's counter question.
So, depending on the answers to all (or some) of the above questions/restrictions, you could think of different approaches, e.g. caching the DB data, creating your own trie-like DS, etc.
I think we can have a trie datastructure which will help us in maintaining a key value pair and it will also help in giving prefix search capability.
Now how the client side interaction takes place, we can have ajax calls but i am not too supporter of ajax calls it will take an ajax call per keypress
I want to continue ashot madatyan questions. lets say we are talking about web system. and lets say we are to show to the user up to 1000 words from the dictionary in an ordered manner.
how will you do it? for instance to show it in combo box is not helping much to the user.
I suggest a component called value picker which has pages and each page displayes 25 results and it has two buttons prev and next , prev displays previos results and next the next 25 results. my question is how will you do it in respect to the database?
can someone try and design a servlet for this purpose? please show how the queries from the data base are preformed. note also that transfering 1000 words each time to the user is very costly.
What exactly is the question? Is a dictionary a key-value service where the client supplies a lookup key and the server gives an output?
- Anonymous August 01, 2012