## Expedia Interview Question for Developer Program Engineers

Country: United States
Interview Type: Phone Interview

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

Find the median in the x direction. Find the median in the y direction. I don't know how to prove this is the correct.

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

Codechef » Practice(Peer) » Meeting Point solution

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

Codechef» Practice(Peer) » Meeting Point solution

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

def minTotalDistance(self, grid):
x = sorted([i for i, row in enumerate(grid) for v in row if v == 1])
y = sorted([j for row in grid for j, v in enumerate(row) if v == 1])
return sum([abs(x[len(x)/2]-i)+abs(y[len(y)/2]-j) for i, row in enumerate(grid) for j, v in enumerate(row) if v == 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.