## Google Interview Question for Backend Developers

Country: United States

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

Can be solved using trie by building suffixes trie.

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

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

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.

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

solve is using max substring problem.

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.

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

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.

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

Doesn't work for - 111

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

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.

### 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.