View All num of num See all Photos BlackBerry www.blackberry.com Engaged Employer Overview Reviews Salaries Interviews Jobs Photos Benefits 1.3k Reviews 2.2k Salaries 431 Interviews -- Jobs Follow Add Interview Follow Add Interview Interview Question Software Developer Interview BlackBerry Given an input string and a dictionary of words, segment the input string into a space-separated sequence of dictionary words if possible. For example, if the input string is "applepie" and the dictionary is a standard set of English words, then we would return the string "apple pie" as output. Tags: See more , See less 8 Answer Add Tags Answer Interview Answer 2 Answers ▲ 0 ▼ Have a loop that that checks if the dictionary contains "a", if not, check if it contains "ap" and so on... when found in the dictionary, substring the input string starting from the character after the matched word. Anonymous on Mar 16, 2013 ▲ 0 ▼ I think there is a more complicated answer to this question. The difficulty of this question is that if the string contains words that if cut in the wrong place may turn the remaining part of the sting without a match from the dictionary. The best answer I know of for this question involves dynamic programming. Google it. Anonymous on Nov 7, 2014 Interviews > Software Developer > BlackBerry Add Answers or Comments To comment on this, Sign In or Sign Up.