Accenture Interview Question
Software Engineer in TestsCountry: United States
Interview Type: In-Person
i'll rather maintain two trie (1 for all known nouns and other for all known verbs) and then read character by character out of the book breaking at each space to check in the trie for a match
I'm not sure a trie is a good way to go since it helps you find prefixes and match them up. Some nouns are prefixes of verbs. So there's not much of a benefit using a trie there since you are not narrowing down the possibilities with it's use.
Instead a HashTable or a Dictionary of nouns and verbs would make the search faster.
What does it mean "You may assume that the system already knows what are nouns and verbs" ? Do we have a function like isVerb(String word) or isNoun(String word)? If yes we can check words one by one and print them if at least one function return true. Can you explain the task in more detail?
A trie of a has table will do the work.
- Adi September 24, 2013To test, I am assuming the following function:
bool IsNounOrVerb(string word);
Test cases (black box):
Word = null
word is noun
word is verb
word is both verb and noun
word is neither verb nor noun
word is combination of special characters
word is a number string
Perform stress test for multi threading usage
Perform performance test since the system where the information about noun or verb could be slow
Perform various language test(I18N) if the function has that requirement
We can even explain other test strategies like acceptance testing, load testing, documentation check, static analysis for code improvements etc.