Interview Question


Country: United States




Comment hidden because of low score. Click to expand.
0
of 0 vote

Can we have name in those words? do we have any sort of dictionary to help? does the sentence requires to be correct gramatically?

- Krar September 29, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Actually I remember a similar question, where you are provided a Dictionary and a function provided to you to find if the string is a complete word..
Now the problem is purely how you decide on the algo to find words, as O(n) is definitely not an option, each call to the Dictionary is assumed to be very expensive ...

- Jack September 29, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

@Krar No its general words. Dictionary class. not necessarily

- AVK October 03, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

I think a bloom filter can be used here for better complexity.
Found this question nearly same as in the question id=4841145939001344

- Anonymous September 29, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

a brute force approach might work here... but first we need a dictionary to tell us where to break from???
now when we have got the word... there can be 2 cases-either this is the only word present in the dictionary ,in that case just place a space between.... if that found substring is a part of some other strings as well.. then... we need to keep the record of previous pointer and keep incrementing pointer... if the match is succsfll.. break it from the new ;position or else break it from the previous one!!!!

- ayushsethi22031992 September 29, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I think Tries will work in this scenario.

- allanchanly September 30, 2013 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More