Google Interview Question for Backend Developers


Country: United States




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

Wouldn't this be true if there are duplicates in the array and false otherwise?

- Tak904 March 01, 2018 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

Can be solved using trie by building suffixes trie.

- Sumit March 02, 2018 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Without other details we need to find if there are two equal numbers(map (number -> number counter)). If this is the case we found two subarrays of length 1.

- Vladimir March 06, 2018 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

solve is using max substring problem.

- Cooked March 24, 2018 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

We can use Rabin Karp algorithm and generate hash for each possible sub-string using rolling hash. Using rolling hash reduces the complexity of generating hash since we will be reusing hash value of previous substring.

Add these to a map<hash, <start_index, length>>. So if we find to substrings with same hash and length then compare them. If they are equal then we have solution.

- Solver October 04, 2018 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

Can you please give an example and clarify the problem a bit more. Thanks

- prudent_programmer March 01, 2018 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

Create a map for each element in the array. if all values are even for all keys in the map then yes array can be divided into 2 subarrays.

- Amit Bansal March 31, 2018 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Doesn't work for - 111

Possible subarrays - {1,1} {1,1} ,{1}{1} .

- anshuk2305 March 25, 2019 | 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