Word Break
Medium · Phone screen · Onsite · Full-time
Word break came up in my MongoDB phone interview. Given a string and a word dictionary, determine if the string can be split into valid dictionary words. The interviewer followed up with returning all possible segmentations, which is a much harder variant. They also asked about optimizing the dictionary lookups if the dictionary is very large.
