Google Interview Question


Country: United States




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

Load balancer algorithm is an algorithm where the no of task or jobs to be processed should be less than that of threshold value.
Example of some load balancing algorithm are MAX-MAX,MAX-MIN,MIN-MAX,MIN-MIN. And the values are to be consider are execution time and conclusion time.
MAX-MAX is stands for maximum execution and maximum conclusion time and so on... .

- Debabrata Kundu September 25, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Load balancing for and in what?

- bigphatkdawg September 20, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

The data structure can have a Queue for input requests.
It should also have a Heap data structure with get_min() method that returns the one with min load.

- Raj September 21, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Should?
There are many types of load balancing requirements. Some require fancy forests and such.

- bigphatkdawg September 21, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Use some metric eg. Connection count
Corner cases : stale connections

- gene September 25, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 2 vote

Take a look at Consistent Hashing.

- Chander Shivdasani September 22, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

#include<stdio.H>
#define MAX 10
main()
{
int binary1,binary2;
binary1 =0100;
binary2=0111;
printf("%d \n",binary1+binary2);

}

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

Current load is not the only parameter in consideration. Sometimes a request cannot be assigned to a minimally loaded node. More information is required to answer this question.

- Noobie September 22, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

The function of load balancer is to distribute the load on all available backends equally.
Assuming load balancer has details of load of all backends, now if new request comes it should be directed to the backend with minimum load and this can be done in O(1) using min Heap data structure.

1. Request arrives at load balancer.
2. Load balancer picks the minimum load backed and route the request to it.
3. Load balancer increases the load on this backend server and performs heapify operation. O(logn).

- varun October 02, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

obviously this is very basic implementation considering only load as a parameter and as more and more constraints are introduced, we need to use more sophisticated algorithms for implementation.

- varun October 02, 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