Google Interview Question for Software Engineer / Developers


Country: Russia
Interview Type: Phone Interview




Comment hidden because of low score. Click to expand.
14
of 16 vote

Assuming each byte is a character of the string (so basically 256 characters possible).

Create a suffix tree and find the node closest to the root which does not have 256 children.

- _anonymous September 22, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

..add the non-existing child to the path and print.

- memo September 22, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Don't really understand the question. What is the definition of a substring here?
In "Grass is green". "green" is obviously a substring, but is "rag" a valid one?("r", "a", "g" appear in that order but are not consecutive).
So the question is asking to find a substring that isn't in the file? Substring of what? Just any smallest permutation of 8 bit chars that doesn't appear in the file?

- fizzybuzzer September 23, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

@fizzybuzzer:

substring, sub-sequence
and subset, start with s, yet
seldom similar.

- Anonymous September 24, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

You mean trie.( because that would be better as the length willl be reduced even futher)

- Sudhanshu September 30, 2012 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

It has nothing to do with bit manipulation (as tagged)

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

Can I assume that if there are multiple such substrings of equal length, it suffices to return any one?

- Anonymous September 22, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

exactly.

- Anonymous September 22, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

test

- catch.rajatahuja December 10, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

test

- catch.rajatahuja December 10, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 2 votes

A pair of testes.

- Anonymous May 22, 2013 | Flag


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