Yahoo Interview Question for Software Engineer / Developers






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

suffix tree

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

yeah suffix tree would do the job..
create a suffix tree of the string of length N.then for each of M small strings of length L ,do the search in this tree and if the small string gets exhausted while reaching the leaf of suffix tree,then it means that the small string is present in the larger string..

- saumils1987 September 13, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

I believe the problem asked for the number of occurrences of a small string in a big string. In that way suffix tree cannot do the work.

- papaya September 14, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

alternatively,bulid generalized suffix tree of the big string of length N and all M small strings of length L.maintain a bit vector b[1...M] at each internal node of suffixtree.now go to each internal node if the subtree at the node contains part of the small string Mi,and bigstring then set b[i]=1;now in more traversal caliculate b[i] in that path if b[i]=M there is occurence of the small string.do this for all values of i

- PornStarFuckerOfCricket October 16, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Rabincarp string matching algorithm
read this on wiki

- Anonymous October 28, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

create trie with the M strings, and parse the large string and try to match it with the trie.

- ns February 20, 2011 | 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