Google Interview Question


Country: United States




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

Loda nhi jetega tu CONTEST

- yoyo January 25, 2018 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Someone please post the solution to this problem immediately. I am in middle of a exam

- Avi January 25, 2018 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

{Please solve this problem immediately. I am in middle of exam.}

- Avi January 25, 2018 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

#include<stdio.h>
int main()
{
printf("Please solve this problem immediately. I am in middle of exam.");
}

- Avi January 25, 2018 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

{Please solve this problem immediately. I am in middle of exam.

}

- Anonymous January 25, 2018 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

{Please solve this problem immediately. I am in middle of exam.

}

- Avi January 25, 2018 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

hello

- vraghuvaran123 February 09, 2020 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

private static int maxInterestProd(List<Integer> friendFrom, List<Integer> friendTo, List<Integer> weight, Integer friendCount) {
Map<Integer, List<Integer>> interestMap = new HashMap<>();
List<Integer> temp;
int maxsize = -1;
Set<Integer> maxInterest = new HashSet<>();
for(int i = 0; i < friendFrom.size(); i++) {
if(interestMap.containsKey(weight.get(i))) {
temp = interestMap.get(weight.get(i));
} else {
temp = new LinkedList<>();
}

temp.add(friendFrom.get(i));
temp.add(friendTo.get(i));

interestMap.put(weight.get(i), temp);

if(temp.size() > maxsize) {
maxInterest = new HashSet<>();
maxInterest.add(weight.get(i));
maxsize = temp.size();
} else if(temp.size() == maxsize) {
maxInterest.add(weight.get(i));
}
}

int totalMax = 0;
for(Integer mi : maxInterest) {
List<Integer> node = interestMap.get(mi);
int t = 0;
for(int i = 0; i < node.size() - 1; i+= 2) {
if(t < node.get(i) * node.get(i+1)) {
t = node.get(i) * node.get(i+1);
}
}
if(t > totalMax) {
totalMax = t;
}
}

return totalMax;
}

- AH August 30, 2020 | 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